{"id":105200,"date":"2023-09-29T08:46:39","date_gmt":"2023-09-29T06:46:39","guid":{"rendered":"https:\/\/www.ricany.cz\/stadt\/staedtischer-verkehr\/standort-der-busse\/"},"modified":"2025-02-06T12:48:43","modified_gmt":"2025-02-06T11:48:43","slug":"standort-der-busse","status":"publish","type":"page","link":"https:\/\/www.ricany.cz\/de\/stadt\/staedtischer-verkehr\/standort-der-busse\/","title":{"rendered":"Standort der Busse"},"content":{"rendered":"    <section class=\"block block-buses-location-map\" >\n\n                <script type=\"text\/javascript\">\n            (function($) {\n\n                function initMap($el) {\n                    var stylers = [\n\t{\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#f5f5f5\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"elementType\": \"labels.icon\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#616161\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"elementType\": \"labels.text.stroke\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#f5f5f5\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"administrative.land_parcel\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#bdbdbd\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"poi\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#eeeeee\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"poi\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#757575\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"poi.park\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#e5e5e5\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"poi.park\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#9e9e9e\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"road\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#ffffff\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"road.arterial\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#757575\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"road.highway\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#dadada\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"road.highway\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#616161\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"road.local\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#9e9e9e\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"transit.line\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#e5e5e5\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"transit.station\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#eeeeee\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"water\",\n\t\t\"elementType\": \"geometry\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#c9c9c9\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"featureType\": \"water\",\n\t\t\"elementType\": \"labels.text.fill\",\n\t\t\"stylers\": [\n\t\t\t{\n\t\t\t\t\"color\": \"#9e9e9e\"\n\t\t\t}\n\t\t]\n\t}\n];\n                    var map = RicanyMaps.createMap($el[0], stylers, $el.data('zoom'));\n\n                    loadAndRefreshMarkers(map);\n\n                    setInterval(() => {\n                        loadAndRefreshMarkers(map);\n                    }, 30000);\n\n                    return map;\n                }\n\n                function loadAndRefreshMarkers(map) {\n                    $.ajax({\n                        type: \"post\",\n                        dataType: \"json\",\n                        url: ricany_ajax.ajax_url,\n                        data: {\n                            action: 'get_bus_locations',\n                            nonce: ricany_ajax.nonce\n                        },\n                        success: function(response) {\n                            if (response.status === \"ok\") {\n                                for (const marker of map.markers) {\n                                    marker.setMap(null);\n                                }\n                                map.markers = [];\n                                for (const busLocationData of response.busLocations) {\n                                    initMarker(busLocationData, map);\n                                }\n                                RicanyMaps.centerMap(map);\n                            }\n                        }\n                    });\n                }\n\n                function initMarker(busLocationData, map) {\n                    var latLng = {\n                        lat: parseFloat(busLocationData.latitude),\n                        lng: parseFloat(busLocationData.longitude)\n                    };\n\n                    let iconURL = 'https:\/\/www.ricany.cz\/wp-content\/uploads\/2023\/09\/map-pin-bus.svg';\n                    const busLine = busLocationData.guid.slice(-2);\n                    const baseURL = 'https:\/\/www.ricany.cz\/wp-content\/uploads\/bus-icons\/';\n\n                    if (busLine === \"01\") {\n                        iconURL = baseURL + 'icon-bus-linka-1.svg';\n                    } else if (busLine === \"02\") {\n                        iconURL = baseURL + 'icon-bus-linka-2.svg';\n                    } else if (busLine === \"03\") {\n                        iconURL = baseURL + 'icon-bus-linka-3.svg';\n                    } else if (busLine === \"07\") {\n                        iconURL = baseURL + 'icon-bus-linka-7.svg';\n                    } else if (busLine === \"08\") {\n                        iconURL = baseURL + 'icon-bus-linka-8.svg';\n                    } else if (busLine === \"09\") {\n                        iconURL = baseURL + 'icon-bus-linka-9.svg';\n                    }\n\n                    var marker = new google.maps.Marker({\n                        position: latLng,\n                        map: map,\n                        icon: {\n                            url: iconURL,\n                            scaledSize: new google.maps.Size(32, 32)\n                        }\n                    });\n\n                    map.markers.push(marker);\n\n                    if (busLocationData.title) {\n                        var infowindow = new google.maps.InfoWindow({\n                            content: '<h3>' + busLocationData.title + '<\/h3><p>' + busLocationData.text + '<\/p>'\n                        });\n                        google.maps.event.addListener(marker, 'click', function() {\n                            infowindow.open(map, marker);\n                        });\n                    }\n                }\n\n                RicanyMaps.onReady(function() {\n                    $('.bus-map').each(function() {\n                        initMap($(this));\n                    });\n                });\n\n            })(jQuery);\n        <\/script>\n        <div class=\"bus-map\" data-zoom=\"14\">\n                    <\/div>\n    <\/section>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":105195,"menu_order":300,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","inline_featured_image":false,"footnotes":""},"class_list":["post-105200","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/pages\/105200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/comments?post=105200"}],"version-history":[{"count":1,"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/pages\/105200\/revisions"}],"predecessor-version":[{"id":105202,"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/pages\/105200\/revisions\/105202"}],"up":[{"embeddable":true,"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/pages\/105195"}],"wp:attachment":[{"href":"https:\/\/www.ricany.cz\/de\/wp-json\/wp\/v2\/media?parent=105200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}