PageSourceSearch

https://www.landkreis-regen.de/wp-content/plugins/DanCustomAttribu…/google-map/google-map-frontend.js?v=1.0.0

js landkreis-regen.de collected 2026-10-02 07:48:02 UTC 2,242 bytes, 65 lines download raw bytes

1function danCustomAttributesInitGMap() {
2    if (typeof google === "undefined" || typeof google.maps === "undefined") {
3        console.warn("Google Maps API nicht verfügbar – möglicherweise blockiert durch Cookie Consent.");
4        return;
5    }
6
7    var maps = document.getElementsByClassName('dan-custom-attributes-gmap');
8
9    for (let i = 0; i < maps.length; i++) {
10        let markerData = JSON.parse(maps[i].getAttribute('data-marker')),
11            bounds = new google.maps.LatLngBounds(),
12            mapOptions = {
13                zoom: 10,
14                center: {
15                    lat: parseFloat(markerData[0].lat),
16                    lng: parseFloat(markerData[0].lng)
17                },
18                mapTypeId: google.maps.MapTypeId.ROADMAP,
19                mapTypeControlOptions: {
20                    style: google.maps.MapTypeControlStyle.DEFAULT
21                }
22            };
23
24        let map = new google.maps.Map(maps[i], mapOptions);
25
26        for (let j = 0; j < markerData.length; j++) {
27            let infoWindowText = markerData[j].infoWindow,
28                latLng = new google.maps.LatLng(markerData[j].lat, markerData[j].lng);
29
30            let markerOptions = {
31                position: latLng,
32                map: map,
33                title: markerData[j].markerTitle
34            };
35
36            if (markerData[j].iconSrc) {
37                markerOptions.icon = {
38                    url: markerData[j].iconSrc
39                };
40            }
41
42            let marker = new google.maps.Marker(markerOptions);
43            bounds.extend(marker.position);
44
45            if (infoWindowText) {
46                let infoWindow = new google.maps.InfoWindow({
47                    content: infoWindowText
48                });
49
50                marker.addListener('click', function () {
51                    infoWindow.open(map, marker);
52                });
53            }
54        }
55
56        map.fitBounds(bounds);
57    }
58}
59
60// Nur bei vorhandenem Google-Objekt ausführen
61window.addEventListener('load', function () {
62    if (typeof google !== "undefined" && typeof google.maps !== "undefined") {
63        danCustomAttributesInitGMap();
64    }
65});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.