@bmlt-enabled/croutonjs 4.3.1 → 4.3.3

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-map.js CHANGED
@@ -1,127 +1,137 @@
1
1
  function MapDelegate(config) {
2
- const shadowUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarkerS.png"
2
+ const shadowUrl = config.BMLTPlugin_images
3
+ ? config.BMLTPlugin_images + "/NAMarkerS.png"
3
4
  : "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+6YK1BBN4fPIcBfCIMQ8fuE85nggmsR9A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sZA7frju5xu9Cm9+Hhn8D5kmoQVPTsZaP+Eyt1R2rA1HfQ15ovuD127wmO8jjQ1MEqyBpUImraYVgk8UHZziK+UFh8WSEY+GqCGazg21+tpi3IDvXJF3jnPXRnithNcikIVdQBwFsLgYl0pcU39kEBetUBOM/aZ6/XyWEnKC9+nXU4yeKowKqC9KdmXONa86F7JS5f1jjWw0/ig3R1n+UMIxAvUTzXoQKk+4E+NFtrZzavDkHEqQarme6q+0mt/8BTRrNnwf6/EMAAAAASUVORK5CYII=";
4
- let iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarker.png"
5
+ let iconUrl = config.BMLTPlugin_images
6
+ ? config.BMLTPlugin_images + "/NAMarker.png"
5
7
  : "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/ZduFt27HhHJiYuiYhIOJyV3t60nDmTkXg8LyIix44lxe0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fadQC+gaMxaCEZXwKpGuNW+ebRigmi0QCiUJxjMEo+bjI3laW9PEovl7OM/Cuz5O0y12S/+45rzwerT8Fs/1ABuwDHbmRE7ROaMPJADdiXgxL3A+RkwbR54Eq6OgdoCq+3Pc+mZqWUmgWE/jwOHdgLH5hY8HxxgAAY9cNtG8NlTtHngUuyEMADs6oBM23yghcAB8x8w1AyNddZ1ODcBNnDeVsfuMIRabOdmwDEgdRquPgLry8DJzK/FLM8G8Jc8HG8F/rXA/t0QHGACLg2CowVWqtZUldnLoRf4wwtgHpmzCTcNDhCCT0247X5LPTN8XwZ2vQMTv14I9H8xBfyd8CeBvwn0CHx/BPD/P6BzzQ/3R+CQwDYB5Sezib8Sc2yGbwlUHviqKp5HD78H6m424N/MV8HqLH5ZPAAAACV0RVh0Y3JlYXRlLWRhdGUAMjAxMS0wMS0wNlQwMzoyNDoxMyswMDowMJsWpgAAAAAldEVYdG1vZGlmeS1kYXRlADIwMTEtMDEtMDZUMDM6MjQ6MTMrMDA6MDDEp9A0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
6
8
 
7
- var g_icon_image_single = L.icon({
9
+ var g_icon_image_single = L.icon({
8
10
  iconUrl: iconUrl,
9
11
  shadowUrl: shadowUrl,
10
- iconSize: [23, 32], // size of the icon
11
- shadowSize: [43, 32], // size of the shadow
12
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
13
- shadowAnchor: [12, 32], // the same for the shadow
14
- popupAnchor: [0, -32] // point from which the popup should open relative to the iconAnchor
12
+ iconSize: [23, 32], // size of the icon
13
+ shadowSize: [43, 32], // size of the shadow
14
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
15
+ shadowAnchor: [12, 32], // the same for the shadow
16
+ popupAnchor: [0, -32], // point from which the popup should open relative to the iconAnchor
15
17
  });
16
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarkerG.png"
18
+ iconUrl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PgogICA8ZGM6Y3JlYXRvcj4KICAgIDxyZGY6U2VxPgogICAgIDxyZGY6bGkvPgogICAgPC9yZGY6U2VxPgogICA8L2RjOmNyZWF0b3I+CiAgIDxkYzp0aXRsZT4KICAgIDxyZGY6QWx0PgogICAgIDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+TkFNYXJrZXI8L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcFJpZ2h0czpVc2FnZVRlcm1zPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ii8+CiAgICA8L3JkZjpBbHQ+CiAgIDwveG1wUmlnaHRzOlVzYWdlVGVybXM+CiAgIDxJcHRjNHhtcENvcmU6Q3JlYXRvckNvbnRhY3RJbmZvCiAgICBJcHRjNHhtcENvcmU6Q2lBZHJFeHRhZHI9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckNpdHk9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkclJlZ2lvbj0iIgogICAgSXB0YzR4bXBDb3JlOkNpQWRyUGNvZGU9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckN0cnk9IiIKICAgIElwdGM0eG1wQ29yZTpDaVRlbFdvcms9IiIKICAgIElwdGM0eG1wQ29yZTpDaUVtYWlsV29yaz0iIgogICAgSXB0YzR4bXBDb3JlOkNpVXJsV29yaz0iIi8+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7HRMckAAAG20lEQVR42qyWeXBV9RXHP/fet+QlL+QlPAgkeZIFxAWxqWBVagVKYtQUUTvtSIeKLYNY24pY/MPptA50nI4OnXbGzojVoSLNdFGJ6ci0MRSo1BZcILgQgglGSdJsL9vL2+679/bcBasVpON4Zn7v3d/2Pef3Pcvvp/DpskjaLQFYmq9QLf++nIWVhP40vC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mCC";
18
21
  var g_icon_image_multi = L.icon({
19
22
  iconUrl: iconUrl,
20
23
  shadowUrl: shadowUrl,
21
- iconSize: [23, 32], // size of the icon
22
- shadowSize: [43, 32], // size of the shadow
23
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
24
- shadowAnchor: [12, 32], // the same for the shadow
25
- popupAnchor: [0, -32] // point from which the popup should open relative to the iconAnchor
24
+ iconSize: [23, 32], // size of the icon
25
+ shadowSize: [43, 32], // size of the shadow
26
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
27
+ shadowAnchor: [12, 32], // the same for the shadow
28
+ popupAnchor: [0, -32], // point from which the popup should open relative to the iconAnchor
26
29
  });
27
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarkerSel.png"
30
+ iconUrl = config.BMLTPlugin_images
31
+ ? config.BMLTPlugin_images + "/NAMarkerSel.png"
28
32
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA/JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wUmlnaHRzPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvcmlnaHRzLyIgeG1sbnM6eG1wT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KPsMoLVR3S8arxGwf/VGDD/JuCitdh9fKYyg82nU8ulY5dxzurhQh15fAut3HMT6w4+p3LvesWg+X34VpuEFcosZkoBbL/ODfkbt1/SiP2/i/8nwAAca+6jkhGCHgAAAABJRU5ErkJggg==";
29
33
  var g_icon_image_selected = L.icon({
30
34
  iconUrl: iconUrl,
31
35
  shadowUrl: shadowUrl,
32
- iconSize: [23, 32], // size of the icon
33
- shadowSize: [43, 32], // size of the shadow
34
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
35
- shadowAnchor: [12, 32], // the same for the shadow
36
- popupAnchor: [12, -32] // point from which the popup should open relative to the iconAnchor
37
- });
38
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/SearchPoint.png"
36
+ iconSize: [23, 32], // size of the icon
37
+ shadowSize: [43, 32], // size of the shadow
38
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
39
+ shadowAnchor: [12, 32], // the same for the shadow
40
+ popupAnchor: [12, -32], // point from which the popup should open relative to the iconAnchor
41
+ });
42
+ iconUrl = config.BMLTPlugin_images
43
+ ? config.BMLTPlugin_images + "/SearchPoint.png"
39
44
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAABGdBTUEAALGPC/xhBQAAAHhlWElmTU0AKgAAAAgABAESAAMAAAABAAEAAAEaAAUAAAABAAAAPgEbAAUAAAABAAAARodpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABegAwAEAAAAAQAAACEAAAAAZxgyOAAAAAlwSFlzAAALEwAACxMBAJqcGAAAApJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5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OYhQ0JhkcHDQRFFcXGzyAmoV9G+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=";
40
45
  var g_icon_image_searchpoimt = L.icon({
41
46
  iconUrl: iconUrl,
42
47
  shadowUrl: shadowUrl,
43
- iconSize: [23, 32], // size of the icon
44
- shadowSize: [43, 32], // size of the shadow
45
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
46
- shadowAnchor: [12, 32], // the same for the shadow
47
- popupAnchor: [12, -32] // point from which the popup should open relative to the iconAnchor
48
- });
49
- var gAllMarkers = []; ///< Holds all the markers.
48
+ iconSize: [23, 32], // size of the icon
49
+ shadowSize: [43, 32], // size of the shadow
50
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
51
+ shadowAnchor: [12, 32], // the same for the shadow
52
+ popupAnchor: [12, -32], // point from which the popup should open relative to the iconAnchor
53
+ });
54
+ var gAllMarkers = []; ///< Holds all the markers.
50
55
  var gMainMap;
51
56
  var gTileLayer;
52
57
  var gClusterLayer = null;
53
58
  var gSearchPointMarker = false;
54
59
  var gOpenMarker = false;
55
60
  var gDiv = null;
56
- function createMap(inDiv, inCenter, inHidden = false) {
57
- if (! inCenter ) return null;
58
- gDiv = inDiv;
59
- if ( inHidden ) {
60
- gDiv.style.height = 'auto';
61
- gDiv.style.marginBottom = '10px';
61
+ function createMap(inDiv, inCenter, inHidden = false) {
62
+ if (!inCenter) return null;
63
+ gDiv = inDiv;
64
+ if (inHidden) {
65
+ gDiv.style.height = "auto";
66
+ gDiv.style.marginBottom = "10px";
62
67
  gMainMap = null;
63
68
  return gDiv;
64
69
  }
65
70
  myOptions = {
66
- 'minZoom': config.minZoom,
67
- 'maxZoom': config.maxZoom,
68
- 'doubleClickZoom' : false,
69
- 'scrollWheelZoom' : false
71
+ minZoom: config.minZoom,
72
+ maxZoom: config.maxZoom,
73
+ doubleClickZoom: false,
74
+ scrollWheelZoom: false,
70
75
  };
71
76
  myOptions = Object.assign(myOptions, {
72
- 'center': new L.latLng ( inCenter.latitude, inCenter.longitude ),
73
- 'zoom': inCenter.zoom});
74
- var pixel_width = inDiv.offsetWidth;
77
+ center: new L.latLng(inCenter.latitude, inCenter.longitude),
78
+ zoom: inCenter.zoom,
79
+ });
80
+ var pixel_width = inDiv.offsetWidth;
75
81
  if (pixel_width == 0) {
76
82
  pixel_width = inDiv.parentNode.offsetWidth;
77
83
  }
78
- var pixel_height = inDiv.offsetHeight;
84
+ var pixel_height = parseInt(
85
+ jQuery(inDiv).css("height").replace("px", ""),
86
+ );
79
87
  if (pixel_height == 0) {
80
88
  pixel_height = pixel_width;
81
89
  }
82
- if (pixel_height > pixel_width*1.4) {
83
- inDiv.style.height = (pixel_width*1.6)+'px';
90
+ if (pixel_height > pixel_width) {
91
+ jQuery(inDiv).css("height", pixel_width + "px");
84
92
  }
85
- gMainMap = new L.Map ( inDiv, myOptions );
86
- gTileLayer = L.tileLayer(config.tileUrl,config.tileOptions).addTo(gMainMap);
87
- gMainMap.zoomControl.setPosition('bottomright');
88
- gMainMap.on('moveend',function() {
93
+ gMainMap = new L.Map(inDiv, myOptions);
94
+ gTileLayer = L.tileLayer(config.tileUrl, config.tileOptions).addTo(
95
+ gMainMap,
96
+ );
97
+ gMainMap.zoomControl.setPosition("bottomright");
98
+ gMainMap.on("moveend", function () {
89
99
  gTileLayer.redraw();
90
100
  });
91
- return gMainMap;
92
- }
93
- function addListener(ev,f,once) {
101
+ return gMainMap;
102
+ }
103
+ function addListener(ev, f, once) {
94
104
  if (!gMainMap) return;
95
- if (ev=='idle') {
96
- ev = 'moveend';
105
+ if (ev == "idle") {
106
+ ev = "moveend";
97
107
  }
98
- if (ev=='dragstart') {
99
- ev = 'movestart';
108
+ if (ev == "dragstart") {
109
+ ev = "movestart";
100
110
  }
101
- if (ev=='dragend') {
102
- ev = 'moveend';
111
+ if (ev == "dragend") {
112
+ ev = "moveend";
103
113
  }
104
- if (once) {
114
+ if (once) {
105
115
  gMainMap.once(ev, f);
106
116
  } else {
107
117
  gMainMap.on(ev, f);
108
118
  }
109
- return {'event': ev, 'f': f};
110
- }
119
+ return { event: ev, f: f };
120
+ }
111
121
  function removeListener(o) {
112
122
  if (!gMainMap) return;
113
123
  gMainMap.off(o.event, o.f);
114
124
  }
115
- function flyToFixedZoom(position, zoomLevel, extra=null) {
125
+ function flyToFixedZoom(position, zoomLevel, extra = null) {
116
126
  if (!gMainMap) return;
117
127
 
118
128
  const latlng = L.latLng(position.lat, position.lng);
119
- gMainMap.once('moveend', function(ev) {
129
+ gMainMap.once("moveend", function (ev) {
120
130
  if (gMainMap.getZoom() != zoomLevel) {
121
- gMainMap.once('zoomend',function() {
131
+ gMainMap.once("zoomend", function () {
122
132
  gMainMap.invalidateSize();
123
133
  if (extra) {
124
- gMainMap.once('load moveend', extra);
134
+ gMainMap.once("load moveend", extra);
125
135
  }
126
136
  });
127
137
  gMainMap.setZoom(zoomLevel);
@@ -131,12 +141,15 @@ function MapDelegate(config) {
131
141
  });
132
142
  gMainMap.flyTo(latlng, zoomLevel);
133
143
  }
134
- function clearAllMarkers ( )
135
- {
144
+ function clearAllMarkers() {
136
145
  if (!gMainMap) return;
137
- gAllMarkers && gAllMarkers.forEach((m) => {m.marker.closePopup(); gMainMap.removeLayer(m.marker)});
146
+ gAllMarkers &&
147
+ gAllMarkers.forEach((m) => {
148
+ m.marker.closePopup();
149
+ gMainMap.removeLayer(m.marker);
150
+ });
138
151
  gAllMarkers = [];
139
- };
152
+ }
140
153
  function getZoom() {
141
154
  if (!gMainMap) return null;
142
155
  return gMainMap.getZoom();
@@ -146,285 +159,410 @@ function MapDelegate(config) {
146
159
  }
147
160
  function webMercatorToLatLng(point, zoom) {
148
161
  const latLng = croutonMap.webMercatorToLatLng(point, zoom);
149
- return L.latLng(latLng.lat, latLng.lng);
162
+ return L.latLng(latLng.lat, latLng.lng);
150
163
  }
151
164
  function calculateBounds(center, zoom, width, height) {
152
165
  const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
153
- const northeastWebMercator = {x: centerPoint.x-width/2, y: centerPoint.y-height/2};
154
- const southwestWebMercator = {x: centerPoint.x+width/2, y: centerPoint.y+height/2};
155
- return L.latLngBounds(webMercatorToLatLng(southwestWebMercator, zoom), webMercatorToLatLng(northeastWebMercator, zoom));
156
- }
157
- function calcOffsetWidth(gDiv) {
158
- let ret = gDiv.offsetWidth;
159
- if (ret === 0) ret = gDiv.parentElement.offsetWidth;
160
- return ret;
161
- }
166
+ const northeastWebMercator = {
167
+ x: centerPoint.x - width / 2,
168
+ y: centerPoint.y - height / 2,
169
+ };
170
+ const southwestWebMercator = {
171
+ x: centerPoint.x + width / 2,
172
+ y: centerPoint.y + height / 2,
173
+ };
174
+ return L.latLngBounds(
175
+ webMercatorToLatLng(southwestWebMercator, zoom),
176
+ webMercatorToLatLng(northeastWebMercator, zoom),
177
+ );
178
+ }
179
+ function withinInscribedCircle(center, point, zoom, width, height) {
180
+ const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
181
+ const meetingPoint = croutonMap.latLngToWebMercator(point, zoom);
182
+ const radius = Math.min(width, height) / 2;
183
+ const distance = Math.sqrt(
184
+ Math.pow(centerPoint.x - meetingPoint.x, 2) +
185
+ Math.pow(centerPoint.y - meetingPoint.y, 2),
186
+ );
187
+ return distance <= radius;
188
+ }
189
+ function calcOffsetWidth(gDiv) {
190
+ let ret = gDiv.offsetWidth;
191
+ if (ret === 0) ret = gDiv.parentElement.offsetWidth;
192
+ return ret;
193
+ }
162
194
  function calculateBoundsFromCenterAndZoom(center, zoomLevel) {
163
- const mapWidth = calcOffsetWidth(gDiv);
164
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
165
- return calculateBounds(center, zoomLevel, mapWidth, mapHeight);
166
- }
167
- function getZoomAdjust(filterMeetings,zoomLevel=gMainMap.getZoom(), center=gMainMap.getCenter()) {
195
+ const mapWidth = calcOffsetWidth(gDiv);
196
+ const mapHeight = parseInt(
197
+ jQuery(gDiv).css("height").replace("px", ""),
198
+ );
199
+ return calculateBounds(center, zoomLevel, mapWidth, mapHeight);
200
+ }
201
+ function getZoomAdjust(
202
+ filterMeetings,
203
+ zoomLevel = gMainMap.getZoom(),
204
+ center = gMainMap.getCenter(),
205
+ closestMeeting = null,
206
+ ) {
168
207
  if (!gMainMap) return 12;
208
+ if (config.map_search && isFilterVisible()) return zoomLevel;
169
209
  const mapWidth = calcOffsetWidth(gDiv);
170
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
171
- ret = zoomLevel;
172
- if (config.map_search && isFilterVisible()) return ret;
210
+ const mapHeight = parseInt(
211
+ jQuery(gDiv).css("height").replace("px", ""),
212
+ );
213
+ let ret = zoomLevel;
173
214
  var bounds = calculateBounds(center, ret, mapWidth, mapHeight);
174
- while(filterMeetings(bounds, center).length==0 && ret>config.minZoom) {
175
- ret -= 1;
176
- bounds = calculateBounds(center, ret, mapWidth, mapHeight);
215
+ if (closestMeeting) {
216
+ while (
217
+ !withinInscribedCircle(
218
+ center,
219
+ closestMeeting,
220
+ ret,
221
+ mapWidth,
222
+ mapHeight,
223
+ ) &&
224
+ ret > config.minZoom
225
+ ) {
226
+ ret -= 1;
227
+ }
228
+ } else {
229
+ while (
230
+ filterMeetings(bounds, center).length == 0 &&
231
+ ret > config.minZoom
232
+ ) {
233
+ ret -= 1;
234
+ bounds = calculateBounds(center, ret, mapWidth, mapHeight);
235
+ }
236
+ }
237
+ // If we didn't zoom out, zoom in if it doesn't lose meetings
238
+ if (ret == zoomLevel) {
239
+ let meetingsInBounds = filterMeetings(bounds, center).length;
240
+ if (meetingsInBounds > 0) {
241
+ do {
242
+ ret = ret + 1;
243
+ if (ret > config.maxZoom) break;
244
+ var bounds = calculateBounds(
245
+ center,
246
+ ret,
247
+ mapWidth,
248
+ mapHeight,
249
+ );
250
+ } while (
251
+ filterMeetings(bounds, center).length === meetingsInBounds
252
+ );
253
+ ret = ret - 1;
254
+ }
177
255
  }
178
256
  return ret;
179
257
  }
180
258
  function markSearchPoint(inCoords) {
181
259
  if (!gMainMap) return;
182
260
  if (gSearchPointMarker) gSearchPointMarker.remove();
183
- gSearchPointMarker = L.marker(inCoords, {icon: g_icon_image_searchpoimt});
261
+ gSearchPointMarker = L.marker(inCoords, {
262
+ icon: g_icon_image_searchpoimt,
263
+ });
184
264
  gSearchPointMarker.addTo(gMainMap);
185
265
  }
186
- function createMarker ( inCoords, ///< The long/lat for the marker.
187
- multi, ///< Flag if marker has multiple meetings
188
- in_title, ///< The tooltip
189
- )
190
- {
191
- if (!gMainMap) return;
192
- var in_main_icon = (multi ? g_icon_image_multi : g_icon_image_single);
266
+ function createMarker(
267
+ inCoords, ///< The long/lat for the marker.
268
+ multi, ///< Flag if marker has multiple meetings
269
+ in_title, ///< The tooltip
270
+ ) {
271
+ if (!gMainMap) return;
272
+ var in_main_icon = multi ? g_icon_image_multi : g_icon_image_single;
193
273
 
194
- var marker = L.marker(inCoords, {icon: in_main_icon, title: in_title})
195
- marker.isMulti = multi;
196
- if (gClusterLayer) gClusterLayer.addLayer(marker);
197
- else marker.addTo(gMainMap);
274
+ var marker = L.marker(inCoords, {
275
+ icon: in_main_icon,
276
+ title: in_title,
277
+ });
278
+ marker.isMulti = multi;
279
+ if (gClusterLayer) gClusterLayer.addLayer(marker);
280
+ else marker.addTo(gMainMap);
198
281
 
199
- return marker;
200
- }
201
- function bindPopup(marker, in_html, in_ids, openedMarker) {
202
- if (!in_html) return;
203
- let highlightRow = function(target) {
204
- const id = target.id.split('-')[1];
205
- gOpenMarker = id;
206
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
207
- jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
208
- if (typeof crouton != 'undefined') crouton.dayTabFromId(id);
209
- }
210
- marker.bindPopup(in_html);
211
- marker.on('popupopen', function(e) {
212
- if (openedMarker && marker.getPopup().getContent().includes("panel-"+openedMarker)) {
213
- // I want to just do this:
214
- //jQuery("#panel-"+openedMarker).prop("checked", true);
215
- // But for some reason, leaflet makes a copy of the popup, so the ID is not unique....
216
- jQuery("input[type=radio][name=panel]").filter(function() {
217
- return jQuery(this).attr('id')=="panel-"+openedMarker})
218
- .each(function(index,value) {
219
- jQuery(this).prop("checked", true);
282
+ return marker;
283
+ }
284
+ function bindPopup(marker, in_html, in_ids, openedMarker) {
285
+ if (!in_html) return;
286
+ let highlightRow = function (target) {
287
+ const id = target.id.split("-")[1];
288
+ gOpenMarker = id;
289
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
290
+ jQuery("#meeting-data-row-" + id + " > td").addClass(
291
+ "rowHighlight",
292
+ );
293
+ if (typeof crouton != "undefined") crouton.dayTabFromId(id);
294
+ };
295
+ marker.bindPopup(in_html);
296
+ marker.on("popupopen", function (e) {
297
+ if (
298
+ openedMarker &&
299
+ marker
300
+ .getPopup()
301
+ .getContent()
302
+ .includes("panel-" + openedMarker)
303
+ ) {
304
+ // I want to just do this:
305
+ //jQuery("#panel-"+openedMarker).prop("checked", true);
306
+ // But for some reason, leaflet makes a copy of the popup, so the ID is not unique....
307
+ jQuery("input[type=radio][name=panel]")
308
+ .filter(function () {
309
+ return (
310
+ jQuery(this).attr("id") == "panel-" + openedMarker
311
+ );
312
+ })
313
+ .each(function (index, value) {
314
+ jQuery(this).prop("checked", true);
315
+ });
316
+ }
317
+ marker.setIcon(g_icon_image_selected);
318
+ gMainMap.on("zoomstart", function () {
319
+ marker.closePopup();
320
+ });
321
+ jQuery("input[type=radio][name=panel]:checked").each(
322
+ function (index, target) {
323
+ highlightRow(target);
324
+ },
325
+ );
326
+ jQuery("input[type=radio][name=panel]").change(function () {
327
+ highlightRow(this);
220
328
  });
221
- }
222
- marker.setIcon(g_icon_image_selected);
223
- gMainMap.on('zoomstart',function(){
224
- marker.closePopup();
225
329
  });
226
- jQuery("input[type=radio][name=panel]:checked").each(function(index, target) {
227
- highlightRow(target);
228
- });
229
- jQuery('input[type=radio][name=panel]').change(function() {
230
- highlightRow(this);
231
- });
232
- });
233
- marker.on('popupclose', function(e) {
234
- gOpenMarker = false;
235
- marker.setIcon(marker.isMulti ? g_icon_image_multi : g_icon_image_single);
236
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
237
- });
238
- if (openedMarker && in_ids.includes(parseInt(openedMarker))) {
239
- marker.openPopup();
240
- marker.once('add', function() {
241
- if (!marker.isPopupOpen()) marker.openPopup();
330
+ marker.on("popupclose", function (e) {
331
+ gOpenMarker = false;
332
+ marker.setIcon(
333
+ marker.isMulti ? g_icon_image_multi : g_icon_image_single,
334
+ );
335
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
242
336
  });
337
+ if (openedMarker && in_ids.includes(parseInt(openedMarker))) {
338
+ marker.openPopup();
339
+ marker.once("add", function () {
340
+ if (!marker.isPopupOpen()) marker.openPopup();
341
+ });
342
+ }
343
+ gAllMarkers.push({ ids: in_ids, marker: marker });
243
344
  }
244
- gAllMarkers.push( {ids: in_ids, marker: marker} );
245
- }
246
- function addMarkerCallback(marker, cb, in_ids) {
247
- if (cb) marker.on('click', function() {
248
- cb(in_ids);
249
- });
250
- gAllMarkers.push( {ids: in_ids, marker: marker} );
251
- }
252
- function getOpenMarker() {
253
- return gOpenMarker;
254
- }
255
- function openMarker(id) {
256
- if (!gMainMap) return;
257
- marker = gAllMarkers.find((m) => m.ids.includes(id));
258
- if (marker) {
259
- marker.marker.openPopup();
260
- jQuery("#panel-"+id).prop('checked', true);
261
- if (typeof crouton != 'undefined') crouton.dayTabFromId(id);
262
- }
263
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
264
- jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
265
- }
266
- function addControl(div,pos,cb) {
267
- if (!div) return;
268
- if (!gMainMap) {
269
- gDiv.appendChild(div);
270
- return;
271
- }
272
- var ControlClass = L.Control.extend({
273
- onAdd: function (map) {
345
+ function addMarkerCallback(marker, cb, in_ids) {
346
+ if (cb)
347
+ marker.on("click", function () {
348
+ cb(in_ids);
349
+ });
350
+ gAllMarkers.push({ ids: in_ids, marker: marker });
351
+ }
352
+ function getOpenMarker() {
353
+ return gOpenMarker;
354
+ }
355
+ function openMarker(id) {
356
+ if (!gMainMap) return;
357
+ marker = gAllMarkers.find((m) => m.ids.includes(id));
358
+ if (marker) {
359
+ marker.marker.openPopup();
360
+ jQuery("#panel-" + id).prop("checked", true);
361
+ if (typeof crouton != "undefined") crouton.dayTabFromId(id);
362
+ }
363
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
364
+ jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
365
+ }
366
+ function addControl(div, pos, cb) {
367
+ if (!div) return;
368
+ if (!gMainMap) {
369
+ gDiv.appendChild(div);
370
+ return;
371
+ }
372
+ var ControlClass = L.Control.extend({
373
+ onAdd: function (map) {
274
374
  return div;
275
375
  },
276
- onRemove: function(map) {
376
+ onRemove: function (map) {
277
377
  // Nothing to do here
278
- }
378
+ },
279
379
  });
280
- var controlConstructor = function(opts) {
380
+ var controlConstructor = function (opts) {
281
381
  return new ControlClass(opts);
282
- }
382
+ };
283
383
  if (cb) {
284
384
  const observer = new MutationObserver(function (records) {
285
- records.forEach(record => {
286
- record.addedNodes.forEach(n => {
385
+ records.forEach((record) => {
386
+ record.addedNodes.forEach((n) => {
287
387
  if (n === div) {
288
388
  observer.disconnect();
289
389
  cb();
290
390
  }
291
391
  });
292
- })
392
+ });
293
393
  });
294
- observer.observe(document, {childList: true, subtree: true});
394
+ observer.observe(document, { childList: true, subtree: true });
295
395
  }
296
396
  controlConstructor({ position: pos }).addTo(gMainMap);
297
- }
298
- // Low level GeoCoding
397
+ }
398
+ // Low level GeoCoding
299
399
  function getJSON(url, params, callback) {
300
400
  var xmlHttp = new XMLHttpRequest();
301
- xmlHttp.onreadystatechange = function() {
302
- if (xmlHttp.readyState !== 4) {
303
- return;
304
- }
305
- var message;
306
- if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {
307
- message = '';
308
- } else if (typeof xmlHttp.response === 'string') {
309
- // IE doesn't parse JSON responses even with responseType: 'json'.
310
- try {
311
- message = JSON.parse(xmlHttp.response);
312
- } catch (e) {
313
- // Not a JSON response
314
- message = xmlHttp.response;
315
- }
316
- } else {
317
- message = xmlHttp.response;
318
- }
319
- callback(message);
320
- };
321
- xmlHttp.open('GET', url + getParamString(params), true);
322
- xmlHttp.responseType = 'json';
323
- xmlHttp.setRequestHeader('Accept', 'application/json');
324
- xmlHttp.setRequestHeader('Accept', '*/*');
325
- xmlHttp.send(null);
326
- };
401
+ xmlHttp.onreadystatechange = function () {
402
+ if (xmlHttp.readyState !== 4) {
403
+ return;
404
+ }
405
+ var message;
406
+ if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {
407
+ message = "";
408
+ } else if (typeof xmlHttp.response === "string") {
409
+ // IE doesn't parse JSON responses even with responseType: 'json'.
410
+ try {
411
+ message = JSON.parse(xmlHttp.response);
412
+ } catch (e) {
413
+ // Not a JSON response
414
+ message = xmlHttp.response;
415
+ }
416
+ } else {
417
+ message = xmlHttp.response;
418
+ }
419
+ callback(message);
420
+ };
421
+ xmlHttp.open("GET", url + getParamString(params), true);
422
+ xmlHttp.responseType = "json";
423
+ xmlHttp.setRequestHeader("Accept", "application/json");
424
+ xmlHttp.setRequestHeader("Accept", "*/*");
425
+ xmlHttp.send(null);
426
+ }
327
427
  function getParamString(obj, existingUrl, uppercase) {
328
428
  var params = [];
329
429
  for (var i in obj) {
330
- var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);
331
- var value = obj[i];
332
- if (!L.Util.isArray(value)) {
333
- params.push(key + '=' + encodeURIComponent(value));
334
- } else {
335
- for (var j = 0; j < value.length; j++) {
336
- params.push(key + '=' + encodeURIComponent(value[j]));
430
+ var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);
431
+ var value = obj[i];
432
+ if (!L.Util.isArray(value)) {
433
+ params.push(key + "=" + encodeURIComponent(value));
434
+ } else {
435
+ for (var j = 0; j < value.length; j++) {
436
+ params.push(key + "=" + encodeURIComponent(value[j]));
437
+ }
337
438
  }
338
- }
339
439
  }
340
- return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');
440
+ return (
441
+ (!existingUrl || existingUrl.indexOf("?") === -1 ? "?" : "&") +
442
+ params.join("&")
443
+ );
341
444
  }
342
445
  function geocode(query, params, cb) {
343
446
  var serviceUrl = config.nominatimUrl;
344
- if (!serviceUrl) serviceUrl = 'https://nominatim.openstreetmap.org/';
447
+ if (!serviceUrl) serviceUrl = "https://nominatim.openstreetmap.org/";
345
448
  getJSON(
346
- serviceUrl + 'search',
347
- L.extend(
348
- {
349
- q: query,
350
- limit: 5,
351
- format: 'json',
352
- addressdetails: 1
353
- },
354
- params
355
- ),
356
- L.bind(function(data) {
357
- var results = [];
358
- if (data && data.length) {
359
- for (var i = data.length - 1; i >= 0; i--) {
360
- var bbox = data[i].boundingbox;
361
- for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);
362
- results[i] = {
363
- icon: data[i].icon,
364
- name: data[i].display_name,
365
- bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),
366
- center: L.latLng(data[i].lat, data[i].lon),
367
- properties: data[i]
368
- };
449
+ serviceUrl + "search",
450
+ L.extend(
451
+ {
452
+ q: query,
453
+ limit: 5,
454
+ format: "json",
455
+ addressdetails: 1,
456
+ layer: "address",
457
+ },
458
+ params,
459
+ ),
460
+ L.bind(function (data) {
461
+ if (data && data.length) {
462
+ results = data.reduce(function (carry, d) {
463
+ if (
464
+ !carry.find((item) => item.name === d.display_name)
465
+ ) {
466
+ var bbox = d.boundingbox.map((c) => parseFloat(c));
467
+ carry.push({
468
+ name: d.display_name,
469
+ bbox: L.latLngBounds(
470
+ [bbox[0], bbox[2]],
471
+ [bbox[1], bbox[3]],
472
+ ),
473
+ center: L.latLng(d.lat, d.lon),
474
+ properties: d,
475
+ });
476
+ }
477
+ return carry;
478
+ }, []);
479
+ cb(results);
480
+ } else {
481
+ alert(crouton.localization.getWord("address_lookup_fail"));
369
482
  }
370
- cb(results);
371
- } else {
372
- alert ( crouton.localization.getWord("address_lookup_fail") );
373
- }
374
- }, this)
483
+ }, this),
375
484
  );
376
- };
485
+ }
377
486
  function getGeocodingChoices(in_geocode_response) {
378
- if (!Array.isArray(in_geocode_response)) return [];
379
- return in_geocode_response.map((r) => r.name);
487
+ if (!Array.isArray(in_geocode_response)) return [];
488
+ return in_geocode_response.map((r) => r.name);
380
489
  }
381
- function getZoomAdjustedBounds(center, filterMeetings, zoomLevel) {
490
+ function getZoomAdjustedBounds(
491
+ center,
492
+ filterMeetings,
493
+ zoomLevel,
494
+ closestMeeting = null,
495
+ ) {
382
496
  const mapWidth = calcOffsetWidth(gDiv);
383
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
497
+ const mapHeight = parseInt(
498
+ jQuery(gDiv).css("height").replace("px", ""),
499
+ );
384
500
  if (center) {
385
- const zoom = getZoomAdjust(filterMeetings, zoomLevel, center);
501
+ const zoom = getZoomAdjust(
502
+ filterMeetings,
503
+ zoomLevel,
504
+ center,
505
+ closestMeeting,
506
+ );
386
507
  const bounds = calculateBounds(center, zoom, mapWidth, mapHeight);
387
- const ret = {"center": center, "bounds": bounds, "zoom": zoom};
508
+ const ret = { center: center, bounds: bounds, zoom: zoom };
388
509
  return ret;
389
510
  } else {
390
- alert ( crouton.localization.getWord("address_lookup_fail") );
511
+ alert(crouton.localization.getWord("address_lookup_fail"));
391
512
  return null;
392
513
  }
393
514
  }
394
- function getGeocodeCenterAndBounds (in_geocode_response, i=0) {
395
- if ( in_geocode_response && in_geocode_response[i] ) {
396
- return {
397
- center: {lat: in_geocode_response[i].center.lat, lng: in_geocode_response[i].center.lng},
398
- southWest: {lat: in_geocode_response[i].bbox.getSouthWest().lat, lng: in_geocode_response[i].bbox.getSouthWest().lng},
399
- northEast: {lat: in_geocode_response[i].bbox.getNorthEast().lat, lng: in_geocode_response[i].bbox.getNorthEast().lng},
400
- };
401
- } else {
402
- alert ( crouton.localization.getWord("address_lookup_fail") );
403
- };
404
- };
405
- function callGeocoder(in_loc, callback) {
515
+ function getGeocodeCenterAndBounds(in_geocode_response, i = 0) {
516
+ if (in_geocode_response && in_geocode_response[i]) {
517
+ return {
518
+ center: {
519
+ lat: in_geocode_response[i].center.lat,
520
+ lng: in_geocode_response[i].center.lng,
521
+ },
522
+ southWest: {
523
+ lat: in_geocode_response[i].bbox.getSouthWest().lat,
524
+ lng: in_geocode_response[i].bbox.getSouthWest().lng,
525
+ },
526
+ northEast: {
527
+ lat: in_geocode_response[i].bbox.getNorthEast().lat,
528
+ lng: in_geocode_response[i].bbox.getNorthEast().lng,
529
+ },
530
+ };
531
+ } else {
532
+ alert(crouton.localization.getWord("address_lookup_fail"));
533
+ }
534
+ }
535
+ function callGeocoder(in_loc, callback) {
406
536
  geoCodeParams = {};
407
- if (config.region && config.region.trim() !== '') {
537
+ if (config.region && config.region.trim() !== "") {
408
538
  geoCodeParams.countrycodes = config.region;
409
539
  }
410
- if (config.bounds
411
- && isNumber(config.bounds.north)
412
- && isNumber(config.bounds.east)
413
- && isNumber(config.bounds.south)
414
- && isNumber(config.bounds.west)) {
415
- geoCodeParams.viewbox = config.bounds.west+","+config.bounds.south+","+
416
- config.bounds.east+","+config.bounds.north;
540
+ if (
541
+ config.bounds &&
542
+ isNumber(config.bounds.north) &&
543
+ isNumber(config.bounds.east) &&
544
+ isNumber(config.bounds.south) &&
545
+ isNumber(config.bounds.west)
546
+ ) {
547
+ geoCodeParams.viewbox =
548
+ config.bounds.west +
549
+ "," +
550
+ config.bounds.south +
551
+ "," +
552
+ config.bounds.east +
553
+ "," +
554
+ config.bounds.north;
417
555
  }
418
- geocode(in_loc, geoCodeParams, callback);
419
- }
556
+ geocode(in_loc, geoCodeParams, callback);
557
+ }
420
558
  function isNumber(x) {
421
- if (typeof x === 'number') return true;
422
- if (typeof x === 'string' && x.trim() !== '' && !isNaN(x)) return true;
559
+ if (typeof x === "number") return true;
560
+ if (typeof x === "string" && x.trim() !== "" && !isNaN(x)) return true;
423
561
  return false;
424
562
  }
425
563
  function contains(bounds, lat, lng) {
426
564
  if (!gMainMap) return true;
427
- return bounds.contains(L.latLng ( lat, lng ));
565
+ return bounds.contains(L.latLng(lat, lng));
428
566
  }
429
567
  function getBounds() {
430
568
  if (!gMainMap) return null;
@@ -436,7 +574,10 @@ function addControl(div,pos,cb) {
436
574
  }
437
575
  function fitBounds(locations) {
438
576
  if (!gMainMap) return;
439
- const bounds = locations.reduce(function(b,lat_lng) {b.extend(lat_lng); return b;}, L.latLngBounds());
577
+ const bounds = locations.reduce(function (b, lat_lng) {
578
+ b.extend(lat_lng);
579
+ return b;
580
+ }, L.latLngBounds());
440
581
  gMainMap.fitBounds(bounds);
441
582
  }
442
583
  function createClusterLayer() {
@@ -453,50 +594,68 @@ function addControl(div,pos,cb) {
453
594
  gClusterLayer = null;
454
595
  }
455
596
  function clickSearch(ev, cb) {
456
- L.DomUtil.addClass(gMainMap._container,'crosshair-cursor-enabled');
457
- gMainMap.once('click',function(e) {
458
- gMainMap.once('click',function(e) {
459
- L.DomUtil.removeClass(gMainMap._container,'crosshair-cursor-enabled');
460
- cb(e.latlng.lat,e.latlng.lng);
461
- })
597
+ L.DomUtil.addClass(gMainMap._container, "crosshair-cursor-enabled");
598
+ gMainMap.once("click", function (e) {
599
+ gMainMap.once("click", function (e) {
600
+ L.DomUtil.removeClass(
601
+ gMainMap._container,
602
+ "crosshair-cursor-enabled",
603
+ );
604
+ cb(e.latlng.lat, e.latlng.lng);
605
+ });
462
606
  });
463
607
  }
464
608
  function getCorners(lat_lngs = false) {
465
- var bounds = lat_lngs
466
- ? lat_lngs.reduce(function(b,lat_lng) {b.extend(lat_lng); return b;}, L.latLngBounds())
467
- : gMainMap.getBounds();
609
+ var bounds = lat_lngs
610
+ ? lat_lngs.reduce(function (b, lat_lng) {
611
+ b.extend(lat_lng);
612
+ return b;
613
+ }, L.latLngBounds())
614
+ : gMainMap.getBounds();
468
615
 
469
- return {
470
- "ne" : {"lat": bounds.getNorthEast().lat, "lng": bounds.getNorthEast().lng},
471
- "sw" : {"lat": bounds.getSouthWest().lat, "lng": bounds.getSouthWest().lng}
472
- }
473
- }
616
+ return {
617
+ ne: {
618
+ lat: bounds.getNorthEast().lat,
619
+ lng: bounds.getNorthEast().lng,
620
+ },
621
+ sw: {
622
+ lat: bounds.getSouthWest().lat,
623
+ lng: bounds.getSouthWest().lng,
624
+ },
625
+ };
626
+ }
474
627
  function getCenter() {
475
- return {"lat": gMainMap.getCenter().lat, "lng": gMainMap.getCenter().lng};
628
+ return { lat: gMainMap.getCenter().lat, lng: gMainMap.getCenter().lng };
476
629
  }
477
630
  function modalOn() {
478
- if (gMainMap) gMainMap.dragging.disable()
631
+ if (gMainMap) gMainMap.dragging.disable();
479
632
  }
480
633
  function modalOff() {
481
- if (gMainMap) gMainMap.dragging.enable()
634
+ if (gMainMap) gMainMap.dragging.enable();
482
635
  }
483
636
  function afterInit(doNotWait, f) {
484
637
  f();
485
638
  }
486
- function returnTrue() {return true;}
639
+ function returnTrue() {
640
+ return true;
641
+ }
487
642
  function isMapDefined() {
488
- return (gMainMap !== null);
643
+ return gMainMap !== null;
489
644
  }
490
645
  function isMapVisible() {
491
- return (gMainMap !== null) && gMainMap.getSize().x > 0 && gMainMap.getSize().y > 0;
646
+ return (
647
+ gMainMap !== null &&
648
+ gMainMap.getSize().x > 0 &&
649
+ gMainMap.getSize().y > 0
650
+ );
492
651
  }
493
- this.createMap = createMap;
494
- this.addListener = addListener;
652
+ this.createMap = createMap;
653
+ this.addListener = addListener;
495
654
  this.removeListener = removeListener;
496
- this.addControl = addControl;
655
+ this.addControl = addControl;
497
656
  this.flyToFixedZoom = flyToFixedZoom;
498
- this.clearAllMarkers = clearAllMarkers;
499
- this.callGeocoder = callGeocoder;
657
+ this.clearAllMarkers = clearAllMarkers;
658
+ this.callGeocoder = callGeocoder;
500
659
  this.getZoomAdjustedBounds = getZoomAdjustedBounds;
501
660
  this.getZoom = getZoom;
502
661
  this.createMarker = createMarker;
@@ -559,6 +718,7 @@ MapDelegate.prototype.getCenter = null;
559
718
  MapDelegate.prototype.markSearchPoint = null;
560
719
  MapDelegate.prototype.getOpenMarker = null;
561
720
  MapDelegate.prototype.calculateBoundsFromCenterAndZoom = null;
721
+
562
722
  /* @preserve
563
723
  * Leaflet 1.9.4+v1.d15112c, a JS library for interactive maps. https://leafletjs.com
564
724
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade