@bmlt-enabled/croutonjs 4.3.2 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/crouton-gmaps.js +743 -494
- package/crouton-gmaps.min.js +6 -6
- package/crouton-gmaps.min.js.map +1 -1
- package/crouton-map.js +467 -308
- package/crouton-map.min.js +1 -1
- package/crouton-map.min.js.map +1 -1
- package/crouton.js +494 -324
- package/crouton.min.js +6 -6
- package/crouton.min.js.map +1 -1
- package/crouton.nojquery.js +24 -13
- package/crouton.nojquery.min.js +6 -6
- package/crouton.nojquery.min.js.map +1 -1
- package/package.json +1 -1
package/crouton-gmaps.js
CHANGED
|
@@ -12982,7 +12982,7 @@ function CroutonHandlebarsExtensions() {
|
|
|
12982
12982
|
crouton_Handlebars.registerPartial('header', hbs_Crouton.templates['header']);
|
|
12983
12983
|
crouton_Handlebars.registerPartial('byfields', hbs_Crouton.templates['byfield']);
|
|
12984
12984
|
crouton_Handlebars.registerPartial('formatPopup', hbs_Crouton.templates['formatPopup']);
|
|
12985
|
-
crouton_Handlebars.registerPartial('meetingModal', "<a tabindex='0'
|
|
12985
|
+
crouton_Handlebars.registerPartial('meetingModal', "<a tabindex='0' onclick='crouton.meetingModal({{this.id_bigint}})'><span class='glyphicon glyphicon-search' aria-hidden='true'></span>{{this.meeting_name}}</a>");
|
|
12986
12986
|
crouton_Handlebars.registerPartial('meetingLink', `
|
|
12987
12987
|
{{#if this.meeting_details_url}}
|
|
12988
12988
|
<a href='{{{this.meeting_details_url}}}'><span class='glyphicon glyphicon-search' aria-hidden='true'></span>{{this.meeting_name}}</a>
|
|
@@ -13388,7 +13388,7 @@ this["hbs_Crouton"]["templates"]["group3ColumnRow"] = Handlebars.template({"0":f
|
|
|
13388
13388
|
|
|
13389
13389
|
return "<td class=\"bmlt-column1\" "
|
|
13390
13390
|
+ ((stack1 = (lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-textAlign",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":54}}})) != null ? stack1 : "")
|
|
13391
|
-
+ ">\n <div class='meeting-name'>\n <a tabindex='0'
|
|
13391
|
+
+ ">\n <div class='meeting-name'>\n <a tabindex='0' onclick='crouton.meetingModal("
|
|
13392
13392
|
+ alias4(alias3((depth0 != null ? lookupProperty(depth0,"id_bigint") : depth0), depth0))
|
|
13393
13393
|
+ ")'><span class='glyphicon glyphicon-search' aria-hidden='true'></span>"
|
|
13394
13394
|
+ alias4(alias3((depth0 != null ? lookupProperty(depth0,"meeting_name") : depth0), depth0))
|
|
@@ -13622,10 +13622,10 @@ this["hbs_Crouton"]["templates"]["header"] = Handlebars.template({"0":function(c
|
|
|
13622
13622
|
return undefined
|
|
13623
13623
|
};
|
|
13624
13624
|
|
|
13625
|
-
return " <li><a href=\"
|
|
13625
|
+
return " <li><a href=\"./#tab"
|
|
13626
13626
|
+ alias1(container.lambda(depth0, depth0))
|
|
13627
13627
|
+ "\" data-toggle=\"tab\">"
|
|
13628
|
-
+ alias1((lookupProperty(helpers,"getDayOfTheWeek")||(depth0 && lookupProperty(depth0,"getDayOfTheWeek"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"getDayOfTheWeek","hash":{},"data":data,"loc":{"start":{"line":38,"column":
|
|
13628
|
+
+ alias1((lookupProperty(helpers,"getDayOfTheWeek")||(depth0 && lookupProperty(depth0,"getDayOfTheWeek"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"getDayOfTheWeek","hash":{},"data":data,"loc":{"start":{"line":38,"column":63},"end":{"line":38,"column":87}}}))
|
|
13629
13629
|
+ "</a></li>\n";
|
|
13630
13630
|
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
|
|
13631
13631
|
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
@@ -14092,7 +14092,7 @@ this["hbs_Crouton"]["templates"]["meetingDetailsButton"] = Handlebars.template({
|
|
|
14092
14092
|
|
|
14093
14093
|
return " <div>\n <a onclick='crouton.meetingModal("
|
|
14094
14094
|
+ alias1(container.lambda((depth0 != null ? lookupProperty(depth0,"id_bigint") : depth0), depth0))
|
|
14095
|
-
+ ")' tabindex='0'
|
|
14095
|
+
+ ")' tabindex='0' class='map-button btn btn-primary btn-xs'>\n <span class='glyphicon glyphicon-search' aria-hidden='true'></span>\n "
|
|
14096
14096
|
+ alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"meeting details",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":34}}}))
|
|
14097
14097
|
+ "\n </a>\n </div>\n";
|
|
14098
14098
|
},"useData":true});
|
|
@@ -15468,7 +15468,7 @@ function Crouton(config) {
|
|
|
15468
15468
|
self.distanceTabAllowed = false;
|
|
15469
15469
|
self.favoritesOn = false;
|
|
15470
15470
|
self.config = {
|
|
15471
|
-
version: '4.3.
|
|
15471
|
+
version: '4.3.4', // CroutonJS version for debugging
|
|
15472
15472
|
on_complete: null, // Javascript function to callback when data querying is completed.
|
|
15473
15473
|
root_server: null, // The root server to use.
|
|
15474
15474
|
placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
|
|
@@ -15726,7 +15726,7 @@ function Crouton(config) {
|
|
|
15726
15726
|
self.dayTabFromId = function(id) {
|
|
15727
15727
|
const day_id = self.meetingData.find((m)=>m.id_bigint == id).weekday_tinyint;
|
|
15728
15728
|
self.hideAllPages();
|
|
15729
|
-
jQuery('.nav-tabs a[href="
|
|
15729
|
+
jQuery('.nav-tabs a[href="./#tab' + day_id + '"]').tab('show');
|
|
15730
15730
|
jQuery("#" + day_id).removeClass("hide").addClass("show");
|
|
15731
15731
|
};
|
|
15732
15732
|
/**
|
|
@@ -17059,7 +17059,7 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
|
|
|
17059
17059
|
const d = new Date();
|
|
17060
17060
|
let n = d.getDay();
|
|
17061
17061
|
n++;
|
|
17062
|
-
jQuery('.nav-tabs a[href="
|
|
17062
|
+
jQuery('.nav-tabs a[href="./#tab' + n + '"]').tab('show');
|
|
17063
17063
|
jQuery('#tab' + n).show();
|
|
17064
17064
|
}
|
|
17065
17065
|
|
|
@@ -17747,7 +17747,7 @@ function MeetingMap(inConfig) {
|
|
|
17747
17747
|
filterVisible(false);
|
|
17748
17748
|
gSearchPoint = {"lat": position.lat, "lng": position.lng};
|
|
17749
17749
|
crouton.updateDistances();
|
|
17750
|
-
const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
|
|
17750
|
+
const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(gSearchPoint));
|
|
17751
17751
|
gDelegate.flyToFixedZoom(position, locationSearchResult.zoom, filterVisible);
|
|
17752
17752
|
filterVisible(true);
|
|
17753
17753
|
setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
|
|
@@ -17911,7 +17911,7 @@ function MeetingMap(inConfig) {
|
|
|
17911
17911
|
const centerAndBounds = gDelegate.getGeocodeCenterAndBounds(resp, i);
|
|
17912
17912
|
if (!centerAndBounds) return;
|
|
17913
17913
|
const zoom = calcZoomThatContainsBoundingBox(centerAndBounds);
|
|
17914
|
-
const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, zoom);
|
|
17914
|
+
const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, zoom, findClosestMeetingLatLng(gSearchPoint));
|
|
17915
17915
|
gDelegate.flyToFixedZoom(gSearchPoint, locationSearchResult.zoom, filterVisible);
|
|
17916
17916
|
searchResponseCallback();
|
|
17917
17917
|
})
|
|
@@ -17975,6 +17975,16 @@ function MeetingMap(inConfig) {
|
|
|
17975
17975
|
function locationSearchGeocodeInitial(resp) {
|
|
17976
17976
|
locationSearchGeocode(resp, true);
|
|
17977
17977
|
}
|
|
17978
|
+
function findClosestMeetingLatLng(center) {
|
|
17979
|
+
return filterMeetings(gAllMeetings).reduce((closest, meeting) => {
|
|
17980
|
+
const meetingLocation = {lat: meeting.latitude, lng: meeting.longitude};
|
|
17981
|
+
const distance = getDistance(center, meetingLocation);
|
|
17982
|
+
if (distance < closest.distance) {
|
|
17983
|
+
return {meetingLocation: meetingLocation, distance: distance};
|
|
17984
|
+
}
|
|
17985
|
+
return closest;
|
|
17986
|
+
}, {meetingLocation: null, distance: Infinity}).meetingLocation;
|
|
17987
|
+
}
|
|
17978
17988
|
function locationSearchGeocode(resp, initial=false) {
|
|
17979
17989
|
chooseResponse('bmlt_location_search_modal', resp, function(resp, i) {
|
|
17980
17990
|
closeModalWindow(gLocationSearchModal);
|
|
@@ -17983,7 +17993,8 @@ function MeetingMap(inConfig) {
|
|
|
17983
17993
|
let center = centerAndBounds.center;
|
|
17984
17994
|
filterVisible(false);
|
|
17985
17995
|
let zoom = calcZoomThatContainsBoundingBox(centerAndBounds);
|
|
17986
|
-
|
|
17996
|
+
|
|
17997
|
+
gLocationSearchResult = gDelegate.getZoomAdjustedBounds(center, filterMeetingsAndBounds, zoom, findClosestMeetingLatLng(center));
|
|
17987
17998
|
gSearchPoint = {"lat": gLocationSearchResult.center.lat, "lng": gLocationSearchResult.center.lng};
|
|
17988
17999
|
filterVisible(true, gLocationSearchResult.bounds);
|
|
17989
18000
|
crouton.updateDistances(initial);
|
|
@@ -18048,13 +18059,13 @@ function MeetingMap(inConfig) {
|
|
|
18048
18059
|
retrieveGeolocation().then(function(coords) {
|
|
18049
18060
|
filterVisible(false);
|
|
18050
18061
|
if (isMapVisible() || !makeFilterVisible) {
|
|
18051
|
-
const locationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
|
|
18062
|
+
const locationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(coords));
|
|
18052
18063
|
gDelegate.flyToFixedZoom(coords, locationSearchResult.zoom, () => {
|
|
18053
18064
|
filterVisible(makeFilterVisible);
|
|
18054
18065
|
if (makeFilterVisible) setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
|
|
18055
18066
|
});
|
|
18056
18067
|
} else {
|
|
18057
|
-
gLocationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
|
|
18068
|
+
gLocationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(coords));
|
|
18058
18069
|
filterVisible(true, gLocationSearchResult.bounds);
|
|
18059
18070
|
setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
|
|
18060
18071
|
}
|
|
@@ -18588,514 +18599,751 @@ MeetingMap.prototype.hasMapSearch = null;
|
|
|
18588
18599
|
MeetingMap.prototype.createLocationSearchButton = null;
|
|
18589
18600
|
|
|
18590
18601
|
function MapDelegate(in_config) {
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18602
|
+
const config = in_config;
|
|
18603
|
+
var g_icon_image_single = null;
|
|
18604
|
+
var g_icon_image_multi = null;
|
|
18605
|
+
var g_icon_image_selected = null;
|
|
18606
|
+
var g_icon_shadow = null;
|
|
18607
|
+
var g_icon_shape = null;
|
|
18608
|
+
var gDiv = null;
|
|
18609
|
+
var gMainMap;
|
|
18610
|
+
var gOms = null;
|
|
18611
|
+
var gMarkerClusterer = null;
|
|
18612
|
+
var gInfoWindow;
|
|
18613
|
+
var gIsLoaded = false;
|
|
18614
|
+
var gIsClustering = false;
|
|
18615
|
+
var gAllMarkers = []; ///< Holds all the markers.
|
|
18616
|
+
var gSearchPointMarker = false;
|
|
18617
|
+
var gOpenMarker = false;
|
|
18618
|
+
function isApiLoaded() {
|
|
18619
|
+
return gIsLoaded;
|
|
18620
|
+
}
|
|
18621
|
+
function loadApi(f, args) {
|
|
18622
|
+
var tag = document.createElement("script");
|
|
18623
|
+
gIsLoaded = true;
|
|
18624
|
+
if (typeof config["api_key"] === "undefined") config["api_key"] = "";
|
|
18625
|
+
tag.src =
|
|
18626
|
+
"https://maps.googleapis.com/maps/api/js?key=" +
|
|
18627
|
+
config["api_key"] +
|
|
18628
|
+
"&loading=async&callback=croutonMap.apiLoadedCallback";
|
|
18629
|
+
tag.defer = true;
|
|
18630
|
+
tag.async = true;
|
|
18631
|
+
var firstScriptTag = document.getElementsByTagName("script")[0];
|
|
18632
|
+
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
|
18633
|
+
}
|
|
18634
|
+
function createMap(inDiv, inCenter, inHidden = false) {
|
|
18635
|
+
gDiv = inDiv;
|
|
18636
|
+
if (inHidden) {
|
|
18637
|
+
gDiv.style.height = "auto";
|
|
18638
|
+
gDiv.style.marginBottom = "10px";
|
|
18625
18639
|
gMainMap = null;
|
|
18626
18640
|
return gDiv;
|
|
18627
18641
|
}
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
|
-
|
|
18643
|
-
|
|
18644
|
-
|
|
18645
|
-
|
|
18646
|
-
|
|
18647
|
-
|
|
18648
|
-
|
|
18649
|
-
|
|
18650
|
-
|
|
18651
|
-
|
|
18652
|
-
|
|
18653
|
-
|
|
18654
|
-
|
|
18655
|
-
|
|
18656
|
-
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
|
|
18660
|
-
|
|
18661
|
-
|
|
18662
|
-
|
|
18663
|
-
|
|
18664
|
-
|
|
18665
|
-
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
|
|
18671
|
-
|
|
18672
|
-
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
|
|
18720
|
-
|
|
18721
|
-
|
|
18722
|
-
|
|
18723
|
-
|
|
18724
|
-
|
|
18725
|
-
|
|
18726
|
-
|
|
18727
|
-
|
|
18728
|
-
|
|
18729
|
-
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18642
|
+
let iconUrl = config.BMLTPlugin_images
|
|
18643
|
+
? config.BMLTPlugin_images + "/NAMarker.png"
|
|
18644
|
+
: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAgCAYAAAD5VeO1AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAXAAAAIACehauIAAAGEElEQVRIx62We2xT9xXHP/dhmxA7Iy/aOMY0Y01AMALdmjIi9bWpj6G9KqGQTtq6P6a26rqCUtCoWk1iAwmhtZ2oEJPQJhBdH2lUGjqUBLp2UaCq6BALxU7jOI8aamLqENuxiR/3nv1xb5w0CxPTeqSfrs69v/M95/f9fX/ndxVubApwF/AIlNwN7jpwamAITMUg/RFIJ3ASSN8IYCG7F9y/gW/eA2sWQS3gAXQ8HpX77tP57LPPCQb7zWz2o0/gyn7gMJD/b+CLQNkHG34FDwFfB8oAF6ADKl6vk5MnfZSWmvT3p3j99SE6OjrJZjt6YeoXwPBC1brA+XZ5+c9kzZq/SlVVt2zc+E/x+c7JE0+EpaMjJk8/PSaVlf0SDickm01JLndNpqai0t7+idTX/1HANww0LMTQ/kWLfi4vv3xKLl6MSFfXpJw9m5GOjoQEgxkREXn33YSUlQVldHRaRAzp7r4mgcCkiEzKxx8PS2PjIYHqs/Zyi/ZduFt27HhHJiYuiYhIOJyV3t60nDmTkXg8LyIix44lxe0ekJGRrIiItLVFpbIyKL29kyKSlL6+EamqekGA3QCqhV22ranpRzz22Arc7ioAqqs1NA1MUzAMe20KmCZFv6bGQTyeY/PmKBcuQHNzOc8++2PgO78E/CrQBI33tLauZenSJaRSIAIej0pVlU44nCcWM4rgIlYCsOaAxvh4ge3b4+RyTlpbfd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NlTtHngUuyEMADs6oBM23yghcAB8x8w1AyNddZ1ODcBNnDeVsfuMIRabOdmwDEgdRquPgLry8DJzK/FLM8G8Jc8HG8F/rXA/t0QHGACLg2CowVWqtZUldnLoRf4wwtgHpmzCTcNDhCCT0247X5LPTN8XwZ2vQMTv14I9H8xBfyd8CeBvwn0CHx/BPD/P6BzzQ/3R+CQwDYB5Sezib8Sc2yGbwlUHviqKp5HD78H6m424N/MV8HqLH5ZPAAAACV0RVh0Y3JlYXRlLWRhdGUAMjAxMS0wMS0wNlQwMzoyNDoxMyswMDowMJsWpgAAAAAldEVYdG1vZGlmeS1kYXRlADIwMTEtMDEtMDZUMDM6MjQ6MTMrMDA6MDDEp9A0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
|
|
18645
|
+
g_icon_image_single = new google.maps.MarkerImage(
|
|
18646
|
+
iconUrl,
|
|
18647
|
+
new google.maps.Size(23, 32),
|
|
18648
|
+
new google.maps.Point(0, 0),
|
|
18649
|
+
new google.maps.Point(12, 32),
|
|
18650
|
+
);
|
|
18651
|
+
iconUrl = config.BMLTPlugin_images
|
|
18652
|
+
? config.BMLTPlugin_images + "/NAMarkerG.png"
|
|
18653
|
+
: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADTRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMi4yLWMwNjMgNTMuMzUyNjI0LCAyMDA4LzA3LzMwLTE4OjA1OjQxICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM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ckNvbnRhY3RJbmZvCiAgICBJcHRjNHhtcENvcmU6Q2lBZHJFeHRhZHI9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckNpdHk9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkclJlZ2lvbj0iIgogICAgSXB0YzR4bXBDb3JlOkNpQWRyUGNvZGU9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckN0cnk9IiIKICAgIElwdGM0eG1wQ29yZTpDaVRlbFdvcms9IiIKICAgIElwdGM0eG1wQ29yZTpDaUVtYWlsV29yaz0iIgogICAgSXB0YzR4bXBDb3JlOkNpVXJsV29yaz0iIi8+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7HRMckAAAG20lEQVR42qyWeXBV9RXHP/fet+QlL+QlPAgkeZIFxAWxqWBVagVKYtQUUTvtSIeKLYNY24pY/MPptA50nI4OnXbGzojVoSLNdFGJ6ci0MRSo1BZcILgQgglGSdJsL9vL2+679/bcBasVpON4Zn7v3d/2Pef3Pcvvp/DpskjaLQFYmq9QLf++nIWVhP40vCJzLdJekpY722blHKBXBWHzfJUV8xWmlcmqAhn02S2Uh/aFK+jr7+d4V3f2qMXrcXhMpprOB273H7oUHlyu4qsyoVCDoOEC25JfNp3SHU0YeXkkjrXT3bybF/fuoxVe0OEuWTJwNnBFOk80BH3r6qPTKRkdZXrZLHxDw4S/ch2hK69CP3qE9P42ZjW/iFVWgS47MokpRvf8mbZt23hiaOTIGDQKVh/81yBbHrxeYd3q9XdRvXQZxb2nCc6ejXGqC+3yWgLL60g17WS4dQ8BVUPNz0d99TCB8nKC31rDytgFhDbfX/to38DT4pObBC+resALL4GfrLrtVmrWfpeKq68hVFsLlmifOx+tdDbW5AToOoppOsfVCsJkWnYzeucd5IkBkeuWUbdlK98IBVfI9AYb1AGXKNh8Y2UsULX2O0SLIyiWhRopcTkzDBRVEc68ZoPbTdPwR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SR+1cRXPRf9tX9KYt2Db+HlTl5MHHqDZLec7tT7vDswxOPwF7kCf/ZhVbRFEvrhPQrxhDhSl2ZqbnTgVf2x3zehHzwgjpbJdBpFSrBd0+3EMGXIEtaaNbJyWTyEExIOgx+Te+/w8csGAQ4Lcp5dPs5cV7I8kC8xnM7IJTKLQHSG+KOTTCqDKSYeEvq26vxCPHG/t+UT4L6IQusDfpbNsy9lURBQ3OPZdcqOf9vJlu5mvCXJlpPxUZn/sc7xbosluF0+RosnuTGLu5/NMTYhwGl7wPLosVxgvNtFERoM6RsC/ieDnAD/4KPAZwO35cQbJhvbDBc84xFoehlquXfJh0oPy0SLwSPyufd/XxPaOd4t7V0WF9So1EY93jXF3al4inLeG2Jbjr+Pw/qzPYzUcz21JE3u+12Oo/+2nG+pci6o4X1n5X+nwYjUkA3u8k+K+ilPuYkeizt3G0wk7N2KC6p7dOwVTfsMNsnn8XO93NTzvBWPHjDZ9A8BSlmeAmniPHYZPGUbfybs+KxSIlhb/Fi/DWDtlHal6lgb5XOS6BUq3T8XBWt8djJTx+cpcvbGixVycqH/6jwv5M8sW6TF/t/F/xFgADsAxARvscdVAAAAAElFTkSuQmCC";
|
|
18654
|
+
g_icon_image_multi = new google.maps.MarkerImage(
|
|
18655
|
+
iconUrl,
|
|
18656
|
+
new google.maps.Size(23, 32),
|
|
18657
|
+
new google.maps.Point(0, 0),
|
|
18658
|
+
new google.maps.Point(12, 32),
|
|
18659
|
+
);
|
|
18660
|
+
iconUrl = config.BMLTPlugin_images
|
|
18661
|
+
? config.BMLTPlugin_images + "/NAMarkerSel.png"
|
|
18662
|
+
: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA/JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5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dZ7ncbbQhkHjItqLp3Em/zHezTbBtii4XILZYqOwx9hOm7x+6fi8+gxVpAlSY+Bpz93KdEL30QJVuuyBKFyiOhrkpm1b8NA5KllUKYeB3Av6WavXXkQr0+OdoaLZxNcJO8MfU+Yyr+SRHOIkNubB2Nki4qCIF6ZLQHGfaRonrU00a78STB7nWpG0B/lFuqc8JE+7RI+w/Aon+Rir9Gs0Ex27jBfp/5+vZkK+xr2l1eqxa+W4tICJw0r+0nrXPypNBG5/QfejV4z3eBY/Gu9iJF/zrmWiye7HMqInSgS5G7iHKJyzQgcKO82k2W6vpdnAeBDy11zlSjzLP6Tav1GeReKUxwI7Rof+roXiP82naPbOtW5u8nXuihetz/gQm8QelKPsMoLVR3S8arxGwf/VGDD/JuCitdh9fKYyg82nU8ulY5dxzurhQh15fAut3HMT6w4+p3LvesWg+X34VpuEFcosZkoBbL/ODfkbt1/SiP2/i/8nwAAca+6jkhGCHgAAAABJRU5ErkJggg==";
|
|
18663
|
+
g_icon_image_selected = new google.maps.MarkerImage(
|
|
18664
|
+
iconUrl,
|
|
18665
|
+
new google.maps.Size(23, 32),
|
|
18666
|
+
new google.maps.Point(0, 0),
|
|
18667
|
+
new google.maps.Point(12, 32),
|
|
18668
|
+
);
|
|
18669
|
+
|
|
18670
|
+
iconUrl = config.BMLTPlugin_images
|
|
18671
|
+
? config.BMLTPlugin_images + "/SearchPoint.png"
|
|
18672
|
+
: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAABGdBTUEAALGPC/xhBQAAAHhlWElmTU0AKgAAAAgABAESAAMAAAABAAEAAAEaAAUAAAABAAAAPgEbAAUAAAABAAAARodpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABegAwAEAAAAAQAAACEAAAAAZxgyOAAAAAlwSFlzAAALEwAACxMBAJqcGAAAApJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4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D4cEJSyZGdnG4OUIh2g3FgDpPDx48eCnmOMMWpGgMJagZEWBz40Qg09CDkRUlPUNb0l4P37901SKUGUuJkmbvxBMzNqYUSUMR3CYFNT165do2zqHAAaRlgueFkAQCerDFOxSOjFvXv3jBzJLw1TOYhQ0JhkcHDQRFFcXGzyAmoV9G+hrzcfOHCg3Q461iC/VSTmY1yMpLQAYiotISHBqIEVSpr6+vpM4fT29hoJskKZD1KEpOqbN2+q6urqCbz/gB7f9kZ3IgvgMglJyYN6/FCVmgZ4CdVraOI7+wkpICgbXG5urlEIBKHRS9SlS5fcYOAqMCpv3LixQHD2kxWAT0OC+wESRz7x44ClMn3El0BSs3XrViNPNiomlz0eQOw9CokcAF3fwHP+9IkPnJKaYjeDVosAFogi0AhfUSHUMYuGlLGY2Kgo1dbWVmloaNB0BPwv37179xf0+Ro6i6lYz0ab/ACPf4P1YlBSig5nh0GNZCt2SeqYFcloWHBMKvXOqkQi5eHDhy0ovCrgzBOYuD7O8W7GPC6N4UIR+I31lrdiFRKIoPSe71QNSl8jWvXgwYMh0HK+rKysAc75nDW0+IBNL8diFKG7UamFiCAYhjTJJ5hvei9oGGNUi83NzZUwWu0tHuM1z6z3nBtu8N2Pw9HgPxfdzw+VqAFMGwaXDQyT+fDgh/sqkvgtNvg/iw2TnpuxHpwfiYBol3oQfjZUkQa+6bmJgB2PuUCS+QPeBel9hfPtvIjxFpiLjcD5nQYmATABvj8APdHk3eu6oQNdchzA30FFtTjr8d7B46/xPnB6OAwDblBThBlE/hGNQsWugI5f8fwZUAuYdOYdr2nin8C5xwtudIY+ACYAPCcoKMgBY/wXrwnd8Dz2+7zn/gaM7+8F577hH7+NA6AlH54nw9thAH+NmqjH/oagvPhfBsE57OD9M5R/N1rv91iHm69vjHtf/9/DGIBi4nH9S8y3/2j+G9yfXNblr8O6ITwAAAAASUVORK5CYII=";
|
|
18673
|
+
g_icon_image_searchpoint = new google.maps.MarkerImage(
|
|
18674
|
+
iconUrl,
|
|
18675
|
+
new google.maps.Size(23, 32),
|
|
18676
|
+
new google.maps.Point(0, 0),
|
|
18677
|
+
new google.maps.Point(12, 32),
|
|
18678
|
+
);
|
|
18679
|
+
iconUrl = config.BMLTPlugin_images
|
|
18680
|
+
? config.BMLTPlugin_images + "/NAMarkerS.png"
|
|
18681
|
+
: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAgEAYAAADbCl1AAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAF7UlEQVRo3u2YaWhcVRTH77zJzGS2pG0c1FRr6o5rXVBxwSLuCu5WLGLADa2VKlbFFUVcUasftIIiivu+C4q7xRVRcF8xVuIkcTL7TGZ5zw/ndybklSGZyTT98s6XH/e9d7f/vfecc58xnnnmmWeeeeaZZ5555plnnnnmmWeebXTzb+L+fbALRuEieCBcweffCK0K3JdpHAN3ornvKS93vR+A31Gf99YBtF+jv6/hefAnmG4yD8f9YK6FVSGDcDN4ELyHz5YyPIRU3QPUCy0RRgrC6IvCGM/jCyjfSPkJvrsXxoThVbR3NP3sKrTqdPgQuj2qA4B/w6qLDYF1xBtbSF1AJmwO5/U6iKD+IuP/mAmX4dXC7gsoP4UwW1F+VxjcmfoPItDvtP8880YA+330OEVYOVNYvEqYP0GY3UNY2I3vllD/LObxMGTcRhekMfFOmwX1aO9Hdwhm9Qm7liHMoDAyOrVarBciXHgvvmdBguykAPX8SfgM/VxEQ2cj7M3wTnQ4Qlg7Q1hifNlXhKPoM7Inzw/h+91ph/GZXyAuyjidFlYFTcBrePwOQuLruk8Xxm8X9m4pnHcHQiJc5A2+Z2cEBhDuD6HvQ9pngXzd9Itr8J1GOQK/ZN5rICfHuQLBhoQFjnryV+EQPng0LizjOpy7XcKqj+6YK1BBN4fPIcBfCIMQ8fuE85nggmsR9AZhlCMcyjM8XIf1CGSCBmFMCgE/o7w9ZAEbvjwDQ3zP0XcIYuYfeIkg8B/9X8/3x/H+ZfgnxMdPugC12e5YrT8P4uz9Bwsj+J4+Bp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i3IDvXJF3jnPXRnithNcikIVdQBwFsLgYl0pcU39kEBetUBOM/aZ6/XyWEnKC9+nXU4yeKowKqC9KdmXONa86F7JS5f1jjWw0/ig3R1n+UMIxAvUTzXoQKk+4E+NFtrZzavDkHEqQarme6q+0mt/8BTRrNnwf6/EMAAAAASUVORK5CYII=";
|
|
18682
|
+
g_icon_shadow = new google.maps.MarkerImage(
|
|
18683
|
+
iconUrl,
|
|
18684
|
+
new google.maps.Size(43, 32),
|
|
18685
|
+
new google.maps.Point(0, 0),
|
|
18686
|
+
new google.maps.Point(12, 32),
|
|
18687
|
+
);
|
|
18688
|
+
g_icon_shape = {
|
|
18689
|
+
coord: [
|
|
18690
|
+
16, 0, 18, 1, 19, 2, 20, 3, 21, 4, 21, 5, 22, 6, 22, 7, 22, 8,
|
|
18691
|
+
22, 9, 22, 10, 22, 11, 22, 12, 22, 13, 22, 14, 22, 15, 22, 16,
|
|
18692
|
+
21, 17, 21, 18, 22, 19, 20, 20, 19, 21, 20, 22, 18, 23, 17, 24,
|
|
18693
|
+
18, 25, 17, 26, 15, 27, 14, 28, 15, 29, 12, 30, 12, 31, 10, 31,
|
|
18694
|
+
10, 30, 9, 29, 8, 28, 8, 27, 7, 26, 6, 25, 5, 24, 5, 23, 4, 22,
|
|
18695
|
+
3, 21, 3, 20, 2, 19, 1, 18, 1, 17, 1, 16, 0, 15, 0, 14, 0, 13,
|
|
18696
|
+
0, 12, 0, 11, 0, 10, 0, 9, 0, 8, 0, 7, 1, 6, 1, 5, 2, 4, 2, 3,
|
|
18697
|
+
3, 2, 5, 1, 6, 0, 16, 0,
|
|
18698
|
+
],
|
|
18699
|
+
type: "poly",
|
|
18700
|
+
};
|
|
18701
|
+
|
|
18702
|
+
var myOptions = {
|
|
18703
|
+
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
|
18704
|
+
zoomControl: true,
|
|
18705
|
+
minZoom: config.minZoom,
|
|
18706
|
+
maxZoom: config.maxZoom,
|
|
18707
|
+
mapTypeControl: false,
|
|
18708
|
+
streetViewControl: true,
|
|
18709
|
+
disableDoubleClickZoom: true,
|
|
18710
|
+
draggableCursor: "pointer",
|
|
18711
|
+
scaleControl: true,
|
|
18712
|
+
fullscreenControl: config.map_search ? true : false,
|
|
18713
|
+
};
|
|
18714
|
+
if (inCenter) {
|
|
18715
|
+
myOptions = Object.assign(myOptions, {
|
|
18716
|
+
center: new google.maps.LatLng(
|
|
18717
|
+
inCenter.latitude,
|
|
18718
|
+
inCenter.longitude,
|
|
18719
|
+
),
|
|
18720
|
+
zoom: parseInt(inCenter.zoom),
|
|
18721
|
+
});
|
|
18722
|
+
}
|
|
18723
|
+
var pixel_width = inDiv.offsetWidth;
|
|
18724
|
+
if (pixel_width == 0) {
|
|
18725
|
+
pixel_width = inDiv.parentNode.offsetWidth;
|
|
18726
|
+
}
|
|
18727
|
+
var pixel_height = parseInt(
|
|
18728
|
+
jQuery(inDiv).css("height").replace("px", ""),
|
|
18729
|
+
);
|
|
18730
|
+
if (pixel_height == 0) {
|
|
18731
|
+
pixel_height = pixel_width;
|
|
18732
|
+
}
|
|
18733
|
+
if (pixel_height > pixel_width) {
|
|
18734
|
+
jQuery(inDiv).css("height", pixel_width + "px");
|
|
18735
|
+
}
|
|
18736
|
+
if (pixel_width < 640 || pixel_height < 640) {
|
|
18737
|
+
myOptions.scrollwheel = true;
|
|
18738
|
+
myOptions.zoomControlOptions = {
|
|
18739
|
+
style: google.maps.ZoomControlStyle.SMALL,
|
|
18740
|
+
};
|
|
18741
|
+
} else {
|
|
18742
|
+
myOptions.zoomControlOptions = {
|
|
18743
|
+
style: google.maps.ZoomControlStyle.LARGE,
|
|
18744
|
+
};
|
|
18745
|
+
}
|
|
18746
|
+
gInfoWindow = new google.maps.InfoWindow();
|
|
18747
|
+
gMainMap = new google.maps.Map(inDiv, myOptions);
|
|
18748
|
+
|
|
18749
|
+
return gMainMap;
|
|
18750
|
+
}
|
|
18751
|
+
function addListener(ev, f, once) {
|
|
18752
|
+
if (!gMainMap) return;
|
|
18753
|
+
var e = ev;
|
|
18754
|
+
switch (ev) {
|
|
18755
|
+
case "zoomend":
|
|
18756
|
+
e = "zoom_changed";
|
|
18757
|
+
break;
|
|
18758
|
+
default:
|
|
18759
|
+
}
|
|
18760
|
+
if (once) {
|
|
18761
|
+
return google.maps.event.addListenerOnce(gMainMap, e, f);
|
|
18762
|
+
} else {
|
|
18763
|
+
return google.maps.event.addListener(gMainMap, e, f);
|
|
18764
|
+
}
|
|
18765
|
+
}
|
|
18766
|
+
function removeListener(f) {
|
|
18767
|
+
if (!gMainMap) return;
|
|
18768
|
+
f.remove();
|
|
18769
|
+
}
|
|
18770
|
+
function fitBounds(locations) {
|
|
18771
|
+
if (!gMainMap) return;
|
|
18772
|
+
google.maps.event.addListenerOnce(
|
|
18773
|
+
gMainMap,
|
|
18774
|
+
"bounds_changed",
|
|
18775
|
+
function () {
|
|
18776
|
+
gMainMap.setZoom(
|
|
18777
|
+
parseInt(Math.min(gMainMap.getZoom(), config.maxZoom)),
|
|
18778
|
+
);
|
|
18779
|
+
},
|
|
18780
|
+
);
|
|
18781
|
+
let start = new google.maps.LatLngBounds(); // avoid occasional timing problem
|
|
18782
|
+
if (!start) return;
|
|
18783
|
+
const bounds = locations.reduce(function (bounds, m) {
|
|
18784
|
+
if (bounds === null) return start;
|
|
18785
|
+
return bounds.extend(new google.maps.LatLng(m[0], m[1]));
|
|
18786
|
+
}, start);
|
|
18787
|
+
gMainMap.fitBounds(bounds);
|
|
18788
|
+
}
|
|
18789
|
+
function flyToFixedZoom(position, zoom, extra) {
|
|
18790
|
+
if (!gMainMap) return;
|
|
18791
|
+
google.maps.event.addListenerOnce(gMainMap, "idle", function () {
|
|
18792
|
+
if (extra) extra();
|
|
18793
|
+
});
|
|
18794
|
+
const latlng = new google.maps.LatLng(position.lat, position.lng);
|
|
18795
|
+
gMainMap.setCenter(latlng);
|
|
18796
|
+
gMainMap.setZoom(zoom);
|
|
18797
|
+
}
|
|
18798
|
+
function getOpenMarker() {
|
|
18799
|
+
return gOpenMarker;
|
|
18800
|
+
}
|
|
18801
|
+
function clearAllMarkers() {
|
|
18802
|
+
if (!gMainMap) return;
|
|
18803
|
+
gAllMarkers &&
|
|
18804
|
+
gAllMarkers.forEach(function (m) {
|
|
18805
|
+
m &&
|
|
18806
|
+
m.marker.info_win &&
|
|
18807
|
+
gAllMarkers[c].marker.info_win_.close();
|
|
18808
|
+
m.marker.setMap(null);
|
|
18809
|
+
});
|
|
18810
|
+
gAllMarkers = [];
|
|
18811
|
+
gOpenMarker = false;
|
|
18812
|
+
}
|
|
18813
|
+
function isFilterVisible() {
|
|
18735
18814
|
return config.filter_visible && config.filter_visible == 1;
|
|
18736
18815
|
}
|
|
18737
18816
|
function webMercatorToLatLng(point, zoom) {
|
|
18738
|
-
|
|
18739
|
-
|
|
18817
|
+
const latLng = croutonMap.webMercatorToLatLng(point, zoom);
|
|
18818
|
+
return new google.maps.LatLng(latLng.lat, latLng.lng);
|
|
18740
18819
|
}
|
|
18741
18820
|
function calculateBounds(center, zoom, width, height) {
|
|
18742
18821
|
const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
|
|
18743
|
-
const southwestWebMercator = {
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18822
|
+
const southwestWebMercator = {
|
|
18823
|
+
x: centerPoint.x - width / 2,
|
|
18824
|
+
y: centerPoint.y + height / 2,
|
|
18825
|
+
};
|
|
18826
|
+
const northeastWebMercator = {
|
|
18827
|
+
x: centerPoint.x + width / 2,
|
|
18828
|
+
y: centerPoint.y - height / 2,
|
|
18829
|
+
};
|
|
18830
|
+
return new google.maps.LatLngBounds(
|
|
18831
|
+
webMercatorToLatLng(southwestWebMercator, zoom),
|
|
18832
|
+
webMercatorToLatLng(northeastWebMercator, zoom),
|
|
18833
|
+
);
|
|
18834
|
+
}
|
|
18835
|
+
function withinInscribedCircle(center, point, zoom, width, height) {
|
|
18836
|
+
const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
|
|
18837
|
+
const meetingPoint = croutonMap.latLngToWebMercator(point, zoom);
|
|
18838
|
+
const radius = Math.min(width, height) / 2;
|
|
18839
|
+
const distance = Math.sqrt(
|
|
18840
|
+
Math.pow(centerPoint.x - meetingPoint.x, 2) +
|
|
18841
|
+
Math.pow(centerPoint.y - meetingPoint.y, 2),
|
|
18842
|
+
);
|
|
18843
|
+
return distance <= radius;
|
|
18844
|
+
}
|
|
18845
|
+
function calcOffsetWidth(gDiv) {
|
|
18846
|
+
let ret = gDiv.offsetWidth;
|
|
18847
|
+
if (ret === 0) ret = gDiv.parentElement.offsetWidth;
|
|
18848
|
+
return ret;
|
|
18849
|
+
}
|
|
18850
|
+
function getZoomAdjust(
|
|
18851
|
+
filterMeetings,
|
|
18852
|
+
zoomLevel = gMainMap.getZoom(),
|
|
18853
|
+
center = gMainMap.getCenter(),
|
|
18854
|
+
closestMeeting = null,
|
|
18855
|
+
) {
|
|
18753
18856
|
if (!gMainMap) return 12;
|
|
18857
|
+
if (config.map_search && isFilterVisible()) return zoomLevel;
|
|
18754
18858
|
const mapWidth = calcOffsetWidth(gDiv);
|
|
18755
|
-
const mapHeight = parseInt(
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18859
|
+
const mapHeight = parseInt(
|
|
18860
|
+
jQuery(gDiv).css("height").replace("px", ""),
|
|
18861
|
+
);
|
|
18862
|
+
const center_latlng = { lat: center.lat(), lng: center.lng() };
|
|
18863
|
+
let ret = zoomLevel;
|
|
18759
18864
|
var bounds = calculateBounds(center_latlng, ret, mapWidth, mapHeight);
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18865
|
+
if (closestMeeting) {
|
|
18866
|
+
while (
|
|
18867
|
+
!withinInscribedCircle(
|
|
18868
|
+
center_latlng,
|
|
18869
|
+
closestMeeting,
|
|
18870
|
+
ret,
|
|
18871
|
+
mapWidth,
|
|
18872
|
+
mapHeight,
|
|
18873
|
+
) &&
|
|
18874
|
+
ret > config.minZoom
|
|
18875
|
+
) {
|
|
18876
|
+
ret -= 1;
|
|
18877
|
+
}
|
|
18878
|
+
} else {
|
|
18879
|
+
while (
|
|
18880
|
+
filterMeetings(bounds, center_latlng).length == 0 &&
|
|
18881
|
+
ret > config.minZoom
|
|
18882
|
+
) {
|
|
18883
|
+
ret -= 1;
|
|
18884
|
+
bounds = calculateBounds(
|
|
18885
|
+
center_latlng,
|
|
18886
|
+
ret,
|
|
18887
|
+
mapWidth,
|
|
18888
|
+
mapHeight,
|
|
18889
|
+
);
|
|
18890
|
+
}
|
|
18891
|
+
}
|
|
18892
|
+
// If we didn't zoom out, zoom in if it doesn't lose meetings
|
|
18893
|
+
if (ret == zoomLevel) {
|
|
18894
|
+
let meetingsInBounds = filterMeetings(bounds, center_latlng).length;
|
|
18895
|
+
if (meetingsInBounds > 0) {
|
|
18896
|
+
do {
|
|
18897
|
+
ret = ret + 1;
|
|
18898
|
+
if (ret > config.maxZoom) break;
|
|
18899
|
+
var bounds = calculateBounds(
|
|
18900
|
+
center_latlng,
|
|
18901
|
+
ret,
|
|
18902
|
+
mapWidth,
|
|
18903
|
+
mapHeight,
|
|
18904
|
+
);
|
|
18905
|
+
} while (
|
|
18906
|
+
filterMeetings(bounds, center_latlng).length ===
|
|
18907
|
+
meetingsInBounds
|
|
18908
|
+
);
|
|
18909
|
+
ret = ret - 1;
|
|
18910
|
+
}
|
|
18763
18911
|
}
|
|
18764
18912
|
return ret;
|
|
18765
18913
|
}
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18796
|
-
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
|
|
18813
|
-
|
|
18814
|
-
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18819
|
-
|
|
18820
|
-
|
|
18821
|
-
|
|
18822
|
-
|
|
18823
|
-
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18828
|
-
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
|
|
18840
|
-
|
|
18841
|
-
|
|
18842
|
-
|
|
18843
|
-
|
|
18844
|
-
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
{
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
|
|
18864
|
-
|
|
18865
|
-
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
|
|
18892
|
-
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
|
|
18909
|
-
|
|
18910
|
-
}
|
|
18911
|
-
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18937
|
-
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
18954
|
-
|
|
18955
|
-
|
|
18956
|
-
|
|
18957
|
-
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18962
|
-
|
|
18963
|
-
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
}
|
|
18972
|
-
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
18978
|
-
|
|
18979
|
-
|
|
18980
|
-
|
|
18981
|
-
|
|
18982
|
-
|
|
18983
|
-
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
18988
|
-
|
|
18989
|
-
|
|
18990
|
-
|
|
18991
|
-
|
|
18992
|
-
|
|
18993
|
-
|
|
18994
|
-
|
|
18995
|
-
|
|
18996
|
-
|
|
18997
|
-
|
|
18998
|
-
|
|
18999
|
-
|
|
18914
|
+
function getZoom() {
|
|
18915
|
+
if (!gMainMap) return 12;
|
|
18916
|
+
return gMainMap.getZoom();
|
|
18917
|
+
}
|
|
18918
|
+
function contains(bounds, lat, lng) {
|
|
18919
|
+
if (!gMainMap) return true;
|
|
18920
|
+
return bounds.contains(new google.maps.LatLng(lat, lng));
|
|
18921
|
+
}
|
|
18922
|
+
function getBounds() {
|
|
18923
|
+
if (!gMainMap) return null;
|
|
18924
|
+
return gMainMap.getBounds();
|
|
18925
|
+
}
|
|
18926
|
+
function createClusterLayer() {
|
|
18927
|
+
gIsClustering = true;
|
|
18928
|
+
}
|
|
18929
|
+
function removeClusterLayer() {
|
|
18930
|
+
if (!gMainMap) return;
|
|
18931
|
+
gIsClustering = false;
|
|
18932
|
+
gMarkerClusterer && gMarkerClusterer.setMap(null);
|
|
18933
|
+
gMarkerClusterer = null;
|
|
18934
|
+
if (gOms) {
|
|
18935
|
+
gOms.removeAllMarkers();
|
|
18936
|
+
gOms.clearListeners("click");
|
|
18937
|
+
gOms = null;
|
|
18938
|
+
}
|
|
18939
|
+
}
|
|
18940
|
+
function addClusterLayer() {
|
|
18941
|
+
if (!gMainMap) return;
|
|
18942
|
+
let markers = gAllMarkers.map((m) => m.marker);
|
|
18943
|
+
if (gIsClustering) {
|
|
18944
|
+
gMarkerClusterer = new markerClusterer.MarkerClusterer({
|
|
18945
|
+
map: gMainMap,
|
|
18946
|
+
markers: markers,
|
|
18947
|
+
imagePath:
|
|
18948
|
+
"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",
|
|
18949
|
+
});
|
|
18950
|
+
gOms = new OverlappingMarkerSpiderfier(gMainMap, {
|
|
18951
|
+
markersWontMove: true,
|
|
18952
|
+
markersWontHide: true,
|
|
18953
|
+
});
|
|
18954
|
+
gOms.addListener("format", function (marker, status) {
|
|
18955
|
+
var icon;
|
|
18956
|
+
if (
|
|
18957
|
+
status ===
|
|
18958
|
+
OverlappingMarkerSpiderfier.markerStatus.SPIDERFIED ||
|
|
18959
|
+
status ===
|
|
18960
|
+
OverlappingMarkerSpiderfier.markerStatus.SPIDERFIABLE ||
|
|
18961
|
+
status ===
|
|
18962
|
+
OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIED
|
|
18963
|
+
) {
|
|
18964
|
+
icon = g_icon_image_multi;
|
|
18965
|
+
} else if (
|
|
18966
|
+
status ===
|
|
18967
|
+
OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIABLE
|
|
18968
|
+
) {
|
|
18969
|
+
icon = g_icon_image_single;
|
|
18970
|
+
} else {
|
|
18971
|
+
icon = null;
|
|
18972
|
+
}
|
|
18973
|
+
marker.setIcon(icon);
|
|
18974
|
+
});
|
|
18975
|
+
google.maps.event.addListener(
|
|
18976
|
+
gMainMap,
|
|
18977
|
+
"zoom_changed",
|
|
18978
|
+
function () {
|
|
18979
|
+
if (gMainMap.getProjection() == "undefined") return;
|
|
18980
|
+
google.maps.event.addListenerOnce(
|
|
18981
|
+
gMainMap,
|
|
18982
|
+
"idle",
|
|
18983
|
+
function () {
|
|
18984
|
+
if (gMainMap.getProjection() == "undefined") return;
|
|
18985
|
+
if (gOms == null) return;
|
|
18986
|
+
var spidered = gOms.markersNearAnyOtherMarker();
|
|
18987
|
+
for (var i = 0; i < spidered.length; i++) {
|
|
18988
|
+
spidered[i].icon = g_icon_image_multi;
|
|
18989
|
+
}
|
|
18990
|
+
},
|
|
18991
|
+
);
|
|
18992
|
+
},
|
|
18993
|
+
);
|
|
18994
|
+
|
|
18995
|
+
// This is necessary to make the Spiderfy work
|
|
18996
|
+
gOms.addListener("click", function (marker) {
|
|
18997
|
+
marker.zIndex = 999;
|
|
18998
|
+
gInfoWindow.setContent(marker.desc);
|
|
18999
|
+
gInfoWindow.open(gMainMap, marker);
|
|
19000
|
+
});
|
|
19001
|
+
markers.forEach((marker) => gOms.addMarker(marker));
|
|
19002
|
+
} else markers.forEach((m) => m.setMap(gMainMap));
|
|
19003
|
+
}
|
|
19004
|
+
function markSearchPoint(inCoords) {
|
|
19005
|
+
if (!gMainMap) return;
|
|
19006
|
+
if (gSearchPointMarker) gSearchPointMarker.setMap(null);
|
|
19007
|
+
gSearchPointMarker = new google.maps.Marker({
|
|
19008
|
+
position: new google.maps.LatLng(...inCoords),
|
|
19009
|
+
});
|
|
19010
|
+
gSearchPointMarker.setIcon(g_icon_image_searchpoint);
|
|
19011
|
+
gSearchPointMarker.setMap(gMainMap);
|
|
19012
|
+
}
|
|
19013
|
+
function createMarker(
|
|
19014
|
+
inCoords, ///< The long/lat for the marker.
|
|
19015
|
+
multi,
|
|
19016
|
+
inTitle,
|
|
19017
|
+
) {
|
|
19018
|
+
if (!gMainMap) return;
|
|
19019
|
+
var in_main_icon = multi ? g_icon_image_multi : g_icon_image_single;
|
|
19020
|
+
var marker = null;
|
|
19021
|
+
|
|
19022
|
+
var marker = new google.maps.Marker({
|
|
19023
|
+
position: new google.maps.LatLng(...inCoords),
|
|
19024
|
+
shadow: g_icon_shadow,
|
|
19025
|
+
icon: in_main_icon,
|
|
19026
|
+
shape: g_icon_shape,
|
|
19027
|
+
cursor: "default",
|
|
19028
|
+
title: inTitle,
|
|
19029
|
+
draggable: false,
|
|
19030
|
+
});
|
|
19031
|
+
marker.zIndex = 999;
|
|
19032
|
+
marker.old_image = marker.getIcon();
|
|
19033
|
+
return marker;
|
|
19034
|
+
}
|
|
19035
|
+
function bindPopup(marker, inHtml, inIds, openedMarker) {
|
|
19036
|
+
if (inHtml) {
|
|
19037
|
+
marker.desc = inHtml;
|
|
19038
|
+
google.maps.event.addListener(marker, "click", function () {
|
|
19039
|
+
gAllMarkers.forEach((m) =>
|
|
19040
|
+
m.marker.setIcon(m.marker.old_image),
|
|
19041
|
+
);
|
|
19042
|
+
if (marker.old_image) {
|
|
19043
|
+
marker.setIcon(g_icon_image_selected);
|
|
19044
|
+
}
|
|
19045
|
+
openInfoWindow(marker);
|
|
19046
|
+
});
|
|
19047
|
+
if (gOpenMarker && inIds.includes(parseInt(gOpenMarker))) {
|
|
19048
|
+
openInfoWindow(marker);
|
|
19049
|
+
}
|
|
19050
|
+
gInfoWindow.addListener("closeclick", function () {
|
|
19051
|
+
gOpenMarker = false;
|
|
19052
|
+
gAllMarkers.forEach((m) =>
|
|
19053
|
+
m.marker.setIcon(m.marker.old_image),
|
|
19054
|
+
);
|
|
19055
|
+
jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
|
|
19056
|
+
});
|
|
19057
|
+
}
|
|
19058
|
+
gAllMarkers[gAllMarkers.length] = { ids: inIds, marker: marker };
|
|
19059
|
+
}
|
|
19060
|
+
function addMarkerCallback(marker, cb, in_ids) {
|
|
19061
|
+
if (cb)
|
|
19062
|
+
marker.addListener("click", () => {
|
|
19063
|
+
cb(in_ids);
|
|
19064
|
+
});
|
|
19065
|
+
gAllMarkers.push({ ids: in_ids, marker: marker });
|
|
19066
|
+
}
|
|
19067
|
+
function highlightRow(target) {
|
|
19068
|
+
const id = target.id.split("-")[1];
|
|
19069
|
+
gOpenMarker = id;
|
|
19070
|
+
jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
|
|
19071
|
+
jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
|
|
19072
|
+
if (typeof crouton == "undefined") crouton.dayTabFromId(id);
|
|
19073
|
+
}
|
|
19074
|
+
function openInfoWindow(marker) {
|
|
19075
|
+
marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
|
|
19076
|
+
gInfoWindow.setContent(marker.desc);
|
|
19077
|
+
gInfoWindow.open(gMainMap, marker);
|
|
19078
|
+
gInfoWindow.addListener("visible", function () {
|
|
19079
|
+
jQuery("input[type=radio][name=panel]:checked").each(
|
|
19080
|
+
function (index, target) {
|
|
19081
|
+
highlightRow(target);
|
|
19082
|
+
},
|
|
19083
|
+
);
|
|
19084
|
+
jQuery("input[type=radio][name=panel]").change(function () {
|
|
19085
|
+
highlightRow(this);
|
|
19086
|
+
});
|
|
19087
|
+
});
|
|
19088
|
+
}
|
|
19089
|
+
function addControl(div, pos, cb) {
|
|
19090
|
+
if (!div) return;
|
|
19091
|
+
if (!gMainMap) {
|
|
19092
|
+
gDiv.appendChild(div);
|
|
19093
|
+
return;
|
|
19094
|
+
}
|
|
19095
|
+
var p = pos;
|
|
19096
|
+
switch (pos) {
|
|
19097
|
+
case "topright":
|
|
19098
|
+
p = google.maps.ControlPosition.TOP_RIGHT;
|
|
19099
|
+
div.style.margin = "10px 10px 0 0";
|
|
19100
|
+
break;
|
|
19101
|
+
case "topleft":
|
|
19102
|
+
p = google.maps.ControlPosition.TOP_LEFT;
|
|
19103
|
+
div.style.margin = "10px 0 0 10px";
|
|
19104
|
+
break;
|
|
19105
|
+
case "bottomleft":
|
|
19106
|
+
p = google.maps.ControlPosition.LEFT_BOTTOM;
|
|
19107
|
+
div.style.margin = "0 0 0px 10px";
|
|
19108
|
+
break;
|
|
19109
|
+
}
|
|
19110
|
+
div.index = 1;
|
|
19111
|
+
if (cb) {
|
|
19112
|
+
const observer = new MutationObserver(function (records) {
|
|
19113
|
+
records.forEach((record) => {
|
|
19114
|
+
record.addedNodes.forEach((n) => {
|
|
19115
|
+
if (n === div) {
|
|
19116
|
+
observer.disconnect();
|
|
19117
|
+
cb();
|
|
19118
|
+
}
|
|
19119
|
+
});
|
|
19120
|
+
});
|
|
19121
|
+
});
|
|
19122
|
+
observer.observe(document, { childList: true, subtree: true });
|
|
19123
|
+
}
|
|
19124
|
+
gMainMap.controls[p].push(div);
|
|
19125
|
+
}
|
|
19126
|
+
function openMarker(id) {
|
|
19127
|
+
if (!gMainMap) return;
|
|
19128
|
+
const marker = gAllMarkers.find((m) => m.ids.includes(id));
|
|
19129
|
+
if (marker) {
|
|
19130
|
+
jQuery("#panel-" + id).prop("checked", true);
|
|
19131
|
+
openInfoWindow(marker.marker);
|
|
19132
|
+
}
|
|
19133
|
+
}
|
|
19134
|
+
function getGeocodingChoices(in_geocode_response) {
|
|
19135
|
+
if (!Array.isArray(in_geocode_response)) return [];
|
|
19136
|
+
return in_geocode_response.map((r) => r.formatted_address);
|
|
19137
|
+
}
|
|
19138
|
+
function getGeocodeCenterAndBounds(in_geocode_response, i = 0) {
|
|
19139
|
+
if (
|
|
19140
|
+
in_geocode_response &&
|
|
19141
|
+
in_geocode_response[i] &&
|
|
19142
|
+
in_geocode_response[i].geometry &&
|
|
19143
|
+
in_geocode_response[i].geometry.location
|
|
19144
|
+
)
|
|
19145
|
+
return {
|
|
19146
|
+
center: {
|
|
19147
|
+
lat: in_geocode_response[i].geometry.location.lat(),
|
|
19148
|
+
lng: in_geocode_response[i].geometry.location.lng(),
|
|
19149
|
+
},
|
|
19150
|
+
southWest: {
|
|
19151
|
+
lat: in_geocode_response[i].geometry.viewport
|
|
19152
|
+
.getSouthWest()
|
|
19153
|
+
.lat(),
|
|
19154
|
+
lng: in_geocode_response[i].geometry.viewport
|
|
19155
|
+
.getSouthWest()
|
|
19156
|
+
.lng(),
|
|
19157
|
+
},
|
|
19158
|
+
northEast: {
|
|
19159
|
+
lat: in_geocode_response[i].geometry.viewport
|
|
19160
|
+
.getNorthEast()
|
|
19161
|
+
.lat(),
|
|
19162
|
+
lng: in_geocode_response[i].geometry.viewport
|
|
19163
|
+
.getNorthEast()
|
|
19164
|
+
.lng(),
|
|
19165
|
+
},
|
|
19166
|
+
};
|
|
19167
|
+
alert(crouton.localization.getWord("address_lookup_fail"));
|
|
19168
|
+
return null;
|
|
19169
|
+
}
|
|
19170
|
+
function callGeocoder(in_loc, callback) {
|
|
19171
|
+
var geocoder = new google.maps.Geocoder();
|
|
19172
|
+
|
|
19173
|
+
if (geocoder) {
|
|
19174
|
+
var geoCodeParams = { address: in_loc };
|
|
19175
|
+
if (config.region && config.region.trim() !== "") {
|
|
19176
|
+
geoCodeParams.region = config.region;
|
|
19177
|
+
}
|
|
19178
|
+
if (
|
|
19179
|
+
config.bounds &&
|
|
19180
|
+
config.bounds.north &&
|
|
19181
|
+
config.bounds.north.trim() !== "" &&
|
|
19182
|
+
config.bounds.east &&
|
|
19183
|
+
config.bounds.east.trim() !== "" &&
|
|
19184
|
+
config.bounds.south &&
|
|
19185
|
+
config.bounds.south.trim() !== "" &&
|
|
19186
|
+
config.bounds.west &&
|
|
19187
|
+
config.bounds.west.trim() !== ""
|
|
19188
|
+
) {
|
|
19189
|
+
geoCodeParams.bounds = new google.maps.LatLngBounds(
|
|
19190
|
+
new google.maps.LatLng(
|
|
19191
|
+
config.bounds.south,
|
|
19192
|
+
config.bounds.west,
|
|
19193
|
+
),
|
|
19194
|
+
new google.maps.LatLng(
|
|
19195
|
+
config.bounds.north,
|
|
19196
|
+
config.bounds.east,
|
|
19197
|
+
),
|
|
19198
|
+
);
|
|
19199
|
+
}
|
|
19200
|
+
geocoder.geocode(geoCodeParams, callback);
|
|
19201
|
+
} else // None of that stuff is defined if we couldn't create the geocoder.
|
|
19202
|
+
{
|
|
19203
|
+
alert(crouton.localization.getWord("address_lookup_fail"));
|
|
19204
|
+
}
|
|
19205
|
+
}
|
|
19206
|
+
function getZoomAdjustedBounds(
|
|
19207
|
+
center_latlng,
|
|
19208
|
+
filterMeetings,
|
|
19209
|
+
zoomLevel,
|
|
19210
|
+
closestMeeting = null,
|
|
19211
|
+
) {
|
|
19212
|
+
if (!center_latlng) return null;
|
|
19213
|
+
const center = new google.maps.LatLng(
|
|
19214
|
+
center_latlng.lat,
|
|
19215
|
+
center_latlng.lng,
|
|
19216
|
+
);
|
|
19000
19217
|
const mapWidth = calcOffsetWidth(gDiv);
|
|
19001
|
-
const mapHeight = parseInt(
|
|
19218
|
+
const mapHeight = parseInt(
|
|
19219
|
+
jQuery(gDiv).css("height").replace("px", ""),
|
|
19220
|
+
);
|
|
19002
19221
|
if (center) {
|
|
19003
|
-
const zoom = getZoomAdjust(
|
|
19004
|
-
|
|
19005
|
-
|
|
19222
|
+
const zoom = getZoomAdjust(
|
|
19223
|
+
filterMeetings,
|
|
19224
|
+
zoomLevel,
|
|
19225
|
+
center,
|
|
19226
|
+
closestMeeting,
|
|
19227
|
+
);
|
|
19228
|
+
const bounds = calculateBounds(
|
|
19229
|
+
center_latlng,
|
|
19230
|
+
zoom,
|
|
19231
|
+
mapWidth,
|
|
19232
|
+
mapHeight,
|
|
19233
|
+
);
|
|
19234
|
+
const ret = { center: center_latlng, bounds: bounds, zoom: zoom };
|
|
19006
19235
|
return ret;
|
|
19007
19236
|
} else {
|
|
19008
|
-
alert
|
|
19237
|
+
alert(crouton.localization.getWord("address_lookup_fail"));
|
|
19009
19238
|
return null;
|
|
19010
19239
|
}
|
|
19011
|
-
|
|
19240
|
+
}
|
|
19012
19241
|
function calculateBoundsFromCenterAndZoom(center, zoomLevel) {
|
|
19013
|
-
|
|
19014
|
-
const mapHeight = parseInt(
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19242
|
+
const mapWidth = calcOffsetWidth(gDiv);
|
|
19243
|
+
const mapHeight = parseInt(
|
|
19244
|
+
jQuery(gDiv).css("height").replace("px", ""),
|
|
19245
|
+
);
|
|
19246
|
+
return calculateBounds(center, zoomLevel, mapWidth, mapHeight);
|
|
19247
|
+
}
|
|
19248
|
+
function invalidateSize() {}
|
|
19249
|
+
function clickSearch(ev, cb) {
|
|
19250
|
+
if (!gMainMap) return;
|
|
19251
|
+
gMainMap.setOptions({
|
|
19252
|
+
draggableCursor: "crosshair",
|
|
19253
|
+
zoomControl: false,
|
|
19254
|
+
gestureHandling: "none",
|
|
19255
|
+
});
|
|
19256
|
+
google.maps.event.addListenerOnce(gMainMap, "click", function (e) {
|
|
19257
|
+
gMainMap.setOptions({
|
|
19258
|
+
draggableCursor: "default",
|
|
19259
|
+
zoomControl: true,
|
|
19260
|
+
gestureHandling: "auto",
|
|
19261
|
+
});
|
|
19262
|
+
cb(e.latLng.lat(), e.latLng.lng());
|
|
19263
|
+
});
|
|
19264
|
+
}
|
|
19265
|
+
function getCorners(lat_lngs = false) {
|
|
19266
|
+
var bounds = lat_lngs
|
|
19267
|
+
? lat_lngs.reduce(function (b, m) {
|
|
19268
|
+
return b.extend(new google.maps.LatLng(m[0], m[1]));
|
|
19269
|
+
}, new google.maps.LatLngBounds())
|
|
19270
|
+
: gMainMap.getBounds();
|
|
19271
|
+
|
|
19272
|
+
return {
|
|
19273
|
+
ne: {
|
|
19274
|
+
lat: bounds.getNorthEast().lat(),
|
|
19275
|
+
lng: bounds.getNorthEast().lng(),
|
|
19276
|
+
},
|
|
19277
|
+
sw: {
|
|
19278
|
+
lat: bounds.getSouthWest().lat(),
|
|
19279
|
+
lng: bounds.getSouthWest().lng(),
|
|
19280
|
+
},
|
|
19281
|
+
};
|
|
19282
|
+
}
|
|
19283
|
+
function getCenter() {
|
|
19284
|
+
var center = gMainMap.getCenter();
|
|
19285
|
+
return { lat: center.lat(), lng: center.lng() };
|
|
19286
|
+
}
|
|
19287
|
+
function afterInit(doNotWait, f) {
|
|
19288
|
+
if (!gMainMap) return;
|
|
19289
|
+
if (doNotWait || typeof gMainMap.getBounds() !== "undefined") f();
|
|
19290
|
+
else
|
|
19291
|
+
addListener(
|
|
19292
|
+
"idle",
|
|
19293
|
+
function () {
|
|
19294
|
+
f();
|
|
19295
|
+
},
|
|
19296
|
+
true,
|
|
19297
|
+
);
|
|
19298
|
+
}
|
|
19299
|
+
function modalOn() {}
|
|
19300
|
+
function modalOff() {}
|
|
19058
19301
|
function isMapDefined() {
|
|
19059
19302
|
return gMainMap !== null && gMainMap !== undefined;
|
|
19060
19303
|
}
|
|
19061
|
-
|
|
19062
|
-
return
|
|
19304
|
+
function isMapVisible() {
|
|
19305
|
+
return (
|
|
19306
|
+
gMainMap !== null &&
|
|
19307
|
+
gMainMap !== undefined &&
|
|
19308
|
+
gMainMap.getProjection() !== null &&
|
|
19309
|
+
gMainMap.getProjection() !== undefined
|
|
19310
|
+
);
|
|
19063
19311
|
}
|
|
19064
|
-
|
|
19065
|
-
|
|
19066
|
-
|
|
19067
|
-
|
|
19068
|
-
|
|
19069
|
-
|
|
19312
|
+
this.createMap = createMap;
|
|
19313
|
+
this.addListener = addListener;
|
|
19314
|
+
this.addControl = addControl;
|
|
19315
|
+
this.flyToFixedZoom = flyToFixedZoom;
|
|
19316
|
+
this.clearAllMarkers = clearAllMarkers;
|
|
19317
|
+
this.callGeocoder = callGeocoder;
|
|
19070
19318
|
this.getZoomAdjustedBounds = getZoomAdjustedBounds;
|
|
19071
|
-
|
|
19072
|
-
|
|
19319
|
+
this.getZoom = getZoom;
|
|
19320
|
+
this.createMarker = createMarker;
|
|
19073
19321
|
this.bindPopup = bindPopup;
|
|
19074
19322
|
this.addMarkerCallback = addMarkerCallback;
|
|
19075
|
-
|
|
19076
|
-
|
|
19077
|
-
|
|
19078
|
-
|
|
19079
|
-
|
|
19080
|
-
|
|
19081
|
-
|
|
19082
|
-
|
|
19083
|
-
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19088
|
-
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19323
|
+
this.contains = contains;
|
|
19324
|
+
this.getBounds = getBounds;
|
|
19325
|
+
this.invalidateSize = invalidateSize;
|
|
19326
|
+
this.fitBounds = fitBounds;
|
|
19327
|
+
this.openMarker = openMarker;
|
|
19328
|
+
this.isApiLoaded = isApiLoaded;
|
|
19329
|
+
this.loadApi = loadApi;
|
|
19330
|
+
this.createClusterLayer = createClusterLayer;
|
|
19331
|
+
this.addClusterLayer = addClusterLayer;
|
|
19332
|
+
this.removeClusterLayer = removeClusterLayer;
|
|
19333
|
+
this.clickSearch = clickSearch;
|
|
19334
|
+
this.getGeocodeCenterAndBounds = getGeocodeCenterAndBounds;
|
|
19335
|
+
this.getGeocodingChoices = getGeocodingChoices;
|
|
19336
|
+
this.modalOn = modalOn;
|
|
19337
|
+
this.modalOff = modalOff;
|
|
19338
|
+
this.removeListener = removeListener;
|
|
19339
|
+
this.afterInit = afterInit;
|
|
19340
|
+
this.isMapDefined = isMapDefined;
|
|
19341
|
+
this.isMapVisible = isMapVisible;
|
|
19342
|
+
this.getCorners = getCorners;
|
|
19343
|
+
this.getCenter = getCenter;
|
|
19344
|
+
this.markSearchPoint = markSearchPoint;
|
|
19345
|
+
this.getOpenMarker = getOpenMarker;
|
|
19346
|
+
this.calculateBoundsFromCenterAndZoom = calculateBoundsFromCenterAndZoom;
|
|
19099
19347
|
}
|
|
19100
19348
|
MapDelegate.prototype.createMap = null;
|
|
19101
19349
|
MapDelegate.prototype.addListener = null;
|
|
@@ -19126,12 +19374,13 @@ MapDelegate.prototype.modalOn = null;
|
|
|
19126
19374
|
MapDelegate.prototype.modalOff = null;
|
|
19127
19375
|
MapDelegate.prototype.afterInit = null;
|
|
19128
19376
|
MapDelegate.prototype.isMapDefined = null;
|
|
19129
|
-
MapDelegate.prototype
|
|
19377
|
+
MapDelegate.prototype.isMapVisible = null;
|
|
19130
19378
|
MapDelegate.prototype.getCorners = null;
|
|
19131
|
-
MapDelegate.prototype.getCenter= null;
|
|
19379
|
+
MapDelegate.prototype.getCenter = null;
|
|
19132
19380
|
MapDelegate.prototype.markSearchPoint = null;
|
|
19133
19381
|
MapDelegate.prototype.getOpenMarker = null;
|
|
19134
19382
|
MapDelegate.prototype.calculateBoundsFromCenterAndZoom = null;
|
|
19383
|
+
|
|
19135
19384
|
var markerClusterer=function(t){"use strict";function e(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}class s{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}}class r{constructor(t){let{markers:e,position:s}=t;this.markers=e,s&&(s instanceof google.maps.LatLng?this._position=s:this._position=new google.maps.LatLng(s))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(s.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((t=>s.getVisible(t))).length}push(t){this.markers.push(t)}delete(){this.marker&&(s.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const o=(t,e,r,o)=>{const n=i(t.getBounds(),e,o);return r.filter((t=>n.contains(s.getPosition(t))))},i=(t,e,s)=>{const{northEast:r,southWest:o}=h(t,e),i=l({northEast:r,southWest:o},s);return c(i,e)},n=(t,e,s)=>{const r=i(t,e,s),o=r.getNorthEast(),n=r.getSouthWest();return[n.lng(),n.lat(),o.lng(),o.lat()]},a=(t,e)=>{const s=(e.lat-t.lat)*Math.PI/180,r=(e.lng-t.lng)*Math.PI/180,o=Math.sin(s/2),i=Math.sin(r/2),n=o*o+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*i*i;return 6371*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))},h=(t,e)=>({northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}),l=(t,e)=>{let{northEast:s,southWest:r}=t;return s.x+=e,s.y-=e,r.x-=e,r.y+=e,{northEast:s,southWest:r}},c=(t,e)=>{let{northEast:s,southWest:r}=t;const o=e.fromDivPixelToLatLng(r),i=e.fromDivPixelToLatLng(s);return new google.maps.LatLngBounds(o,i)};class u{constructor(t){let{maxZoom:e=16}=t;this.maxZoom=e}noop(t){let{markers:e}=t;return m(e)}}class p extends u{constructor(t){var{viewportPadding:s=60}=t;super(e(t,["viewportPadding"])),this.viewportPadding=60,this.viewportPadding=s}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return s.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:o(s,r,e,this.viewportPadding),map:s,mapCanvasProjection:r})}}}const m=t=>t.map((t=>new r({position:s.getPosition(t),markers:[t]})));function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var g=function t(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var r,o,i;if(Array.isArray(e)){if((r=e.length)!=s.length)return!1;for(o=r;0!=o--;)if(!t(e[o],s[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((r=(i=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=r;0!=o--;){var n=i[o];if(!t(e[n],s[n]))return!1}return!0}return e!=e&&s!=s},f=d(g);const k=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class w{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const o=k[15&s];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1);return new w(n,i,o,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=k.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,n=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-n%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+i+n+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return y(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:n}=this,a=[0,o.length-1,0],h=[];for(;a.length;){const l=a.pop()||0,c=a.pop()||0,u=a.pop()||0;if(c-u<=n){for(let n=u;n<=c;n++){const a=i[2*n],l=i[2*n+1];a>=t&&a<=s&&l>=e&&l<=r&&h.push(o[n])}continue}const p=u+c>>1,m=i[2*p],d=i[2*p+1];m>=t&&m<=s&&d>=e&&d<=r&&h.push(o[p]),(0===l?t<=m:e<=d)&&(a.push(u),a.push(p-1),a.push(1-l)),(0===l?s>=m:r>=d)&&(a.push(p+1),a.push(c),a.push(1-l))}return h}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:i}=this,n=[0,r.length-1,0],a=[],h=s*s;for(;n.length;){const l=n.pop()||0,c=n.pop()||0,u=n.pop()||0;if(c-u<=i){for(let s=u;s<=c;s++)C(o[2*s],o[2*s+1],t,e)<=h&&a.push(r[s]);continue}const p=u+c>>1,m=o[2*p],d=o[2*p+1];C(m,d,t,e)<=h&&a.push(r[p]),(0===l?t-s<=m:e-s<=d)&&(n.push(u),n.push(p-1),n.push(1-l)),(0===l?t+s>=m:e+s>=d)&&(n.push(p+1),n.push(c),n.push(1-l))}return a}}function y(t,e,s,r,o,i){if(o-r<=s)return;const n=r+o>>1;M(t,e,n,r,o,i),y(t,e,s,r,n-1,1-i),y(t,e,s,n+1,o,1-i)}function M(t,e,s,r,o,i){for(;o>r;){if(o-r>600){const n=o-r+1,a=s-r+1,h=Math.log(n),l=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*l*(n-l)/n)*(a-n/2<0?-1:1);M(t,e,s,Math.max(r,Math.floor(s-a*l/n+c)),Math.min(o,Math.floor(s+(n-a)*l/n+c)),i)}const n=e[2*s+i];let a=r,h=o;for(v(t,e,r,s),e[2*o+i]>n&&v(t,e,r,o);a<h;){for(v(t,e,a,h),a++,h--;e[2*a+i]<n;)a++;for(;e[2*h+i]>n;)h--}e[2*r+i]===n?v(t,e,r,h):(h++,v(t,e,h,o)),h<=s&&(r=h+1),s<=h&&(o=h-1)}}function v(t,e,s,r){x(t,s,r),x(e,2*s,2*r),x(e,2*s+1,2*r+1)}function x(t,e,s){const r=t[e];t[e]=t[s],t[s]=r}function C(t,e,s,r){const o=t-s,i=e-r;return o*o+i*i}const P={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},_=Math.fround||(E=new Float32Array(1),t=>(E[0]=+t,E[0]));var E;const A=3,b=5,L=6;class O{constructor(t){this.options=Object.assign(Object.create(P),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;const i=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s.geometry)continue;const[r,o]=s.geometry.coordinates,n=_(T(r)),a=_(j(o));i.push(n,a,1/0,e,-1,1),this.options.reduce&&i.push(0)}let n=this.trees[r+1]=this._createTree(i);e&&console.timeEnd(o);for(let t=r;t>=s;t--){const s=+Date.now();n=this.trees[t]=this._createTree(this._cluster(n,t)),e&&console.log("z%d: %d clusters in %dms",t,n.numItems,+Date.now()-s)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,o=180;else if(s>o){const t=this.getClusters([s,r,180,i],e),n=this.getClusters([-180,r,o,i],e);return t.concat(n)}const n=this.trees[this._limitZoom(e)],a=n.range(T(s),j(i),T(o),j(r)),h=n.data,l=[];for(const t of a){const e=this.stride*t;l.push(h[e+b]>1?Z(h,e,this.clusterProps):this.points[h[e+A]])}return l}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(r);const i=o.data;if(e*this.stride>=i.length)throw new Error(r);const n=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=i[e*this.stride],h=i[e*this.stride+1],l=o.within(a,h,n),c=[];for(const e of l){const s=e*this.stride;i[s+4]===t&&c.push(i[s+b]>1?Z(i,s,this.clusterProps):this.points[i[s+A]])}if(0===c.length)throw new Error(r);return c}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:n}=this.options,a=n/i,h=(s-a)/o,l=(s+1+a)/o,c={features:[]};return this._addTileFeatures(r.range((e-a)/o,h,(e+1+a)/o,l),r.data,e,s,o,c),0===e&&this._addTileFeatures(r.range(1-a/o,h,1,l),r.data,o,s,o,c),e===o-1&&this._addTileFeatures(r.range(0,h,a/o,l),r.data,-1,s,o,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,1!==s.length)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=r?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,s,r,o):o<r?o++:t.push(e),t.length===s)break}return o}_createTree(t){const e=new w(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,o,i){for(const n of t){const t=n*this.stride,a=e[t+b]>1;let h,l,c;if(a)h=I(e,t,this.clusterProps),l=e[t],c=e[t+1];else{const s=this.points[e[t+A]];h=s.properties;const[r,o]=s.geometry.coordinates;l=T(r),c=j(o)}const u={type:1,geometry:[[Math.round(this.options.extent*(l*o-s)),Math.round(this.options.extent*(c*o-r))]],tags:h};let p;p=a||this.options.generateId?e[t+A]:this.points[e[t+A]].id,void 0!==p&&(u.id=p),i.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:o,minPoints:i}=this.options,n=s/(r*Math.pow(2,e)),a=t.data,h=[],l=this.stride;for(let s=0;s<a.length;s+=l){if(a[s+2]<=e)continue;a[s+2]=e;const r=a[s],c=a[s+1],u=t.within(a[s],a[s+1],n),p=a[s+b];let m=p;for(const t of u){const s=t*l;a[s+2]>e&&(m+=a[s+b])}if(m>p&&m>=i){let t,i=r*p,n=c*p,d=-1;const g=((s/l|0)<<5)+(e+1)+this.points.length;for(const r of u){const h=r*l;if(a[h+2]<=e)continue;a[h+2]=e;const c=a[h+b];i+=a[h]*c,n+=a[h+1]*c,a[h+4]=g,o&&(t||(t=this._map(a,s,!0),d=this.clusterProps.length,this.clusterProps.push(t)),o(t,this._map(a,h)))}a[s+4]=g,h.push(i/m,n/m,1/0,g,-1,m),o&&h.push(d)}else{for(let t=0;t<l;t++)h.push(a[s+t]);if(m>1)for(const t of u){const s=t*l;if(!(a[s+2]<=e)){a[s+2]=e;for(let t=0;t<l;t++)h.push(a[s+t])}}}}return h}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+b]>1){const r=this.clusterProps[t[e+L]];return s?Object.assign({},r):r}const r=this.points[t[e+A]].properties,o=this.options.map(r);return s&&o===r?Object.assign({},o):o}}function Z(t,e,s){return{type:"Feature",id:t[e+A],properties:I(t,e,s),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),S(t[e+1])]}};var r}function I(t,e,s){const r=t[e+b],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,i=t[e+L],n=-1===i?{}:Object.assign({},s[i]);return Object.assign(n,{cluster:!0,cluster_id:t[e+A],point_count:r,point_count_abbreviated:o})}function T(t){return t/360+.5}function j(t){const e=Math.sin(t*Math.PI/180),s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return s<0?0:s>1?1:s}function S(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}class z extends u{constructor(t){var{maxZoom:s,radius:r=60}=t,o=e(t,["maxZoom","radius"]);super({maxZoom:s}),this.state={zoom:-1},this.superCluster=new O(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(t){let e=!1;const r={zoom:t.map.getZoom()};if(!f(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map((t=>{const e=s.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(e=!f(this.state,r)),this.state=r,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster(t){let{map:e}=t;return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,o]},properties:i}=t;if(i.cluster)return new r({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:o,lng:e}});const n=i.marker;return new r({markers:[n],position:s.getPosition(n)})}}class U{constructor(t,e){this.markers={sum:t.length};const s=e.map((t=>t.count)),r=s.reduce(((t,e)=>t+e),0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class B{render(t,e,r){let{count:o,position:i}=t;const n=`<svg fill="${o>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${o}</text>\n</svg>`,a=`Cluster of ${o} markers`,h=Number(google.maps.Marker.MAX_ZINDEX)+o;if(s.isAdvancedMarkerAvailable(r)){const t=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const e={map:r,position:i,zIndex:h,title:a,content:t};return new google.maps.marker.AdvancedMarkerElement(e)}const l={position:i,zIndex:h,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(n)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(l)}}class D{constructor(){!function(t,e){for(let s in e.prototype)t.prototype[s]=e.prototype[s]}(D,google.maps.OverlayView)}}var N;t.MarkerClustererEvents=void 0,(N=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",N.CLUSTERING_END="clusteringend",N.CLUSTER_CLICK="click";const F=(t,e,s)=>{s.fitBounds(e.bounds)};return t.AbstractAlgorithm=u,t.AbstractViewportAlgorithm=p,t.Cluster=r,t.ClusterStats=U,t.DefaultRenderer=B,t.GridAlgorithm=class extends p{constructor(t){var{maxDistance:s=4e4,gridSize:r=40}=t;super(e(t,["maxDistance","gridSize"])),this.clusters=[],this.state={zoom:-1},this.maxDistance=s,this.gridSize=r}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;const i={zoom:s.getZoom()};let n=!1;return this.state.zoom>=this.maxZoom&&i.zoom>=this.maxZoom||(n=!f(this.state,i)),this.state=i,s.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:n}:{clusters:this.cluster({markers:o(s,r,e,this.viewportPadding),map:s,mapCanvasProjection:r})}}cluster(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return this.clusters=[],e.forEach((t=>{this.addToClosestCluster(t,s,r)})),this.clusters}addToClosestCluster(t,e,o){let n=this.maxDistance,h=null;for(let e=0;e<this.clusters.length;e++){const r=this.clusters[e],o=a(r.bounds.getCenter().toJSON(),s.getPosition(t).toJSON());o<n&&(n=o,h=r)}if(h&&i(h.bounds,o,this.gridSize).contains(s.getPosition(t)))h.push(t);else{const e=new r({markers:[t]});this.clusters.push(e)}}},t.MarkerClusterer=class extends D{constructor(t){let{map:e,markers:s=[],algorithmOptions:r={},algorithm:o=new z(r),renderer:i=new B,onClusterClick:n=F}=t;super(),this.markers=[...s],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=n,e&&this.setMap(e)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach((t=>{this.addMarker(t,!0)})),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(s.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach((t=>{s=this.removeMarker(t,!0)||s})),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);const{clusters:r,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(o||null==o){const t=new Set;for(const e of r)1==e.markers.length&&t.add(e.markers[0]);const e=[];for(const r of this.clusters)null!=r.marker&&(1==r.markers.length?t.has(r.marker)||s.setMap(r.marker,null):e.push(r.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame((()=>e.forEach((t=>s.setMap(t,null)))))}google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach((t=>s.setMap(t,null))),this.clusters.forEach((t=>t.delete())),this.clusters=[]}renderClusters(){const e=new U(this.markers,this.clusters),r=this.getMap();this.clusters.forEach((o=>{1===o.markers.length?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e,r),o.markers.forEach((t=>s.setMap(t,null))),this.onClusterClick&&o.marker.addListener("click",(e=>{google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTER_CLICK,o),this.onClusterClick(e,o,r)}))),s.setMap(o.marker,r)}))}},t.MarkerUtils=s,t.NoopAlgorithm=class extends u{constructor(t){super(e(t,[]))}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return{clusters:this.cluster({markers:e,map:s,mapCanvasProjection:r}),changed:!1}}cluster(t){return this.noop(t)}},t.SuperClusterAlgorithm=z,t.SuperClusterViewportAlgorithm=class extends p{constructor(t){var{maxZoom:s,radius:r=60,viewportPadding:o=60}=t,i=e(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:s,viewportPadding:o}),this.superCluster=new O(Object.assign({maxZoom:this.maxZoom,radius:r},i)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const e={zoom:Math.round(t.map.getZoom()),view:n(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let r=!f(this.state,e);if(!f(t.markers,this.markers)){r=!0,this.markers=[...t.markers];const e=this.markers.map((t=>{const e=s.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(e)}return r&&(this.clusters=this.cluster(t),this.state=e),{clusters:this.clusters,changed:r}}cluster(t){let{map:e,mapCanvasProjection:s}=t;const r={zoom:Math.round(e.getZoom()),view:n(e.getBounds(),s,this.viewportPadding)};return this.superCluster.getClusters(r.view,r.zoom).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,o]},properties:i}=t;if(i.cluster)return new r({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:o,lng:e}});const n=i.marker;return new r({markers:[n],position:s.getPosition(n)})}},t.defaultOnClusterClickHandler=F,t.distanceBetweenPoints=a,t.extendBoundsToPaddedViewport=i,t.extendPixelBounds=l,t.filterMarkersToPaddedViewport=o,t.getPaddedViewport=n,t.noop=m,t.pixelBoundsToLatLngBounds=c,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
19136
19385
|
//# sourceMappingURL=index.min.js.map
|
|
19137
19386
|
|