PageSourceSearch

https://www.vdoe.de/wp-content/themes/oceanwp-child-theme-master/js/expert-map.js?ver=1.0

js vdoe.de collected 2026-10-02 06:36:39 UTC 2,124 bytes, 72 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2
3    var container = document.getElementById("experts-search-results-map");
4    if (!container) return;
5
6    function tryInit() {
7
8        if (typeof L === "undefined") return;
9
10        if (container.dataset.mapInitialized === "true") return;
11
12        var mapDataRaw = container.getAttribute("data-map-data");
13        if (!mapDataRaw) return;
14
15        var mapData = JSON.parse(mapDataRaw);
16
17        var map = L.map(container)
18            .setView([mapData.center.lat, mapData.center.lng], 6);
19
20        L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
21            attribution: '© OpenStreetMap contributors'
22        }).addTo(map);
23
24        mapData.locations.forEach(function (location) {
25
26            var popup = "<div><strong><a href='" + location.popup.link + "'>"
27                + location.popup.user_name + "</a></strong>";
28
29            if (location.popup.address_name) {
30                popup += "<div>" + location.popup.address_name + "</div>";
31            }
32
33            if (location.popup.street) {
34                popup += "<div>" + location.popup.street + "</div>";
35            }
36
37            if (location.popup.city) {
38                popup += "<div>" + location.popup.city + "</div>";
39            }
40
41            popup += "</div>";
42
43            L.marker([location.lat, location.lng])
44                .bindPopup(popup)
45                .addTo(map);
46        });
47        // Hide placeholder after map is initialized
48        var placeholder = document.getElementById("map-placeholder");
49        if (placeholder) {
50            placeholder.style.display = "none";
51        }
52
53        container.dataset.mapInitialized = "true";
54    }
55
56    // Try immediately
57    tryInit();
58
59    // Retry every 300ms until Leaflet loads (max 10 attempts)
60    var attempts = 0;
61    var interval = setInterval(function () {
62
63        attempts++;
64
65        tryInit();
66
67        if (typeof L !== "undefined" || attempts > 10) {
68            clearInterval(interval);
69        }
70
71    }, 300);
72});

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.