CINXE.COM
Mapa Tr贸jmiasta - Gda艅sk, Sopot, Gdynia
<!doctype html> <html lang="pl"> <head> <base href="https://mapa.trojmiasto.pl/"> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TWZSSSV9');</script><!-- End Google Tag Manager --> <title>Mapa Tr贸jmiasta - Gda艅sk, Sopot, Gdynia</title> <meta http-equiv="x-dns-prefetch-control" content="on"> <link rel="dns-prefetch" href="https://s-trojmiasto.pl"> <link rel="dns-prefetch" href="https://x-trojmiasto.pl"> <link rel="dns-prefetch" href="https://region1.google-analytics.com"> <link rel="dns-prefetch" href="https://www.googletagmanager.com"> <link rel="dns-prefetch" href="https://securepubads.g.doubleclick.net"> <link rel="dns-prefetch" href="https://tt.onthe.io"> <link rel="dns-prefetch" href="https://rumcdn.geoedge.be"> <link rel="dns-prefetch" href="https://cdn-cookieyes.com"> <link rel="dns-prefetch" href="https://directory.cookieyes.com"> <link rel="dns-prefetch" href="https://log.cookieyes.com"> <link rel="preconnect" href="https://s-trojmiasto.pl"> <link rel="preconnect" href="https://x-trojmiasto.pl"> <link rel="preconnect" href="https://region1.google-analytics.com"> <link rel="preconnect" href="https://adservice.google.com"> <link rel="preconnect" href="https://googleads.g.doubleclick.net"> <link rel="preconnect" href="https://www.googletagservices.com"> <link rel="preconnect" href="https://tpc.googlesyndication.com"> <link rel="preconnect" href="https://pagead2.googlesyndication.com"> <link rel="preconnect" href="https://partner.googleadservices.com"> <link rel="preconnect" href="https://tt.onthe.io"> <link rel="preconnect" href="https://rumcdn.geoedge.be" crossorigin> <link rel="preconnect" href="https://cdn-cookieyes.com"> <link rel="preconnect" href="https://directory.cookieyes.com"> <link rel="preconnect" href="https://log.cookieyes.com"> <meta name="keywords" content="mapa, mapy, plan, plany, interaktywna, interaktywny, wirtualna, Gda艅sk, Gdynia, Sopto, Tr贸jmiasto, miasto, miasta, miast, wyszukiwnie, ulic, ulice"> <meta name="description" content="Interaktywna Mapa Tr贸jmiasta (Gda艅sk, Sopot, Gdynia) - mapa powi膮zana z prezentacjami obiekt贸w w Portalu Regionalnym Trojmiasto.pl"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="google-site-verification" content="whd_2eL6n23MhI__o_4vNSfwmAUyoflMMz41nqUQsBY"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta property="article:publisher" content="https://www.facebook.com/trojmiastopl/"> <meta property="fb:app_id" content="522465873299180"> <meta property="fb:pages" content="155607301131382"> <meta property="og:description" content="Interaktywna Mapa Tr贸jmiasta (Gda艅sk, Sopot, Gdynia) - mapa powi膮zana z prezentacjami obiekt贸w w Portalu Regionalnym Trojmiasto.pl"> <meta property="og:image" content="https://s-trojmiasto.pl/zdj/c/n/59/2303/300x300/2303440__kr.jpg?r=2024112813"> <meta property="og:locale" content="pl_PL"> <meta property="og:site_name" content="trojmiasto.pl"> <meta property="og:title" content="Mapa Tr贸jmiasta - Gda艅sk, Sopot, Gdynia"> <meta property="og:type" content="website"> <meta property="og:url" content="https://mapa.trojmiasto.pl/"> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:description" content="Interaktywna Mapa Tr贸jmiasta (Gda艅sk, Sopot, Gdynia) - mapa powi膮zana z prezentacjami obiekt贸w w Portalu Regionalnym Trojmiasto.pl"> <meta property="twitter:image" content="https://s-trojmiasto.pl/zdj/c/n/59/2303/300x300/2303440__kr.jpg?r=2024112813"> <meta property="twitter:site" content="@Trojmiasto_pl"> <meta property="twitter:title" content="Mapa Tr贸jmiasta - Gda艅sk, Sopot, Gdynia"> <meta property="twitter:url" content="https://mapa.trojmiasto.pl/"> <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:5"> <meta name="format-detection" content="telephone=no"> <link rel="canonical" href="https://mapa.trojmiasto.pl/"> <link rel="shortcut icon" href="https://s-trojmiasto.pl/_img/favicon/favicon.ico" type="image/x-icon"> <link rel="icon" sizes="48x48" href="https://s-trojmiasto.pl/_img/favicon/touch-icon-48x48.png" type="image/png"> <link rel="icon" sizes="192x192" href="https://s-trojmiasto.pl/_img/favicon/touch-icon-192x192.png" type="image/png"> <link rel="apple-touch-icon" sizes="180x180" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-180x180-precomposed.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-152x152-precomposed.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-120x120-precomposed.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-76x76-precomposed.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-precomposed.png"> <link rel="apple-touch-icon" href="https://s-trojmiasto.pl/_img/favicon/apple-touch-icon-precomposed.png"> <link rel="stylesheet" href="https://x-trojmiasto.pl/combo/f=/_style/reset.css,/_style/common.css,/_style/a_d_s/b.css,/_style/fonts/OpenSans/OpenSans.css,/_style/map/layout_mapa.css,/_style/map/icons.css?4f9bd1ed9d205fec.120"> <script src="/_js/url.js"></script> <script>var homeDir = "https://www.trojmiasto.pl";</script> <script>var currentService = 'mapa';</script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='/_js/vendor/jquery3/3.7.1/jquery.min.js' %3E%3C/script%3E")); } </script> <script src="https://s-trojmiasto.pl/_js/vendor/jquery3/jquery-migrate-3.0.0.min.js"></script> <script src="https://x-trojmiasto.pl/combo/f=/_js/vendor/jquery-ui.min.js?9"></script> <script src="https://x-trojmiasto.pl/combo/f=/_js/main.js,/_js/_partials/header.js,/_js/bs.js,/_js/_partials/navigation_events.js,/_js/map/events.js?4f9bd1ed9d205fec.120"></script> <script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/1afa9076747d24f6ec5afeb6/script.js"></script> <script> $(document).ready(function() { $("#ot-sdk-btn").show(); }); </script> <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> <script src="https://cdn.cookielaw.org/consent/tcf.stub.js"></script> <script data-cfasync="false"> (function(w, d) { var s = d.createElement("script"); s.src = "//cdn.adpushup.com/44921/adpushup.js"; s.crossOrigin = "anonymous"; s.type = "text/javascript"; s.async = true; (d.getElementsByTagName("head")[0] || d.getElementsByTagName("body")[0]).appendChild(s); w.adpushup = w.adpushup || { que: [] }; })(window, document); </script> <script async src="//www.statsforads.com/tag/3dae91c3-ec47-4d9e-9c75-2e27f463e3f4.min.js"></script> <script> window.grumi = { key: '79e283a7-92cb-49e8-92d3-1656d1a32a83' }; </script> <script src="//rumcdn.geoedge.be/79e283a7-92cb-49e8-92d3-1656d1a32a83/grumi-ip.js" async></script> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="iw"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=corsproxy" data-sourceurl="https://mapa.trojmiasto.pl/"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://mapa.trojmiasto.pl/"></script> <meta name="robots" content="none"> </head> <body> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=navigationui" data-environment="prod" data-proxy-url="https://mapa-trojmiasto-pl.translate.goog" data-proxy-full-url="https://mapa-trojmiasto-pl.translate.goog/?_x_tr_sl=pl&_x_tr_tl=iw&_x_tr_hl=en-GB" data-source-url="https://mapa.trojmiasto.pl/" data-source-language="pl" data-target-language="iw" data-display-language="en-GB" data-detected-source-language="" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=pl&tl=iw&hl=en-GB&u=https://mapa.trojmiasto.pl/&anno=2" data-client="tr"></script><!-- phpdeveloper? join us! mail('praca@trojmiasto.pl', 'phpdeveloper', $cv.$short_desc); --> <!-- Google Tag Manager (noscript) --> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TWZSSSV9" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript><!-- End Google Tag Manager (noscript) --> <script> $(function() { $("a.l").each(function() { $(this).attr("href", $(this).attr("rel")); }) }); </script> <div class="main-wrap-outer"> <div class="main-wrap" id="main-wrap"> <div id="main_container"> <link rel="stylesheet" href="https://s-trojmiasto.pl/_style/vendor/perfect-scrollbar.css"> <link rel="stylesheet" href="https://s-trojmiasto.pl/_style/map/map.css?refresh=2"> <link rel="stylesheet" href="https://s-trojmiasto.pl/_style/trojmiasto.map.min.css?4f9bd1ed9d205fec.120"> <script src="https://s-trojmiasto.pl/_js/map/trojmiasto.map.min.js?4f9bd1ed9d205fec.120"></script> <script src="/_js/vendor/perfect-scrollbar.min.js"></script> <div id="map-overlay" class="map-overlay"> </div> <div class="map-overlay-background"> </div> <div id="map"></div> <div id="map-ui"><a id="map-ui-logo" href="https://translate.google.com/website?sl=pl&tl=iw&hl=en-GB&u=https://www.trojmiasto.pl/" target="_blank" title="Trojmiato.pl">Trojmiasto.pl</a> <div id="map-ui-search"> <div id="imap_seek"> <div id="map_seeker"> <form class="map-ui-search-form" id="searchForm" method="post"><input class="map-ui-search-input" type="text" name="map_seeker_input" id="map_seeker_input" placeholder="czego szukasz?"> <input type="hidden" name="id_ulica" id="id_ulica"> <input type="hidden" name="id_ob" id="id_ob"> <input type="hidden" name="r" id="r"> <input class="map-ui-search-button" type="submit" id="map_seeker_submit" value="Szukaj"> <div id="autocompleteWrapper" class="map-ui-autocomplete-wrapper"></div><a id="map-ui-search-clear" class="map-ui-search-clear" href="javascript:void(0)?_x_tr_sl=pl&_x_tr_tl=iw&_x_tr_hl=en-GB"></a> </form> </div> <div id="map_warn_no" style="display:none;"> Wype艂nij pole adresowe. </div> <div class="map-ui-search-results" id="map_seek_results"></div> </div> </div> <div id="map-ui-zoom" class="map-zoom-0"> <div class="map-ui-zoom-button map-ui-zoom-in"></div> <div class="map-ui-zoom-button map-ui-zoom-out"></div> </div> <div id="map-ui-scale" class="map-scale"></div> <div id="map-ui-menu"> <div class="map-ui-container map-ui-menu-cat map-ui-menu-types"> <div id="map-ui-type" class="map-ui-submenu" data-type="basic"> <div class="map-ui-submenu-title"> Mapy </div> <div class="map-ui-submenu-close"></div> <ul class="map-ui-submenu-list"> <li class="map-ui-type-item map-type-basic "></li> <li class="map-ui-type-item map-type-ortho "> <div class="map-ui-type-sub map-type-ortho2016"> 2016 </div> <div class="map-ui-type-sub map-type-ortho2014"> 2014 </div> <div class="map-ui-type-sub map-type-ortho2011"> 2011 </div> <div class="map-ui-type-sub map-type-ortho2008"> 2008 </div></li> <li class="map-ui-type-item map-type-history "></li> </ul><!--/div--> </div> </div> <div class="map-ui-container map-ui-menu-cat map-ui-menu-roads"> <div class="map-ui-submenu"> <div class="map-ui-submenu-title"> Drogi </div> <div class="map-ui-submenu-close"></div> <ul class="map-ui-submenu-list"> <li class="map-ui-type-streets"><span class="ui-subitem-label">Ulice</span> <span class="ui-subitem-icons"> <i class="ui-subitem-icon"></i> </span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Trasy rowerowe</span> <span class="ui-subitem-icons"> <i class="ui-subitem-icon" data-layer="bikes"></i> </span> <span class="ui-menu-switch"></span></li> </ul> </div> </div> <div class="map-ui-container map-ui-menu-cat map-menu-objects "> <div class="map-ui-submenu"> <div class="map-ui-submenu-title"> Obiekty </div> <div class="map-ui-submenu-close"></div> <ul class="map-ui-submenu-list"> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Firmy i instytucje</span> <span class="ui-subitem-icons"> <img alt="firmy" src="https://s-trojmiasto.pl/_img/map/ico_new/_default.png" data-layer="1"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Zabytki i ko艣cio艂y</span> <span class="ui-subitem-icons"> <img alt="zamki" src="https://s-trojmiasto.pl/_img/map/ico_new/_castle.png" data-layer="2"> <img alt="muzea" src="https://s-trojmiasto.pl/_img/map/ico_new/_museum.png" data-layer="2"> <img alt="ko艣cio艂y" src="https://s-trojmiasto.pl/_img/map/ico_new/_church.png" data-layer="19"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Rozrywka</span> <span class="ui-subitem-icons"> <img alt="kina" src="https://s-trojmiasto.pl/_img/map/ico_new/_cinema.png" data-layer="4"> <img alt="muzyka" src="https://s-trojmiasto.pl/_img/map/ico_new/_music.png" data-layer="6"> <img alt="teatry" src="https://s-trojmiasto.pl/_img/map/ico_new/_theatre.png" data-layer="3"> <img alt="koncerty" src="https://s-trojmiasto.pl/_img/map/ico_new/_concert.png" data-layer="42"> <img alt="boiska" src="https://s-trojmiasto.pl/_img/map/ico_new/_playground.png" data-layer="41"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Gastronomia</span> <span class="ui-subitem-icons"> <img alt="restauracje" src="https://s-trojmiasto.pl/_img/map/ico_new/_restaurant.png" data-layer="5"> <img alt="bary" src="https://s-trojmiasto.pl/_img/map/ico_new/_beer.png" data-layer="7"> <img alt="kawiarnie" src="https://s-trojmiasto.pl/_img/map/ico_new/_coffee.png" data-layer="23"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Zakupy</span> <span class="ui-subitem-icons"> <img alt="sklepy" src="https://s-trojmiasto.pl/_img/map/ico_new/_shop.png" data-layer="38"> <img alt="markety" src="https://s-trojmiasto.pl/_img/map/ico_new/_market.png" data-layer="39"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Nauka i szkolnictwo</span> <span class="ui-subitem-icons"> <img alt="biblioteki" src="https://s-trojmiasto.pl/_img/map/ico_new/_library.png" data-layer="35"> <img alt="przedszkola" src="https://s-trojmiasto.pl/_img/map/ico_new/_kinder.png" data-layer="36"> <img alt="szko艂y" src="https://s-trojmiasto.pl/_img/map/ico_new/_school.png" data-layer="40"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Sport i rekreacja</span> <span class="ui-subitem-icons"> <img alt="bieganie" src="https://s-trojmiasto.pl/_img/map/ico_new/_run.png" data-layer="33"> <img alt="boiska" src="https://s-trojmiasto.pl/_img/map/ico_new/_football.png" data-layer="43"> <img alt="si艂ownie" src="https://s-trojmiasto.pl/_img/map/ico_new/_gym.png" data-layer="34"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Transport</span> <span class="ui-subitem-icons"> <img alt="stacje benzynowe" src="https://s-trojmiasto.pl/_img/map/ico_new/_gas.png" data-layer="13"> <img alt="stacje 艂adowania" src="https://s-trojmiasto.pl/_img/map/ico_new/_electric.png" data-layer="32"> <img alt="parkingi" src="https://s-trojmiasto.pl/_img/map/ico_new/_parking.png" data-layer="20"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Turystyka</span> <span class="ui-subitem-icons"> <img alt="hotele" src="https://s-trojmiasto.pl/_img/map/ico_new/_hotel.png" data-layer="16"> <img alt="punkty widokowe" src="https://s-trojmiasto.pl/_img/map/ico_new/_panorama.png" data-layer="21"> <img alt="kantory" src="https://s-trojmiasto.pl/_img/map/ico_new/_exchange.png" data-layer="14"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Inne</span> <span class="ui-subitem-icons"> <img alt="szpitale" src="https://s-trojmiasto.pl/_img/map/ico_new/_hospital.png" data-layer="8"> <img alt="banki" src="https://s-trojmiasto.pl/_img/map/ico_new/_bank.png" data-layer="11"> <img alt="apteki" src="https://s-trojmiasto.pl/_img/map/ico_new/_pharm.png" data-layer="12"> </span> <span class="ui-menu-switch"></span></li> </ul> </div> </div> <div class="map-ui-container map-ui-menu-cat map-menu-investitions "> <div class="map-ui-submenu"> <div class="map-ui-submenu-title"> Inwestycje </div> <div class="map-ui-submenu-close"></div> <ul class="map-ui-submenu-list"> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Osiedla dom贸w</span> <span class="ui-subitem-icons"> <img alt="domy" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-house.png" data-layer="25"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Osiedla o zabudowie 艂膮czonej</span> <span class="ui-subitem-icons"> <img alt="mieszane" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-mix.png" data-layer="26"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Osiedla mieszkaniowe</span> <span class="ui-subitem-icons"> <img alt="mieszkania" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-appart.png" data-layer="27"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Biurowce</span> <span class="ui-subitem-icons"> <img alt="biurowce" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-office.png" data-layer="28"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Magazyny</span> <span class="ui-subitem-icons"> <img alt="magazyny" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-warehouse.png" data-layer="29"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Zabudowa mieszkalno biurowa</span> <span class="ui-subitem-icons"> <img alt="mieszkalno biurowa" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-mix-office.png" data-layer="31"> </span> <span class="ui-menu-switch"></span></li> <li class="map-ui-submenu-item"><span class="ui-subitem-label">Mieszkania inwestycyjne</span> <span class="ui-subitem-icons"> <img alt="mieszkania inwestycyjne" src="https://s-trojmiasto.pl/_img/map/ico_new/inv-ico-deluxe.png" data-layer="44"> </span> <span class="ui-menu-switch"></span></li> </ul> </div> </div> </div> <div id="map-ui-type-simple" class="map-ui-type-simple" data-type="basic"> <ul class="map-ui-submenu-list"> <li class="map-ui-type-item map-type-basic "></li> <li class="map-ui-type-item map-type-ortho "> <div class="map-ui-type-sub map-type-ortho2016"> 2016 </div></li> </ul> </div> </div> <script src="/_js/map/Menu.js?refresh=1"></script> <script src="/_js/map/Search.js"></script> <script src="/_js/map/Ob.js"></script> <script src="/_js/map/Router.js"></script> <script> var shortType = { 'basic': 'b', 'ortho2016': 'o', 'ortho2014': 'o2014', 'ortho2011': 'o2011', 'ortho2008': 'o2008', 'history': 'h' }; var defaultType = { 'b': 'basic', 'o': 'ortho2016', 'o2016' : 'ortho2016', 'o2014' : 'ortho2014', 'o2011' : 'ortho2011', 'o2008': 'ortho2008', 'h': 'history' }; var specialLayers = { 'bikes' : 'bikes', 'hotspot' : '10', 'media' : '21', 'atm' : '17', 'theater' : '3', 'restaurant' : '5', 'monuments' : '2', 'sleep' : '16', // noclegi 'traffic' : '22', // fotoradary, }; var parseLayerQuery = function(type) { var re = /\&([a-z]+)/, match = re.exec(type); if(match) { return match[0]; } return null; }; var parseTypeQuery = function(type) { type = type || ''; var match = type.split("&"), layer = specialLayers[match[1]]; if(layer) { return { layer: specialLayers[match[1]], type: match[0] }; } return { type: match[0] }; }; var map; var streetsState = true; $.when( $(document).ready, $.get('map_data/investitions.json'), $.get('map_data/gasstations.json'), $.get('map_data/train.json'), $.get('map_data/beach.json') ).then( function(ready, resInvestitions, resGas, resTrain, resBeach) { var markers = [].concat(resInvestitions[0], resGas[0], resTrain[0], resBeach[0]); var layers = { hide: [ "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "25", "32", "25", /* inw_dom */ "26", /* inw_mieszane */ "27", /* inw_mieszkanie */ "28", /* inw_biuro */ "29", /* inw_magazyn */ "30", /* inw_hotel */ "31", /* inw_mieszk_biur */ "44" /* inw_deluxe */ ], show: [ "1", /* obiekty */ "24", /* skm, ztm */ "37", /*plaze*/ ] }; function $getClassList(item) { return $(item).attr("class").split(/\s+/); } var Map = trojmiasto.Map; var options = Router.getParams(location.href.split("#")[1] || '') || {}, typeQuery = parseTypeQuery(options.type); if(typeQuery.type) { options.type = defaultType[typeQuery.type]; } options.enableDistricts = true; options.tileMarkers = true; options.markers = markers; if(options.hasOwnProperty('x') && options.hasOwnProperty('y')) { options.coordinates = { x: options['x'], y: options['y'] } delete options['x']; delete options['y']; } map = new Map(document.getElementById("map"), options); window.map = map; var customAttributionPrefix = ''; map.setAttributionPrefix([ '<a class="custom-attrib-link-copy" href="javascript:void(0)">Kopiowanie</a>', '<a class="custom-attrib-link-company" href="javascript:void(0)">Twoja firma na mapie</a>' ].join(' | ')); var mapUiContainer = $("#map-ui"), mapUiType = $("#map-ui-type, #map-ui-type-simple"), mapUiZoom = $("#map-ui-zoom"), mapUiScale = $("#map-ui-scale"), mapUiZoomIn = mapUiZoom.children(".map-ui-zoom-in").first(), mapUiZoomOut = mapUiZoom.children(".map-ui-zoom-out").first(), mapUiTypeItem = mapUiContainer.find(".map-ui-type-item"), mapUiTypeSub = mapUiContainer.find(".map-ui-type-sub"), mapUiTypeStreets = mapUiContainer.find('.map-ui-type-streets'), mapUiMenu = mapUiContainer.find('#map-ui-menu'); mapUiSearchClear = $("#map-ui-search-clear"); var menu = new Menu(); var categories = $(".map-ui-menu-cat").each( function(i, cat) { var tree = new Tree(cat); var cat = $(cat); cat.find('.map-ui-submenu-item').each( function(j, sub) { var branch = new Branch(sub); var sub = $(sub); $(sub).children('.ui-subitem-icons').children('[data-layer]').each( function(k, item) { var layer = $(item).attr("data-layer"); var leaf = new Leaf(layer); branch.addLeaf(leaf); }); branch.onChangeState( function() { var classState = {} classState[Branch.State.CHECKED] = 'checked'; classState[Branch.State.UNDETERMINED] = 'undetermined'; classState[Branch.State.UNCHECKED] = ''; var branchSwitch = sub;//.children('.ui-menu-switch').first(); $(branchSwitch).attr('data-state', classState[this.getState()]); }); // show/hide whole branch $(sub).on('click', function() { var leafs = branch.getLeafs(); // leafs as object var ids = Object.getOwnPropertyNames(leafs); if(branch.getState() !== Branch.State.CHECKED) { map.showLayers(ids); } else { map.hideLayers(ids); } }); tree.addBranch(branch); }); // category toggle $(cat).on('click', function(event) { if (event.target !== this) { return; } $(cat).siblings().children('.map-ui-submenu').toggle(false); $(cat).children('.map-ui-submenu').toggle(); }); $(cat).on('click', '.map-ui-submenu-close', function() { $(cat).children('.map-ui-submenu').toggle(false); }); // prevent menu from toggle on category toggle /*$(cat).children('.map-ui-submenu').on('click', function(event) { event.stopImmediatePropagation(); });*/ // show/hide whole category $(cat).children('.ui-menu-switch').on('click', function(event) { event.stopImmediatePropagation(); var leafs = tree.getLeafs(); var ids = Object.getOwnPropertyNames(leafs); if(tree.getState() !== Tree.State.CHECKED) { map.showLayers(ids); tree.update(); } else { map.hideLayers(ids); tree.update(); } }); tree.onChangeState( function() { return; var classState = {} classState[Branch.State.CHECKED] = 'checked'; classState[Branch.State.UNDETERMINED] = 'undetermined'; classState[Branch.State.UNCHECKED] = ''; var catSwitch = cat;//.children('.ui-menu-switch').first(); $(catSwitch).attr('class', 'ui-menu-switch '+classState[this.getState()]); }); menu.addTree(tree); }); // zaznacz zabudow臋 艂膮czon膮 przy wyborze jednorodzinnej var $single = $("[data-layer=25]").parents(".map-ui-submenu-item"); var $mixed = $("[data-layer=26]").parents(".map-ui-submenu-item"); $single.click(function () { if ($single.attr("data-state") === "checked" && $mixed.attr("data-state") !== "checked") { $mixed.click(); } }); $("#map").on("mousedown", function() { $('.map-ui-submenu:visible').hide(); }); map.setActionCallback(Map.Actions.COORDINATES_CHANGE, function(coordinates) { var params = {x: coordinates.x, y: coordinates.y, zoom: map.getZoom()}; Router.updateParams(params); }); map.setActionCallback(Map.Actions.LAYER_TOGGLE, function(layers) { menu.toggleLeafs(layers); Router.updateParams({layers: RouterHelper.layersToParam(layers)}); }); map.setActionCallback(Map.Actions.ZOOM_CHANGE, function(zoom) { /*console.log(Map.Actions.ZOOM_CHANGE+' : '+zoom); var coordinates = map.getCoordinates(); Router.updateParams({zoom: zoom, x:coordinates.x, y:coordinates.y});*/ // update UI mapUiZoom.attr("class","map-zoom-"+zoom); mapUiScale.attr("class","map-scale map-zoom-"+zoom); }); map.setActionCallback(Map.Actions.TYPE_CHANGE, function(type) { Router.updateParams({type: (shortType[type] || type)}); // update UI mapUiType.attr("data-type",type); if(type === Map.Types.TYPE_HISTORY) { map.toggleMarkerLayer(false); $('.map-menu-objects').hide(); $('.map-menu-investitions').hide(); } else { map.toggleMarkerLayer(true); $('.map-menu-objects').show(); $('.map-menu-investitions').show(); } mapUiTypeStreets.toggleClass('map-ui-force', type === Map.Types.TYPE_BASIC); }); var setStreetsUI = function(streets) { streets = streets || map.getType() === Map.Types.TYPE_BASIC; mapUiTypeStreets.attr('data-state', (streets ? "checked" : "")); }; map.setActionCallback(Map.Actions.STREETS_CHANGE, setStreetsUI); setStreetsUI(map.getStreetsStatus()); map.setActionCallback(Map.Actions.LOCATION_CHANGE, function(location) { var coordinates = map.getCoordinates(); var route = '/map/'+coordinates.x+','+coordinates.y+','+map.getZoom()+','+shortType[map.getType()]; if(!location) { Router.setRoute(route); } else { //Router.updateParams({locationX: location.x, locationY: location.y}); Router.setRoute('/location/'+location.x+","+location.y+route); } }); mapUiTypeItem.on("click", function(event) { var type; var classes = $getClassList(this); for(var i = 0; classes.length; i++) { var cls = classes[i]; if(cls !== 'map-ui-type-item') { type = cls.substr("map-type-".length); break; } } if(type) { if(type === 'ortho') type = 'ortho2016'; map.setType(type, streetsState); } }); mapUiTypeSub.on("click", function(event) { event.stopImmediatePropagation(); var type; var classes = $getClassList(this); for(var i = 0; classes.length; i++) { var cls = classes[i]; if(cls !== 'map-ui-type-sub') { type = cls.substr("map-type-".length); break; } } if(type) { if(type === 'ortho') type = 'ortho2016'; map.setType(type, streetsState); } }); mapUiTypeStreets.on("click", function(event) { streetsState = !map.getStreetsStatus(); map.toggleStreets(streetsState); }); mapUiZoomIn.on('click', function() { map.setZoom(map.getZoom()+1); }); mapUiZoomOut.on('click', function() { map.setZoom(map.getZoom()-1); }); if(options.hasOwnProperty('layers')) { layers.show = layers.show.concat(options.layers.split(';')) .filter(function(item, index, arr) { return arr.indexOf(item) === index; }); } else { if(typeQuery.layer && layers.show.indexOf(typeQuery.layer) === -1) { layers.show.push(typeQuery.layer); if(layers.hide.indexOf(typeQuery.layer) !== -1) { layers.hide.splice(layers.hide.indexOf(typeQuery.layer), 1); } } map.hideLayers(layers.hide); } map.showLayers(layers.show); if(options.hasOwnProperty('zoom')) { mapUiZoom.attr("class","map-zoom-"+options.zoom); mapUiZoom.attr("class","map-zoom-"+options.zoom); mapUiScale.attr("class","map-scale map-zoom-"+options.zoom); } if(options.type) { mapUiType.attr("data-type", options.type); // TODO: refactor/DRY mapUiTypeStreets.toggleClass('map-ui-force', options.type === Map.Types.TYPE_BASIC); } var initLayers = RouterHelper.layersToParam(map.getLayers()); // TODO: usunac po poprawieniu starych linkow w bazie/repo (function() { // NOTE: przekierowanie na nowy adres poczatkowy przed wlasciwym routerem var routeOverride = '/map/'+map.getCoordinates().x+","+map.getCoordinates().y+","+map.getZoom()+","+shortType[map.getType()]+","+initLayers; var route = window.location.href.split('#')[1]; if(!route) { return; } routeOverride = route.replace(/\/map\/.*/, routeOverride); window.location.replace(window.location.href.split('#')[0] + '#' +routeOverride); })() Router.init('/map/'+map.getCoordinates().x+","+map.getCoordinates().y+","+map.getZoom()+","+shortType[map.getType()]+","+initLayers); }); </script> <script> $("document").ready(function() { var createHeader = function(title) { return $('<div class="map-overlay-close">'+title+'<span class="map-overlay-close-button"></span></div>'); }; var closeOverlay = function() { $('#map-overlay').html(''); $('body').toggleClass('overlay-active', false); }; $(".map-overlay-background").on('click', closeOverlay); $(".map-overlay").on('click', ".map-overlay-close-button", closeOverlay); $("#map").on("click", ".custom-attrib-link-copy", function() { $('body').toggleClass('overlay-active', true); $('#map-overlay').html('<iframe src="kopiowanie.html" width="100%" height="350" frameborder="0" scrolling="no"></iframe>'); $('#map-overlay').prepend(createHeader('Kopiowanie fragmentu mapy')); }); $("#map").on("click", ".custom-attrib-link-company", function() { $('body').toggleClass('overlay-active', true); $('#map-overlay').html('<iframe src="firma_na_mapie.php" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>'); $('#map-overlay').prepend(createHeader('Twoja firma na mapie')); }); }); </script> <script> var search = new Search('/_ajax/get_street_result/'); var searchScrollbar = new PerfectScrollbar("#map_seek_results", { scrollingThreshold: 0, suppressScrollX: true }); $(window).on('resize', function() { searchScrollbar.update(); }); search.setSelectItem( function(x, y, z, l){ map.pointAt({"x": x, "y": y}); if( l>=0) { map.showLayers([l.toString()]); } }); search.onBeforeQuery( function(query) { searchInput.val(query); $('#map_warn_no').css('display', 'none'); $('#map_seek_results').html('<div class="map_seek_result_loader"></div>'); $('#searchForm').toggleClass('map-ui-search-active', true); }); search.onReset( function() { searchInput.val(''); $('#map_warn_no').css('display', 'none'); $('#map_seek_results').html(''); $('#searchForm').toggleClass('map-ui-search-active', false); }); search.onSuccess( function(data, query, result) { var hide_warn = data['hide_warn'] ? data['hide_warn'] : 0; var message = data['komunikat'] ? data['komunikat'] : 0; var data = data['dane'] || []; var html = $('<div class="map-ui-search-wrapper"></div>'); var warning = null; var itemsList = []; if(hide_warn !=1) { if(data.length == 0) { html.append('<div id="map_warn">Brak danych spe艂niaj膮cych kryteria.</div>'); if( message['DYM'] ) { var hint = $('<a><strong>'+message['DYM']+'</strong></a>'); hint.onclick( function(event) { }); var hint_message = $('<div style="color: black">Czy chodzi艂o ci o:</div>').append(hint); html.append($(hint_message)); } } if(message['brak_numeru']) { html.append('<div id="map_warn">Nie znalezniono podanego numeru ulicy.</div>'); } } if( !message['brak_numeru'] || hide_warn != 1 ) for(var i = 0; i<data.length; i++) { var item = data[i]; if(i == 1 && message['brak_numeru']) { //TODO: ??????? } var href = '#/search/'+encodeURIComponent(query)+'/r/'+(i+1); var element = $('<div class="map_seek_result" data-type="'+item['i']+'"></div>'); var content = $('<a href="'+href+'"></a>'); var type = (item['typ_nazwa'] && item['typ_nazwa_skrot']) ? (item['typ_nazwa_skrot']+' ') : item['typ_nazwa'] ? (item['typ_nazwa']+' ') : ''; var pre = (item['przedrostek'] && item['przedrostek_skrot']) ? (item['przedrostek_skrot']+' ') : item['przedrostek'] ? (item['przedrostek']+' ') : ''; var name = item['nazwa']; var name_add = item['nazwa_dodatek'] ? ' '+item['nazwa_dodatek'] : ''; var city = item['miasto']; //content.append('<div class="fL mapicon-wrap"><div class="map-icon-'+item['i']+'"></div></div>'); content.append('<div class="map-search-result-item"><strong class="street">'+type+pre+name+name_add+'</strong><span class="city">'+city+'</span></div>'); element.append(content); if(item['ed_link']) { var ed = '<a href="'+item['ed_link']+'" class="ed_link" target="_blank">'; if(item['id_ob'] > 0) ed += '(ed) id:'+item['id_ob']; else if(item['id_osiedle'] > 0) ed += '(ed) id:'+item['id_osiedle']; else ed += '(ed) id:'+item['id_ulica'] ed += '</a>'; element.append(ed); } (function(x,y,z) { content.click( function(event) { event.preventDefault(); var href = $(this).attr('href'); var base = href.substr(1); Router.setRoute(base+'/map/'+x+','+y+','+z+","+shortType[map.getType()]); map.showLayers([item.l]); }) })(item['x'], item['y'], 5); html.append(element); itemsList[i+1] = {'item':content,'x':item['x'], 'y':item['y'], 'layer': item['l']}; } this.setResults(itemsList); $('#map_seek_results').html(html); var params = this.getParams(); if(params.index >= 0) { this.selectResult(params.index); var resultItem = this.getResult(params.index); /*if(formTriggered) { formTriggered = false; if(itemsList[this.param]) { var content = itemsList[this.param]['item']; content.trigger('click'); } }*/ } /*new PerfectScrollbar map-ui-search-wrapper*/ this.ajaxRequest = null; // za pierwszym razem trzeba zrboic podwojny update scrolla (bug pluginu) searchScrollbar.update(); searchScrollbar.update(); }); search.onError( function() { //console.log("Error: search"); }); var searchInput = $("#map_seeker_input"); var searchDefaultValue = searchInput.attr("defaultValue"); (function() { var autocompleteScrollbar = new PerfectScrollbar("#autocompleteWrapper", { scrollingThreshold: 0, suppressScrollX: true }); searchInput .val(searchDefaultValue) .autocomplete({ source: function(request, response) { var mapResponse = function(data) { if(!data) { return []; } return data.map(function(item) { var output = item.typ !== 'dzielnica' ? [item.nazwa, item.miasto] : [item.nazwa]; return { label: item.nazwa, labelMore: item.typ !== 'DZIELNICA' ? item.miasto : '', value: (item.typ === 'DZIELNICA' || item.typ === 'ADRES') ? item.miasto+', '+item.nazwa : item.nazwa }; }) }; var autocompleteRequest = searchInput.data("autocompleteRequest"); if(autocompleteRequest) { autocompleteRequest.abort(); } autocompleteRequest = $.get("/_ajax/map__search__autocomplete/", request, function(data, status, xhr) { response(mapResponse(data)); }); searchInput.data("autocompleteRequest", autocompleteRequest); }, position: { using: function(position, more) { $(this).css({ left: 0, top: 0 }); } }, minLength: 3, select: function(event, ui) { var value = ui.item.value; searchInput.val(ui.item.value); $("#searchForm").submit(); }, appendTo: "#autocompleteWrapper", open: function() { $("#map-ui-search").toggleClass("map-ui-search-suggestions", true); setTimeout(function() { autocompleteScrollbar.update() }, 100); }, close: function() { $("#map-ui-search").toggleClass("map-ui-search-suggestions", false); } }) .autocomplete("instance")._renderItem = function(ul, item) { var autocompleteValue = searchInput.val(); var labelWithMatch = item.label.replace(new RegExp("("+autocompleteValue+")", "gi"), "<strong>$1</strong>"); var $label = $("<div>").html(labelWithMatch); if(item.labelMore){ $label.append($("<span>", {class: 'ui-menu-item-more'}).text(item.labelMore)); } return $("<li>") .append($label) .appendTo(ul); } })(); /*searchInput .val(searchDefaultValue) .autocomplete("/_ajax/mapa/get_streets.php", { minLength: 3, selectFirst: false, formatItem: function(data, i, total) { return '<div class="ac_res_head">'+data[1]+'</div><div class="ac_res_more">' + data[2]+'</div>'; }, formatResult: function(data) { if (data.length > 3) { return data[1]; } else { return data[2] + ', ' + data[1]; } }, width: $('#map_seeker_input').outerWidth(), search: function() { debugger; } }) .result(function(event, item) { if (item.length > 3) { switch(item[3]) { case 'DZIELNICA': var id = item[0] ? item[0] : 0; $("#id_osiedle").val(id); break; case 'OBIEKT': var id_ob = item[0] ? item[0] : 0; $("#id_ob").val(id_ob); break; } } else { var id_ulica = item[0] ? item[0] : 0; $("#id_ulica").val(id_ulica); } if(item.length) { searchInput.addClass('ac_complete'); } $(this).closest("form").submit(); }) .focus(function() { if ($(this).val().length == 0 || $(this).val() == searchDefaultValue) { $(this).val(''); $("#id_ulica").val(0); $("#id_ob").val(0); } else $(this).select(); }) .blur(function() { if ($(this).val().length == 0 || $(this).val() == searchDefaultValue) { $("#id_ulica").val(0); $("#id_ob").val(0); } }) .keyup(function (e) { if(e.which === 13) { $(".ac_results").hide(); } }); */ var autocompleterAbort = function() { var autocompleteRequest = searchInput.data("autocompleteRequest"); if(autocompleteRequest) { autocompleteRequest.abort(); } // NOTE: workaround searchInput.trigger("blur"); }; $("#searchForm").submit( function(event) { event.preventDefault(); var query = searchInput.val(); if(query.length < 3) return; autocompleterAbort(); var r = '/search/'+encodeURIComponent(query)+'/'; Router.setRoute(r); }); $("#map-ui-search-clear").on("click", function() { var params = Router.getParams(); var route = '/map/'+ params.x+","+ params.y+","+ params.zoom+","+ params.type; if(params.layer) { route += ","+layers; } Router.setRoute(route); }); searchInput.focus(); </script> <script> var ob = new Ob('/_ajax/get_street_result/'); ob.onSuccess( function(data) { var l = data.type; map.pointAt({"x": data.x, "y": data.y}); map.showLayers([l.toString()]); }); ob.onCancel( function() { }); ob.onError( function() { }); </script> <script> var RouterHelper = { paramToLayers: function(param) { return param.split(";"); }, layersToParam: function(layers) { return layers.join(";"); }, mergeParams: function(p0, p1) { var obj = {}; for(var key in p0) { if(key in p0) { obj[key] = p0[key]; } } for(var key in p1) { if(key in p1) { obj[key] = p1[key]; } } return obj; } }; // TODO: add default params var INIT_TITLE = document.title; /* Router setup*/ Router.add("/map/{x},{y},{zoom},{type},{layers}", function(params) { map.setLocation(null); search.reset(); var coordinates = {"x": parseFloat(params.x), "y": parseFloat(params.y)}; map.setCoordinates(coordinates); map.setZoom(params.zoom); map.setType(defaultType[params.type] || 'basic'); if(params.layers) { map.setLayers(RouterHelper.paramToLayers(params.layers)); } }); Router.add("/location/{locationX},{locationY}", function(params) { var x = params.locationX; var y = params.locationY; var layers = RouterHelper.layersToParam(map.getLayers()); // reroute to full url Router.updateRoute("/location/"+x+","+y+"/map/"+x+","+y+","+map.getZoom()+","+shortType[map.getType()]+","+layers); }); Router.add("/location/{locationX},{locationY}/map/{x},{y},{zoom},{type},{layers}", function(params) { search.reset(); map.setLocation({ "x" : params.locationX, "y" : params.locationY }); map.setCoordinates({ "x" : parseFloat(params.x), "y" : parseFloat(params.y) }); map.setZoom(params.zoom); map.setType(defaultType[params.type] || 'basic'); map.setLayers(RouterHelper.paramToLayers(params.layers)); }); Router.add("/ob/{obId}", function(params) { var id = params.obId; var coordinates = map.getCoordinates(); var layers = RouterHelper.layersToParam(map.getLayers()); search.reset(); ob.set(id, function() { var item = ob.getData(); // reroute to full url Router.updateRoute('/ob/'+id+'/map/'+item.x+','+item.y+',5,'+shortType[map.getType()]+","+layers); }); }); Router.add("/ob/{obId}/map/{x},{y},{zoom},{type},{layers}", function(params) { var id = params.obId; search.reset(); ob.set(id); map.setCoordinates({"x": parseFloat(params.x), "y": parseFloat(params.y)}); map.setZoom(params.zoom); map.setType(defaultType[params.type] || 'basic'); map.setLayers(RouterHelper.paramToLayers(params.layers)); }); Router.add('/search/{searchQuery}/', function(params) { var query = decodeURIComponent(params.searchQuery); search.set(query, null, function() { var results = search.getResults(); if(results && results.length === 2) { Router.updateRoute('/search/'+params.searchQuery+'/r/1'); return; } }); x = map.getCoordinates().x; y = map.getCoordinates().y; zoom = map.getZoom(); type = shortType[map.getType()]; layers = RouterHelper.layersToParam(map.getLayers()); Router.updateRoute('/search/'+query+'/map/'+x+','+y+','+zoom+','+type+","+layers); document.title = query+' - '+INIT_TITLE; }); Router.add('/search/{searchQuery}/r/{searchIndex}', function(params) { var query = decodeURIComponent(params.searchQuery); var index = params.searchIndex; search.set(query, index, function() { var item = search.getResult(index); // reroute to full url var x, y, zoom, type, layers; if(item) { x = item.x; y = item.y; zoom = 5; } else { x = map.getCoordinates().x; y = map.getCoordinates().y; zoom = map.getZoom(); } type = shortType[map.getType()]; layers = RouterHelper.layersToParam(map.getLayers()); Router.updateRoute('/search/'+query+'/r/'+index+'/map/'+x+','+y+','+zoom+','+type+","+layers); document.title = query+' - '+INIT_TITLE; }); }); Router.add('/search/{searchQuery}/map/{x},{y},{zoom},{type},{layers}', function(params) { var query = decodeURIComponent(params.searchQuery); map.setLocation(null); search.set(query); map.setCoordinates({"x": parseFloat(params.x), "y": parseFloat(params.y)}); map.setZoom(params.zoom); map.setType(defaultType[params.type] || 'basic'); map.setLayers(RouterHelper.paramToLayers(params.layers)); document.title = query+' - '+INIT_TITLE; }); Router.add('/search/{searchQuery}/r/{searchIndex}/map/{x},{y},{zoom},{type},{layers}', function(params) { var query = decodeURIComponent(params.searchQuery); var index = params.searchIndex; search.set(query, index); if(map.getZoom() < params.zoom) { map.setZoom(params.zoom); map.setCoordinates({"x": parseFloat(params.x), "y": parseFloat(params.y)}); } else { map.setCoordinates({"x": parseFloat(params.x), "y": parseFloat(params.y)}); map.setZoom(params.zoom); } map.setType(defaultType[params.type] || 'basic'); map.setLayers(RouterHelper.paramToLayers(params.layers)); document.title = query+' - '+INIT_TITLE; }); var addLayersParam = function(params) { return RouterHelper.mergeParams( params, { layers: RouterHelper.layersToParam(map.getLayers()) } ); }; // NOTE: override of all "old" urls (without layers) Router.redirect("/map/{x},{y},{zoom},{type}") .to("/map/{x},{y},{zoom},{type},{layers}", addLayersParam); Router.redirect("/location/{locationX},{locationY}/map/{x},{y},{zoom},{type}") .to("/location/{locationX},{locationY}/map/{x},{y},{zoom},{type},{layers}", addLayersParam); Router.redirect("/ob/{obId}/map/{x},{y},{zoom},{type}") .to("/ob/{obId}/map/{x},{y},{zoom},{type},{layers}", addLayersParam); Router.redirect('/search/{searchQuery}/map/{x},{y},{zoom},{type}') .to('/search/{searchQuery}/map/{x},{y},{zoom},{type},{layers}', addLayersParam); Router.redirect('/search/{searchQuery}/r/{searchIndex}/map/{x},{y},{zoom},{type},{layers}') .to('/search/{searchQuery}/r/{searchIndex}/map/{x},{y},{zoom},{type},{layers}', addLayersParam); Router.onDeadend( function(route) { //console.log('Cannot match "'+route+'": No such a route found'); var coordinates = map.getCoordinates(); var layers = RouterHelper.layersToParam(map.getLayers()); var r = '/map/'+coordinates.x+','+coordinates.y+','+map.getZoom()+','+shortType[map.getType()]+','+layers; //console.log("rerouting to: "+r); Router.updateRoute(r); }); </script> </div> </div><!-- main-wrap --> </div><!-- main-wrap-outer --> <script src="https://s-trojmiasto.pl/_js/vendor/lazyload.min.js?4f9bd1ed9d205fec.120"></script> <script> const lazyLoadInstance = new LazyLoad(); $(function() { const lazyLoadInstance = new LazyLoad(); }); </script> <script src="https://s-trojmiasto.pl/build/chunks/base.js?ver=3881becba904f1531cd2&4f9bd1ed9d205fec"></script> <script async src="https://r.trojmiasto.pl/www/delivery/asyncjs.php"></script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('pl', 'iw', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&hl=en-GB&client=wt" type="text/javascript"></script> </body> </html>