PageSourceSearch

https://hewahihaumaru.org.nz/wp-content/themes/hestia-child/js/so.maps.js?ver=7.1.2

js hewahihaumaru.org.nz collected 2026-09-29 02:30:28 UTC 2,657 bytes, 107 lines download raw bytes

1var map;
2var markers;
3
4(function ($) {
5  var geoCoder;
6
7  function initialise_map() {
8    // var locations_str = php_args.locations.replace(/"/g, '"');
9    // var locations = $.parseJSON(locations_str);
10    // console.log("Locations", locations);
11
12    var latlng = new google.maps.LatLng(-36.848461, 174.763336);
13    var myOptions = {
14      zoom: 13,
15      center: latlng,
16      mapTypeId: google.maps.MapTypeId.ROADMAP,
17    };
18
19    map = new google.maps.Map(document.getElementById("map_canvas"), {
20      zoom: 13,
21      center: latlng,
22      gestureHandling: "cooperative",
23    });
24    map.setZoom(12);
25    geoCoder = new google.maps.Geocoder();
26
27    var bounds = new google.maps.LatLngBounds();
28    // getGeolocationsForLocation(locations, map, bounds);
29  }
30
31  async function getGeolocationsForLocation(locations, map, bounds) {
32    var promises = [];
33    for (var i = 0; i < locations.length; i++) {
34      var location = locations[i];
35      console.log(location);
36      if (location.lat && location.lng) {
37        console.log("push");
38        var coords = {
39          lat: location.lat,
40          lng: location.lng,
41        };
42
43        addMarker(location, map, bounds, coords);
44      }
45    }
46  }
47
48  function addMarker(location, map, bounds, geo) {
49    console.log({ location });
50    //InfoWindow
51    console.log("LOCATION " + location.title);
52    var contentString =
53      '<div id="content">' +
54      '<div id="siteNotice">' +
55      "</div>" +
56      '<h3 id="firstHeading" class="firstHeading">' +
57      location.title +
58      "</h3>" +
59      '<div id="bodyContent">' +
60      "<p><strong>Type of Support:</strong> " +
61      location.organisation +
62      "</p>" +
63      '<p"><strong>Services Available:</strong> ' +
64      "<span>" +
65      location.facilities +
66      "</span>" +
67      "</p>" +
68      '<a href="' +
69      location.permalink +
70      '"><button>View Location</button></a>' +
71      "</div>" +
72      "</div>";
73
74    var infowindow = new google.maps.InfoWindow({
75      content: contentString,
76    });
77
78    var locationLatLng;
79
80    if (geo) {
81      locationLatLng = new google.maps.LatLng(geo.lat, geo.lng);
82      console.log({ locationLatLng });
83    } else {
84      locationLatLng = new google.maps.LatLng(
85        location.latitude,
86        location.longitude
87      );
88    }
89
90    bounds.extend(locationLatLng);
91    var marker = new google.maps.Marker({
92      position: locationLatLng,
93      map: map,
94      title: location.title,
95      optimized: false,
96      clickable: true,
97    });
98
99    marker.addListener("click", function () {
100      infowindow.open(map, marker);
101    });
102  }
103
104  $(function () {
105    initialise_map();
106  });
107})(jQuery);

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.