leaflet-city-mapper 0.0.7 → 0.0.8

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.
Files changed (65) hide show
  1. package/README.md +2 -2
  2. package/cucumber.mjs +1 -3
  3. package/dist/leaflet-city-mapper-src.js +403 -201
  4. package/dist/leaflet-city-mapper-src.js.map +4 -4
  5. package/dist/leaflet-city-mapper-worker-src.js +69 -59
  6. package/dist/leaflet-city-mapper-worker-src.js.map +3 -3
  7. package/dist/leaflet-city-mapper-worker.js +1 -1
  8. package/dist/leaflet-city-mapper-worker.js.map +4 -4
  9. package/dist/leaflet-city-mapper.js +5 -5
  10. package/dist/leaflet-city-mapper.js.map +4 -4
  11. package/libs/leaflet-lens.js +44 -27
  12. package/libs/leaflet.js +4 -4
  13. package/libs/openlayers-bindings.js +2 -1
  14. package/libs/openlayers-bindings.min.js +1 -1
  15. package/libs/openlayers-bindings.min.js.map +3 -3
  16. package/package.json +2 -2
  17. package/src/camera/mapCamera.js +7 -7
  18. package/src/camera/mapTryAnimatedPan.js +4 -4
  19. package/src/camera/updateMapCamera.js +8 -6
  20. package/src/controls/cameraControls.js +27 -22
  21. package/src/core/cameraCircleBounds.js +2 -1
  22. package/src/core/closestCameraLayerPoint.js +2 -1
  23. package/src/core/constructLayer.js +9 -0
  24. package/src/core/extendLeafletClass.js +5 -0
  25. package/src/core/extendTerrainPixelBounds.js +31 -0
  26. package/src/core/gridlayerGetTiledPixelBounds.js +2 -27
  27. package/src/core/layerAddInitHook.js +7 -0
  28. package/src/core/layerCallInitHooks.js +13 -13
  29. package/src/core/layerMergeOptions.js +7 -0
  30. package/src/core/projectNativePath.js +23 -0
  31. package/src/geometry/circleGeometry.js +4 -3
  32. package/src/globals/layerControlAddItem.js +3 -0
  33. package/src/globals/leafletLayer.js +3 -0
  34. package/src/globals/workerCogSource.js +1 -1
  35. package/src/gpu/initializeRendererResources.js +10 -12
  36. package/src/index.js +26 -11
  37. package/src/layer-controls/layerControlInputId.js +11 -0
  38. package/src/layer-controls/placeEntry.js +2 -0
  39. package/src/materials/createProgram.js +7 -6
  40. package/src/native/gridTerrainElevation.js +7 -11
  41. package/src/native/nativeTerrainElevation.js +16 -0
  42. package/src/native/prepareGridTerrainRequests.js +16 -0
  43. package/src/native/retainGridTerrain.js +10 -0
  44. package/src/native/syncGridLayer.js +12 -59
  45. package/src/native/syncGridTile.js +18 -0
  46. package/src/native/syncTerrainGridTile.js +28 -0
  47. package/src/rendering/drawGeometry.js +11 -11
  48. package/src/rendering/resizeRenderer.js +16 -15
  49. package/src/scene/initializerFor.js +2 -1
  50. package/src/scene/layerInitialize.js +1 -1
  51. package/src/shadows/drawShadowMeshes.js +6 -5
  52. package/src/sources/pumpSourceAreas.js +1 -1
  53. package/src/sunlight/initSunlight.js +19 -8
  54. package/src/textures/nativeTextureFor.js +2 -3
  55. package/src/textures/uploadCanvasTexture.js +11 -2
  56. package/src/vector-tiles/createVectorLabel.js +22 -0
  57. package/src/vector-tiles/prepareVectorLabel.js +17 -35
  58. package/src/vector-tiles/updateVectorLabelStyle.js +8 -0
  59. package/src/vector-tiles/vectorLabelCells.js +2 -5
  60. package/src/vector-tiles/vectorLabelIcon.js +1 -1
  61. package/src/vector-tiles/vectorLabelText.js +10 -0
  62. package/src/walk/initWalk.js +19 -6
  63. package/src/weakmaps/pathProjectionByMap.js +1 -0
  64. package/src/workers/cogWorker.js +4 -5
  65. package/src/globals/layerCallInitHooks.js +0 -1
@@ -3,23 +3,34 @@
3
3
  const L = globalThis.L || globalThis.leaflet;
4
4
  if (!L?.Control) throw new Error('Leaflet must be loaded before leaflet-lens.js');
5
5
 
6
- L.Control.Lens = L.Control.extend({
7
- options: { position: 'topright', radius: 150, enabled: true },
6
+ function initializeLens(outerLayer, innerLayer, options) {
7
+ L.Util.setOptions(this, options);
8
+ if (options?.enabled === undefined) {
9
+ this.options.enabled = !matchMedia('(hover: none) and (pointer: coarse)').matches;
10
+ }
11
+ if (!outerLayer?.options || !innerLayer?.options || outerLayer === innerLayer) {
12
+ throw new TypeError('Lens requires two distinct raster layers');
13
+ }
14
+ if (!Number.isFinite(this.options.radius) || this.options.radius <= 0) {
15
+ throw new RangeError('Lens radius must be positive and finite in CSS pixels');
16
+ }
17
+ if (typeof this.options.enabled !== 'boolean') throw new TypeError('Lens enabled must be boolean');
18
+ this._layers = [outerLayer, innerLayer];
19
+ }
8
20
 
9
- initialize(outerLayer, innerLayer, options) {
10
- L.Util.setOptions(this, options);
11
- if (options?.enabled === undefined) {
12
- this.options.enabled = !matchMedia('(hover: none) and (pointer: coarse)').matches;
13
- }
14
- if (!outerLayer?.options || !innerLayer?.options || outerLayer === innerLayer) {
15
- throw new TypeError('Lens requires two distinct raster layers');
16
- }
17
- if (!Number.isFinite(this.options.radius) || this.options.radius <= 0) {
18
- throw new RangeError('Lens radius must be positive and finite in CSS pixels');
21
+ class LensControl extends (L.version.startsWith('2.') ? L.Control : L.Control.extend({})) {
22
+ static initHooks = true;
23
+ static defaultOptions = { position: 'topright', radius: 150, enabled: true };
24
+
25
+ constructor(outerLayer, innerLayer, options) {
26
+ if (L.version.startsWith('2.')) {
27
+ super(options);
28
+ initializeLens.call(this, outerLayer, innerLayer, options);
29
+ this.callInitHooks();
30
+ } else {
31
+ super(outerLayer, innerLayer, options);
19
32
  }
20
- if (typeof this.options.enabled !== 'boolean') throw new TypeError('Lens enabled must be boolean');
21
- this._layers = [outerLayer, innerLayer];
22
- },
33
+ }
23
34
 
24
35
  onAdd(map) {
25
36
  for (const layer of this._layers) {
@@ -59,7 +70,7 @@
59
70
  }
60
71
  this.setEnabled(this.options.enabled);
61
72
  return container;
62
- },
73
+ }
63
74
 
64
75
  onRemove(map) {
65
76
  for (const [type, handler] of Object.entries(this._events)) {
@@ -75,7 +86,7 @@
75
86
  }
76
87
  this._lens = this._button = this._masks = this._originalCutouts = this._events = null;
77
88
  map.fire('move');
78
- },
89
+ }
79
90
 
80
91
  setEnabled(enabled) {
81
92
  if (typeof enabled !== 'boolean') throw new TypeError('Lens enabled must be boolean');
@@ -83,11 +94,11 @@
83
94
  if (this._button) this._button.setAttribute('aria-pressed', String(enabled));
84
95
  if (this._lens) this._hide();
85
96
  return this;
86
- },
97
+ }
87
98
 
88
99
  _toggle() {
89
100
  this.setEnabled(!this.options.enabled);
90
- },
101
+ }
91
102
 
92
103
  _show(point) {
93
104
  if (!this.options.enabled) return;
@@ -98,13 +109,13 @@
98
109
  this._lens.style.top = `${point.y}px`;
99
110
  this._lens.hidden = false;
100
111
  this._map.fire('move');
101
- },
112
+ }
102
113
 
103
114
  _hide() {
104
115
  for (const mask of this._masks) mask.radius = 0;
105
116
  this._lens.hidden = true;
106
117
  this._map.fire('move');
107
- },
118
+ }
108
119
 
109
120
  _onPointerMove(event) {
110
121
  if (event.target.closest('.leaflet-control')) return this._hide();
@@ -113,22 +124,28 @@
113
124
  x: (event.clientX - bounds.left) * container.offsetWidth / bounds.width - container.clientLeft,
114
125
  y: (event.clientY - bounds.top) * container.offsetHeight / bounds.height - container.clientTop,
115
126
  });
116
- },
127
+ }
117
128
 
118
129
  _onPointerDown(event) {
119
130
  if (event.pointerType === 'touch') this._onPointerMove(event);
120
- },
131
+ }
121
132
 
122
133
  _onPointerLeave(event) {
123
134
  if (event.pointerType !== 'touch') this._hide();
124
- },
135
+ }
125
136
 
126
137
  _onFocus() {
127
138
  if (this._lens.hidden) this._show(this._map.getSize().divideBy(2));
128
- },
139
+ }
129
140
 
130
141
  _onKeyDown(event) {
131
142
  if (event.key === 'Escape') this._hide();
132
- },
133
- });
143
+ }
144
+ }
145
+
146
+ if (L.version.startsWith('1.')) {
147
+ LensControl.prototype.options = Object.assign(Object.create(L.Control.prototype.options), LensControl.defaultOptions);
148
+ LensControl.prototype.initialize = initializeLens;
149
+ }
150
+ L.Control.Lens = LensControl;
134
151
  })();
package/libs/leaflet.js CHANGED
@@ -11,7 +11,7 @@ const openlayers = new URLSearchParams(location.search).get('engine') === 'openl
11
11
  document.write((openlayers
12
12
  ? '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@10.6.1/ol.css">' +
13
13
  '<script src="https://cdn.jsdelivr.net/npm/ol@10.6.1/dist/ol.js"><\/script>' +
14
- '<script src="https://unpkg.com/leaflet-city-mapper@0.0.7/libs/openlayers-bindings.min.js"><\/script>'
14
+ '<script src="https://unpkg.com/leaflet-city-mapper@0.0.8/libs/openlayers-bindings.min.js"><\/script>'
15
15
  : '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9/dist/leaflet.css"><script src="https://unpkg.com/leaflet@1.9/dist/leaflet-src.js"><\/script>'));
16
16
 
17
17
  const engineStyle = document.createElement('style');
@@ -49,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
49
49
  resize.observe(footer);
50
50
  map.once('unload', () => { resize.disconnect(); footer.remove(); });
51
51
  }
52
- const EngineControl = L.Control.extend({
52
+ class EngineControl extends L.Control {
53
53
  onAdd() {
54
54
  const container = L.DomUtil.create('div', 'leaflet-bar map-engine-control');
55
55
  L.DomEvent.disableClickPropagation(container);
@@ -70,7 +70,7 @@ document.addEventListener('DOMContentLoaded', () => {
70
70
  location.assign(url.href);
71
71
  });
72
72
  return container;
73
- },
74
- });
73
+ }
74
+ }
75
75
  new EngineControl({ position: 'bottomleft' }).addTo(map);
76
76
  });
@@ -1118,8 +1118,9 @@
1118
1118
  },
1119
1119
  });
1120
1120
  L.Map.addInitHook(function () {
1121
+ const mapPane = this.createPane('mapPane');
1121
1122
  for (const [name, order] of [['tilePane', 200], ['overlayPane', 400], ['markerPane', 600]]) {
1122
- this.createPane(name).style.zIndex = order;
1123
+ this.createPane(name, mapPane).style.zIndex = order;
1123
1124
  }
1124
1125
  const handler = event => this._fireDOMEvent(event);
1125
1126
  L.DomEvent.on(this.getContainer(), 'click mousemove mouseout mouseover', handler);
@@ -95,5 +95,5 @@
95
95
  border: 1px solid #888;
96
96
  pointer-events: none;
97
97
  }
98
- `,document.head.appendChild(b);const i=window.L={version:"1.9.4-openlayers",control:{}};let Z=0;const g=t=>t._leaflet_id||=++Z,w=(t,e)=>t.options={...t.options,...e},M=new Animation(new KeyframeEffect(null,[],{duration:1,fill:"both",easing:"cubic-bezier(0,0,0.25,1)"}));function f(...t){this.initialize?.(...t),this.callInitHooks()}f.extend=function(t){function e(...o){this.initialize?.(...o),this.callInitHooks()}return Object.setPrototypeOf(e,this),e.prototype=Object.create(this.prototype),Object.assign(e.prototype,t,{constructor:e}),e.prototype.options={...this.prototype.options,...t.options},e.prototype._initHooks=[],e},f.include=function(t){return Object.assign(this.prototype,t),this},f.mergeOptions=function(t){return this.prototype.options={...this.prototype.options,...t},this},f.addInitHook=function(t,...e){return Object.hasOwn(this.prototype,"_initHooks")||(this.prototype._initHooks=[]),this.prototype._initHooks.push(typeof t=="function"?t:function(){this[t](...e)}),this},f.prototype.callInitHooks=function(){if(this._initHooksCalled)return;this._initHooksCalled=!0;const t=[];for(let e=Object.getPrototypeOf(this);e;e=Object.getPrototypeOf(e))t.unshift(e);for(const e of t)if(Object.hasOwn(e,"_initHooks"))for(const o of e._initHooks)o.call(this)},i.Evented=f.extend({on(t,e,o){if(typeof t=="object")for(const[n,a]of Object.entries(t))this.on(n,a,e);else{this._events||={};for(const n of t.split(/\s+/)){const a=this._events[n]||=[];a.some(h=>h.fn===e&&h.context===o)||a.push({fn:e,context:o})}}return this},off(t,e,o){if(!t)this._events={};else if(typeof t=="object")for(const[n,a]of Object.entries(t))this.off(n,a,e);else for(const n of t.split(/\s+/))this._events?.[n]&&(this._events[n]=e?this._events[n].filter(a=>a.fn!==e||a.context!==o):[]);return this},once(t,e,o){const n=a=>{this.off(t,n),e.call(o||this,a)};return this.on(t,n)},fire(t,e){for(const o of[...this._events?.[t]||[]])o.fn.call(o.context||this,{...e,type:t,target:this,sourceTarget:this});return this},listens(t){return!!this._events?.[t]?.length}}),i.Util={stamp:g,setOptions:w,throttle(t,e,o){let n,a;const h=(...l)=>{if(n){a=l;return}t.apply(o,l),n=setTimeout(()=>{if(n=null,a){const s=a;a=null,h(...s)}},e)};return h}},i.Point=function(t,e,o){this.x=o?Math.round(t):t,this.y=o?Math.round(e):e};const p=t=>t instanceof i.Point?t:Array.isArray(t)?new i.Point(...t):new i.Point(t.x,t.y);i.Point.prototype={clone(){return new i.Point(this.x,this.y)},add(t){return this.clone()._add(p(t))},_add(t){return this.x+=t.x,this.y+=t.y,this},subtract(t){return this.clone()._subtract(p(t))},_subtract(t){return this.x-=t.x,this.y-=t.y,this},multiplyBy(t){return new i.Point(this.x*t,this.y*t)},divideBy(t){return new i.Point(this.x/t,this.y/t)},scaleBy(t){return new i.Point(this.x*t.x,this.y*t.y)},unscaleBy(t){return new i.Point(this.x/t.x,this.y/t.y)},round(){return new i.Point(Math.round(this.x),Math.round(this.y))},floor(){return new i.Point(Math.floor(this.x),Math.floor(this.y))},ceil(){return new i.Point(Math.ceil(this.x),Math.ceil(this.y))},distanceTo(t){return t=p(t),Math.hypot(this.x-t.x,this.y-t.y)},equals(t){return t=p(t),this.x===t.x&&this.y===t.y},contains(t){return t=p(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)}},i.LatLng=function(t,e,o){if(!Number.isFinite(Number(t))||!Number.isFinite(Number(e)))throw new Error("Invalid LatLng");this.lat=Number(t),this.lng=Number(e),o!==void 0&&(this.alt=o)};const u=t=>t instanceof i.LatLng?t:Array.isArray(t)?new i.LatLng(...t):new i.LatLng(t.lat,t.lng);i.LatLng.prototype={equals(t,e=1e-9){return t=u(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=e},distanceTo(t){return t=u(t),ol.sphere.getDistance([this.lng,this.lat],[t.lng,t.lat])},wrap(){return new i.LatLng(this.lat,((this.lng+180)%360+360)%360-180,this.alt)}},i.Bounds=function(t,e){if(t)for(const o of e?[t,e]:Array.isArray(t)?t:[t])this.extend(o)},i.Bounds.prototype={extend(t){return t instanceof i.Bounds?(this.extend(t.min),this.extend(t.max),this):(t=p(t),this.min?(this.min.x=Math.min(this.min.x,t.x),this.min.y=Math.min(this.min.y,t.y),this.max.x=Math.max(this.max.x,t.x),this.max.y=Math.max(this.max.y,t.y)):(this.min=t.clone(),this.max=t.clone()),this)},getCenter(){return this.min.add(this.max).divideBy(2)},getSize(){return this.max.subtract(this.min)},contains(t){const e=t.min||p(t),o=t.max||e;return e.x>=this.min.x&&o.x<=this.max.x&&e.y>=this.min.y&&o.y<=this.max.y},intersects(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}},i.LatLngBounds=function(t,e){if(t)for(const o of e?[t,e]:t)this.extend(o)},i.LatLngBounds.prototype={extend(t){return t instanceof i.LatLngBounds?(this.extend(t._southWest),this.extend(t._northEast),this):(t=u(t),this._southWest?(this._southWest.lat=Math.min(this._southWest.lat,t.lat),this._southWest.lng=Math.min(this._southWest.lng,t.lng),this._northEast.lat=Math.max(this._northEast.lat,t.lat),this._northEast.lng=Math.max(this._northEast.lng,t.lng)):(this._southWest=new i.LatLng(t.lat,t.lng),this._northEast=new i.LatLng(t.lat,t.lng)),this)},getSouthWest(){return this._southWest},getNorthEast(){return this._northEast},getNorthWest(){return new i.LatLng(this.getNorth(),this.getWest())},getSouthEast(){return new i.LatLng(this.getSouth(),this.getEast())},getNorth(){return this._northEast.lat},getSouth(){return this._southWest.lat},getEast(){return this._northEast.lng},getWest(){return this._southWest.lng},getCenter(){return new i.LatLng((this.getNorth()+this.getSouth())/2,(this.getEast()+this.getWest())/2)},contains(t){return t=u(t),t.lat>=this.getSouth()&&t.lat<=this.getNorth()&&t.lng>=this.getWest()&&t.lng<=this.getEast()},isValid(){return!!(this._southWest&&this._northEast)}};const T=6378137,L=2*Math.PI*T,m={scale:t=>256*2**t,zoom:t=>Math.log2(t/256),project(t){return t=u(t),p(ol.proj.fromLonLat([t.lng,Math.max(-85.0511287798,Math.min(85.0511287798,t.lat))]))},unproject(t){const[e,o]=ol.proj.toLonLat([t.x,t.y]);return new i.LatLng(o,e)},transformation:{transform(t,e){return new i.Point((t.x/L+.5)*e,(.5-t.y/L)*e)},untransform(t,e){return new i.Point((t.x/e-.5)*L,(.5-t.y/e)*L)}}};i.DomUtil={create(t,e="",o){const n=document.createElement(t);return n.className=e,o?.append(n),n},setPosition(t,e){t._leaflet_pos=p(e),t.style.transform=`translate(${e.x}px,${e.y}px)`},getPosition(t){return t._leaflet_pos||new i.Point(0,0)}};const E=new WeakMap;function P(t,e,o,n,a){if(typeof o=="object"){for(const[l,s]of Object.entries(o))P(t,e,l,s,n);return i.DomEvent}let h=E.get(e);h||E.set(e,h=[]);for(const l of o.split(/\s+/)){const s=h.find(d=>d.type===l&&d.fn===n&&d.context===a);if(t&&!s){const d=a?n.bind(a):n;h.push({type:l,fn:n,context:a,handler:d}),e.addEventListener(l,d,{passive:!1})}else!t&&s&&(e.removeEventListener(l,s.handler),h.splice(h.indexOf(s),1))}return i.DomEvent}const k=t=>t.stopPropagation();i.DomEvent={on:(...t)=>P(!0,...t),off:(...t)=>P(!1,...t),stop(t){t.preventDefault(),t.stopPropagation()},disableClickPropagation(t){return t.classList.add("leaflet-control"),i.DomEvent.on(t,"click dblclick pointerdown mousedown touchstart contextmenu",k),this},disableScrollPropagation(t){return this.on(t,"wheel",k)}},i.Handler=f.extend({initialize(t){this._map=t},enable(){return this._enabled||(this._enabled=!0,this.addHooks?.()),this},disable(){return this._enabled&&(this._enabled=!1,this.removeHooks?.()),this},enabled(){return!!this._enabled},moving(){return!!this._moving}}),i.Layer=i.Evented.extend({initialize(t){w(this,t)},addTo(t){return t.addLayer(this),this},remove(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom(t){return t?.removeLayer(this),this},getAttribution(){return this.options.attribution},getPane(t){return this._map.getPane(t||this.options.pane)},_layerAdd({target:t}){t.hasLayer(this)&&(this._map=t,this.getEvents&&(this._mapEvents=this.getEvents(),t.on(this._mapEvents,this)),this.onAdd?.(t),this.fire("add"),t.fire("layeradd",{layer:this}))}}),i.LayerGroup=i.Layer.extend({initialize(t=[],e){w(this,e),this._layers={};for(const o of t)this.addLayer(o)},addLayer(t){return this._layers[g(t)]=t,this._map?.addLayer(t),this},removeLayer(t){return delete this._layers[g(t)],this._map?.removeLayer(t),this},hasLayer(t){return g(t)in this._layers},eachLayer(t,e){for(const o of Object.values(this._layers))t.call(e||this,o);return this},onAdd(t){this.eachLayer(t.addLayer,t)},onRemove(t){this.eachLayer(t.removeLayer,t)}});for(const[t,e]of[["GridLayer",i.Layer],["Marker",i.Layer],["Path",i.Layer],["Polyline",null],["Polygon",null],["CircleMarker",null],["Circle",null],["ImageOverlay",i.Layer],["VideoOverlay",null],["SVGOverlay",null],["Popup",i.Layer],["Tooltip",i.Layer],["DivIcon",f]]){const o=e||{Polyline:i.Path,Polygon:i.Polyline,CircleMarker:i.Path,Circle:i.CircleMarker,VideoOverlay:i.ImageOverlay,SVGOverlay:i.ImageOverlay}[t];i[t]=o.extend({initialize(){throw new Error(`L.${t} is not supported by the OpenLayers bindings; use L.Layer with a source`)},getEvents(){return{}}})}i.Map=i.Evented.extend({options:{crs:m,minZoom:0,maxZoom:24,zoomSnap:1,touchZoom:!0,scrollWheelZoom:!0,keyboard:!0,doubleClickZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60},initialize(t,e){if(w(this,e),this._container=typeof t=="string"?document.getElementById(t):t,!this._container)throw new Error("Map container not found");g(this._container),this._container.classList.add("openlayers-city-mapper"),this._layers={},this._panes={},this._handlers=[],this._controls=new Set;const o=m.project(this.options.center||[0,0]);this.ol=new ol.Map({target:this._container,controls:[new ol.control.Zoom,new ol.control.Attribution({collapsible:!1})],interactions:[],view:new ol.View({center:[o.x,o.y],zoom:this.options.zoom||0,minZoom:this.getMinZoom(),maxZoom:this.getMaxZoom()})});for(const r of this.ol.getControls().getArray()){r.element.classList.add("leaflet-control");for(const c of r.element.querySelectorAll("button[title]"))c.setAttribute("aria-label",c.title);if(r instanceof ol.control.Zoom)for(const[c,y]of[[".ol-zoom-in",1],[".ol-zoom-out",-1]])r.element.querySelector(c).addEventListener("click",_=>{i.DomEvent.stop(_),_.stopImmediatePropagation(),this._zoomBy(y*(_.shiftKey?3:1))},!0)}this._loaded=!0,this._zoomAnimated=!1,this.dragging=new i.Handler(this).enable(),this.touchZoom=new i.Handler(this),this.options.touchZoom&&this.touchZoom.enable(),this._handlers.push(this.dragging,this.touchZoom);for(const r of["scrollWheelZoom","keyboard","doubleClickZoom"])this.addHandler(r,i.Handler);this._container.hasAttribute("tabindex")||(this._container.tabIndex=0);const n=this.ol.getView();this._viewZoom=n.getZoom(),n.on(["change:center","change:resolution"],()=>{if(this._settingView)return;const r=n.getZoom()!==this._viewZoom;this._viewMoving||(this._viewMoving=!0,this.fire("movestart")),r&&!this._viewZooming&&(this._viewZooming=!0,this.fire("zoomstart")),this.fire("move"),r&&this.fire("zoom"),this._viewZoom=n.getZoom(),!n.getAnimating()&&!n.getInteracting()&&this._endViewChange()}),this.ol.on("moveend",()=>this._endViewChange()),this.ol.getCoordinateFromPixel=r=>{const c=m.project(this.containerPointToLatLng(p(r)));return[c.x,c.y]},this._wheelDelta=0,this.ol.addInteraction(new ol.interaction.Interaction({handleEvent:r=>{const c=r.originalEvent;if(c.target.closest(".ol-control"))return!0;if(r.type==="dblclick"&&this.doubleClickZoom.enabled())this._zoomBy(c.shiftKey?-1:1,p(r.pixel));else if(r.type==="wheel"&&this.scrollWheelZoom.enabled()&&!c.shiftKey){const y=window.devicePixelRatio||1,_=/Linux/.test(navigator.platform)&&/Chrome/.test(navigator.userAgent)?y:/Mac/.test(navigator.platform)?3*y:2*y;this._wheelDelta-=c.deltaY*(c.deltaMode===1?20:c.deltaMode===2?60:1/_),this._wheelPixel=p(r.pixel),this._wheelStart??=performance.now(),clearTimeout(this._wheelTimer),this._wheelTimer=setTimeout(()=>{const x=4*Math.log2(2/(1+Math.exp(-Math.abs(this._wheelDelta/(this.options.wheelPxPerZoomLevel*4))))),z=this.options.zoomSnap,S=Math.sign(this._wheelDelta)*(z?Math.ceil(x/z)*z:x);this._wheelDelta=0,this._wheelStart=null,this._loaded&&this.scrollWheelZoom.enabled()&&this._zoomBy(S,this.options.scrollWheelZoom==="center"?void 0:this._wheelPixel)},Math.max(0,this.options.wheelDebounceTime-(performance.now()-this._wheelStart)))}else return!0;return c.preventDefault(),!1}})),this._controlCorners={};for(const r of["topleft","topright","bottomleft","bottomright"])this._controlCorners[r]=i.DomUtil.create("div",`ol-city-corner ol-city-${r}`,this.ol.getOverlayContainerStopEvent());const a=new ol.source.Vector;this.ol.addLayer(new ol.layer.Vector({source:a}));const h=()=>{const r=new Set(['<a href="https://openlayers.org/">OpenLayers</a>']);this.eachLayer(c=>{c.getAttribution?.()&&r.add(c.getAttribution())}),a.setAttributions([...r])};this.on("layeradd layerremove",h),h();let l,s;const d=r=>{const c=this._container.getBoundingClientRect();return new i.Point(r.clientX-c.left,r.clientY-c.top)};this._onPointer=r=>{if(r.type==="pointerdown"){if(!this.dragging.enabled()||r.button!==0||!r.isPrimary||r.target.closest(".ol-control"))return;l=this.containerPointToLatLng(d(r)),s=r.pointerId,this._moved=this.dragging._moving=!1,this._container.focus({preventScroll:!0}),this._container.setPointerCapture(s)}else if(r.pointerId===s&&r.type==="pointermove"&&this.dragging.enabled()){const c=this.project(l).subtract(this.project(this.containerPointToLatLng(d(r))));Math.hypot(c.x,c.y)>1&&(this._moved=this.dragging._moving=!0),this.setView(this.unproject(this.project(this.getCenter()).add(c)),this.getZoom())}else r.pointerId===s&&r.type!=="pointermove"&&(this._container.hasPointerCapture(s)&&this._container.releasePointerCapture(s),l=null,s=null,this.dragging._moving=!1)},this._onKey=r=>{if(!this.keyboard.enabled()||r.target!==this._container||r.altKey||r.ctrlKey||r.metaKey)return;const c={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]};if(c[r.key])this.panBy(c[r.key]);else if(["+","=","-","_"].includes(r.key))this._zoomBy((["-","_"].includes(r.key)?-1:1)*(r.shiftKey?3:1));else return;r.preventDefault()},i.DomEvent.on(this._container,"pointerdown pointermove pointerup pointercancel",this._onPointer),i.DomEvent.on(this._container,"keydown",this._onKey),this.ol.on("change:size",()=>this.fire("resize",{newSize:this.getSize()})),this.ol.updateSize()},getContainer(){return this._container},getSize(){return p(this.ol.getSize()||[this._container.clientWidth,this._container.clientHeight])},getCenter(){return m.unproject(p(this.ol.getView().getCenter()))},getZoom(){return this.ol.getView().getZoom()},getMinZoom(){return this.options.minZoom},getMaxZoom(){return this.options.maxZoom},getZoomScale(t,e=this.getZoom()){return 2**(t-e)},getScaleZoom(t,e=this.getZoom()){return e+Math.log2(t)},_limitZoom(t){return Math.max(this.getMinZoom(),Math.min(this.getMaxZoom(),t))},project(t,e=this.getZoom()){return m.transformation.transform(m.project(t),m.scale(e))},unproject(t,e=this.getZoom()){return m.unproject(m.transformation.untransform(p(t),m.scale(e)))},getPixelOrigin(){return this.project(this.getCenter()).subtract(this.getSize().divideBy(2))},_getMapPanePos(){return new i.Point(0,0)},latLngToLayerPoint(t){return this.project(t).subtract(this.getPixelOrigin())},layerPointToLatLng(t){return this.unproject(p(t).add(this.getPixelOrigin()))},layerPointToContainerPoint(t){return p(t).clone()},containerPointToLayerPoint(t){return p(t).clone()},latLngToContainerPoint(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(t))},containerPointToLatLng(t){return this.layerPointToLatLng(this.containerPointToLayerPoint(t))},getBounds(){return new i.LatLngBounds(this.containerPointToLatLng([0,0]),this.containerPointToLatLng(this.getSize()))},_endViewChange(){if(!this._viewMoving)return;const t=this._viewZooming;this._viewMoving=this._viewZooming=!1,t&&this.fire("zoomend"),this.fire("moveend")},_zoomBy(t,e){if(!t||this.ol.getView().getAnimating())return this;const o=this._limitZoom(this.getZoom()+t);return e?this.setZoomAround(e,o,{animate:!0}):this.setZoom(o,{animate:!0})},setView(t,e=this.getZoom(),o={}){if(t=u(t),e=this._limitZoom(e),(o.animate===!0||o.zoom?.animate===!0)&&e!==this.getZoom()){const l=this.getZoomScale(e),s=m.project(t);return this.ol.getView().animate({center:[s.x,s.y],zoom:e,duration:250,easing:d=>{M.currentTime=d;const r=M.effect.getComputedTiming().progress;return(1-1/(1+(l-1)*r))/(1-1/l)}}),this}this.ol.getView().cancelAnimations(),this._endViewChange();const n=e!==this.getZoom(),a=!t.equals(this.getCenter());if(!n&&!a)return this;this.fire("movestart"),n&&this.fire("zoomstart"),this._settingView=!0;const h=m.project(t);return this.ol.getView().setCenter([h.x,h.y]),this.ol.getView().setZoom(e),this._viewZoom=this.getZoom(),this._settingView=!1,n&&this.fire("zoom"),this.fire("move").fire("viewreset"),n&&this.fire("zoomend"),this.fire("moveend")},setZoom(t,e){return this.setView(this.getCenter(),t,e)},panTo(t){return this.setView(t)},panBy(t){return this.panTo(this.unproject(this.project(this.getCenter()).add(p(t))))},setZoomAround(t,e,o){const n=t instanceof i.Point?t:this.latLngToContainerPoint(t),a=this.getSize().divideBy(2),h=this.getZoomScale(e);return this.setView(this.unproject(this.project(this.getCenter()).add(n.subtract(a).multiplyBy(1-1/h))),e,o)},getBoundsZoom(t,e,o=[0,0]){const n=this.project(t.getSouthEast()).subtract(this.project(t.getNorthWest())),a=this.getSize().subtract(p(o)),h=Math[e?"max":"min"](a.x/n.x,a.y/n.y);return this._limitZoom(this.getScaleZoom(h))},_getBoundsCenterZoom(t,e={}){return{center:t.getCenter(),zoom:this.getBoundsZoom(t,!1,e.padding)}},fitBounds(t,e){const o=this._getBoundsCenterZoom(t,e);return this.setView(o.center,o.zoom)},_limitCenter(t){return t},_limitOffset(t){return t},_tryAnimatedPan(){return!1},panInside(t){return this.getBounds().contains(t)||this.panTo(t),this},whenReady(t,e){return this._loaded?t.call(e||this,{target:this}):this.once("load",t,e),this},addLayer(t){const e=g(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd?.(this),this.whenReady(t._layerAdd,t),this)},removeLayer(t){return this.hasLayer(t)?(t.onRemove?.(this),t._mapEvents&&this.off(t._mapEvents,t),delete this._layers[g(t)],this.fire("layerremove",{layer:t}),t.fire("remove"),t._map=t._mapToAdd=null,this):this},hasLayer(t){return!!this._layers[g(t)]},eachLayer(t,e){for(const o of Object.values(this._layers))t.call(e||this,o);return this},createPane(t,e=this._container){return this._panes[t]=i.DomUtil.create("div",`leaflet-pane leaflet-${t}`,e)},getPane(t="overlayPane"){return this._panes[t]},addHandler(t,e){return this[t]=new e(this),this._handlers.push(this[t]),this.options[t]&&this[t].enable(),this},invalidateSize(){return this.ol.updateSize(),this},_draggableMoved(){return!!this._moved},remove(){clearTimeout(this._wheelTimer),this.ol.getView().cancelAnimations(),this.fire("unload");for(const t of[...this._controls])t.remove();this.eachLayer(this.removeLayer,this);for(const t of this._handlers)t.disable();i.DomEvent.off(this._container,"pointerdown pointermove pointerup pointercancel",this._onPointer),i.DomEvent.off(this._container,"keydown",this._onKey),this.ol.setTarget(void 0),this.ol.dispose();for(const t of Object.values(this._controlCorners))t.remove();for(const t of Object.values(this._panes))t.remove();return this._loaded=!1,delete this._container._leaflet_id,this.off()}}),i.Control=f.extend({options:{position:"topright"},initialize(t){w(this,t)},getPosition(){return this.options.position},getContainer(){return this._container},addTo(t){return this.remove(),this._map=t,this._container=this.onAdd(t),i.Control.Rotate&&this instanceof i.Control.Rotate&&this._container.classList.add("ol-city-rotate"),this._container.classList.add("leaflet-control","ol-control","ol-city-control"),this._olControl=new ol.control.Control({element:this._container,target:t._controlCorners[this.getPosition()]}),t.ol.addControl(this._olControl),t._controls.add(this),this},remove(){if(!this._map)return this;const t=this._map;return this.onRemove?.(t),this._container?.remove(),t.ol.removeControl(this._olControl),t._controls.delete(this),this._map=null,this}}),i.Control.Layers=i.Control.extend({options:{collapsed:!0},initialize(t={},e={},o){w(this,o),this._layers=[];for(const[n,a]of Object.entries(t))this._layers.push({name:n,layer:a,overlay:!1});for(const[n,a]of Object.entries(e))this._layers.push({name:n,layer:a,overlay:!0})},onAdd(t){const e=i.DomUtil.create("div","ol-city-layers");i.DomEvent.disableClickPropagation(e),i.DomEvent.disableScrollPropagation(e);const o=i.DomUtil.create("section","",e);o.setAttribute("aria-label","Map layers");const n=i.DomUtil.create("div","",o);i.DomUtil.create("hr","",o);const a=i.DomUtil.create("div","",o);this._inputs=[];for(const h of this._layers){const l=i.DomUtil.create("label","",h.overlay?a:n),s=i.DomUtil.create("input","leaflet-control-layers-selector",l);s.type=h.overlay?"checkbox":"radio",s.name=`base-${g(this)}`,s.layerId=g(h.layer),s.checked=t.hasLayer(h.layer),l.append(document.createTextNode(` ${h.name}`)),this._inputs.push(s),s.onchange=()=>{const d=s.checked;if(!h.overlay)for(const r of this._layers)!r.overlay&&r!==h&&t.removeLayer(r.layer);d?t.addLayer(h.layer):t.removeLayer(h.layer)}}return t.on("layeradd layerremove",this._update,this),e},_update(){for(const t of this._inputs)t.checked=!!this._map._layers[t.layerId]},onRemove(t){t.off("layeradd layerremove",this._update,this)}});const v=t=>t instanceof i.LatLngBounds?t:new i.LatLngBounds(t),O=t=>t.map(e=>Array.isArray(e)&&typeof e[0]!="number"?O(e):u(e)),C=(t,e,o)=>{const n=document.createElement("img");return n.className=o,e.crossOrigin&&(n.crossOrigin=e.crossOrigin===!0?"":e.crossOrigin),n.src=t,n.draggable=!1,n};i.Layer.include({bindPopup(t){return this._popupContent=t,this.off("click",this.openPopup,this).on("click",this.openPopup,this),this.once("remove",this.closePopup,this),this instanceof i.LayerGroup&&this.eachLayer(e=>e.bindPopup(t)),this},openPopup(t){if(!this._map)return this;this.closePopup();const e=t?.latlng||this.getLatLng?.()||this.getBounds?.().getCenter();if(!e)throw new Error("Popup requires a location");const o=i.DomUtil.create("div","ol-city-popup leaflet-popup");o.setAttribute("role","dialog");const n=i.DomUtil.create("button","",o);n.type="button",n.textContent="\xD7",n.setAttribute("aria-label","Close popup"),n.onclick=()=>this.closePopup();const a=i.DomUtil.create("div","",o),h=typeof this._popupContent=="function"?this._popupContent(this):this._popupContent;return h instanceof Node?a.append(h):a.innerHTML=h,i.DomEvent.disableClickPropagation(o),this._popupOverlay=new ol.Overlay({element:o,positioning:"bottom-center",offset:[0,-12]}),this._map.ol.addOverlay(this._popupOverlay),this._popupLocation=u(e),this._map.on("move zoom rotate pitch",this._positionPopup,this),this._positionPopup(),this},_positionPopup(){const t=this._map.latLngToContainerPoint(this._popupLocation);this._popupOverlay.setPosition(this._map.ol.getCoordinateFromPixelInternal([t.x,t.y]))},closePopup(){return this._popupOverlay&&(this._map?.off("move zoom rotate pitch",this._positionPopup,this),this._map?.ol.removeOverlay(this._popupOverlay),this._popupOverlay=null),this},bindTooltip(t){return this._tooltipContent=t,this.on("mouseover",this._showTooltip,this).on("mouseout remove",this._hideTooltip,this),this instanceof i.LayerGroup&&this.eachLayer(e=>e.bindTooltip(t)),this},_showTooltip(t){if(this._hideTooltip(),!this._map||!t.latlng)return;const e=this._tooltipElement=i.DomUtil.create("div","ol-city-tooltip leaflet-tooltip",this._map.getContainer());e.setAttribute("role","tooltip");const o=typeof this._tooltipContent=="function"?this._tooltipContent(this):this._tooltipContent;o instanceof Node?e.append(o):e.innerHTML=o;const n=this._map.latLngToContainerPoint(t.latlng);e.style.left=`${n.x+12}px`,e.style.top=`${n.y+12}px`},_hideTooltip(){this._tooltipElement?.remove(),this._tooltipElement=null}}),i.LayerGroup.include({getLayers(){return Object.values(this._layers)},getBounds(){const t=new i.LatLngBounds;return this.eachLayer(e=>t.extend(e.getBounds?.()||e.getLatLng())),t}}),i.FeatureGroup=i.LayerGroup.extend({}),i.Path.include({options:{pane:"overlayPane",interactive:!0,stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",fill:!1,fillOpacity:.2},initialize(t){i.Util.setOptions(this,t)},setStyle(t){return i.Util.setOptions(this,t),this.redraw()},redraw(){return this},bringToFront(){return this},bringToBack(){return this}}),i.Polyline.include({initialize(t,e){i.Util.setOptions(this,e),this.setLatLngs(t)},getLatLngs(){return this._latlngs},setLatLngs(t){return this._latlngs=O(t),this.redraw()},addLatLng(t){return this._latlngs.push(u(t)),this.redraw()},getBounds(){const t=new i.LatLngBounds,e=o=>{for(const n of o)Array.isArray(n)?e(n):t.extend(n)};return e(this._latlngs),t},_project(){this._rings=[];const t=e=>{e.length&&(Array.isArray(e[0])?e.forEach(t):this._rings.push(e.map(o=>this._map.latLngToLayerPoint(o))))};t(this._latlngs)},closestLayerPoint(t){this._project();const e=this._rings.map(n=>n.map(a=>[a.x,a.y])),o=new ol.geom.MultiLineString(e).getClosestPoint([t.x,t.y]);return p(o)}}),i.Polyline.mergeOptions(i.Path.prototype.options),i.Polygon.include({initialize:i.Polyline.prototype.initialize}),i.Polygon.mergeOptions(i.Path.prototype.options),i.Polygon.mergeOptions({fill:!0}),i.Rectangle=i.Polygon.extend({initialize(t,e){i.Util.setOptions(this,e),this.setBounds(t)},setBounds(t){return t=v(t),this.setLatLngs([t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()])}}),i.CircleMarker.include({options:{...i.Path.prototype.options,fill:!0,radius:10},initialize(t,e){i.Util.setOptions(this,e),this._latlng=u(t)},getLatLng(){return this._latlng},setLatLng(t){return this._latlng=u(t),this.fire("move",{latlng:this._latlng}),this.redraw()},getRadius(){return this.options.radius},setRadius(t){return this.options.radius=t,this.redraw()}}),i.Circle.include({initialize:i.CircleMarker.prototype.initialize,_project(){this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=this._radiusY=this.getRadius()*this._map.options.crs.scale(this._map.getZoom())/(2*Math.PI*6378137*Math.cos(this._latlng.lat*Math.PI/180))},getBounds(){const t=this.getRadius()/6378137*180/Math.PI,e=t/Math.cos(this._latlng.lat*Math.PI/180);return new i.LatLngBounds([this._latlng.lat-t,this._latlng.lng-e],[this._latlng.lat+t,this._latlng.lng+e])}}),i.Circle.mergeOptions(i.CircleMarker.prototype.options),i.GeoJSON=i.FeatureGroup.extend({initialize(t,e){i.LayerGroup.prototype.initialize.call(this,[],e),t&&this.addData(t)},addData(t){const e=new ol.format.GeoJSON().readFeatures(t),o=(n,a)=>{const h=n.getCoordinates(),l=s=>typeof s[0]=="number"?[s[1],s[0]]:s.map(l);switch(n.getType()){case"Point":return this.options.pointToLayer?this.options.pointToLayer(a,u(l(h))):new i.Marker(l(h));case"MultiPoint":return new i.FeatureGroup(h.map(s=>o(new ol.geom.Point(s),a)));case"LineString":case"MultiLineString":return new i.Polyline(l(h),this.options);case"Polygon":case"MultiPolygon":return new i.Polygon(l(h),this.options);default:throw new Error(`Unsupported GeoJSON geometry: ${n.getType()}`)}};for(const n of e){const a=o(n.getGeometry(),new ol.format.GeoJSON().writeFeatureObject(n));this.addLayer(a)}return this}}),i.GridLayer.include({options:{pane:"tilePane",tileSize:256,opacity:1,minZoom:0,maxZoom:24,updateInterval:200},initialize(t){i.Util.setOptions(this,t),this._tiles={}},getTileSize(){return typeof this.options.tileSize=="number"?new i.Point(this.options.tileSize,this.options.tileSize):p(this.options.tileSize)},getEvents(){return{moveend:this._onMoveEnd,zoomend:this._onMoveEnd,resize:this._onMoveEnd}},_initContainer(){this._container=i.DomUtil.create("div","",this.getPane())},onAdd(){this._initContainer(),this._onMoveEnd()},onRemove(){for(const t of Object.values(this._tiles))this.fire("tileunload",{tile:t.el,coords:t.coords});this._tiles={},this._container?.remove()},_getTiledPixelBounds(){return new i.Bounds(this._map.project(this._map.getBounds().getNorthWest(),this._tileZoom),this._map.project(this._map.getBounds().getSouthEast(),this._tileZoom))},_onMoveEnd(){if(!this._map)return;this._tileZoom=Math.max(this.options.minZoom,Math.min(this.options.maxZoom,Math.round(this._map.getZoom())));const t=this.getTileSize(),e=this._getTiledPixelBounds(this._map.getCenter()),o=e.min.unscaleBy(t).floor(),n=e.max.unscaleBy(t).floor(),a=new Set,h=2**this._tileZoom;for(let l=o.x;l<=n.x;l++)for(let s=o.y;s<=n.y;s++){if(s<0||s>=h)continue;const d=`${this._tileZoom}:${l}:${s}`;if(a.add(d),this._tiles[d])continue;const r=new i.Point(l,s);r.z=this._tileZoom;const c=this._tiles[d]={coords:r,current:!0,loaded:0},y=(_,x)=>{if(this._tiles[d]===c){if(c.el=x,_){this.fire("tileerror",{error:_,tile:x,coords:r});return}c.loaded=Date.now(),this.fire("tileload",{tile:x,coords:r}),this.fire("load")}};c.el=this.createTile(r,y),this.createTile.length<2&&y(null,c.el)}for(const[l,s]of Object.entries(this._tiles))a.has(l)||(delete this._tiles[l],this.fire("tileunload",{tile:s.el,coords:s.coords}))},_tileCoordsToNwSe(t){const e=this.getTileSize(),o=new i.Point(t.x*e.x,t.y*e.y);return[this._map.unproject(o,t.z),this._map.unproject(o.add(e),t.z)]},setOpacity(t){return this.options.opacity=t,this},setZIndex(t){return this.options.zIndex=t,this},redraw(){return this._map&&(this.onRemove(),this._onMoveEnd()),this}}),i.TileLayer=i.GridLayer.extend({initialize(t,e){i.GridLayer.prototype.initialize.call(this,e),this.setUrl(t)},setUrl(t){return this._url=t,this._source=new ol.source.XYZ({url:t,crossOrigin:"anonymous"}),this.redraw()},createTile(t,e){const o=this._source.getTileUrlFunction()([t.z,t.x,t.y],1,ol.proj.get("EPSG:3857")),n=C(o,this.options,"");return n.onload=()=>e(null,n),n.onerror=()=>e(new Error(`Unable to load tile: ${o}`),n),n}}),i.TileLayer.WMS=i.TileLayer.extend({setUrl(t){return this._url=t,this._source=new ol.source.TileWMS({url:t,crossOrigin:"anonymous",params:{LAYERS:this.options.layers,FORMAT:this.options.format||"image/png",TRANSPARENT:this.options.transparent||!1}}),this.redraw()}}),i.ImageOverlay.include({options:{pane:"overlayPane",opacity:1,interactive:!1},initialize(t,e,o){i.Util.setOptions(this,o),this._url=t,this._bounds=v(e)},_initImage(){this._image=C(this._url,this.options,""),this._image.onload=()=>this.fire("load"),this._image.onerror=()=>this.fire("error",{error:new Error(`Unable to load image: ${this._url}`)})},getBounds(){return this._bounds},setBounds(t){return this._bounds=v(t),this},setUrl(t){return this._url=t,this._image&&(this._image.src=t),this},setOpacity(t){return this.options.opacity=t,this},setZIndex(t){return this.options.zIndex=t,this}}),i.Icon=i.Evented.extend({initialize(t){i.Util.setOptions(this,t)},createIcon(){return this._create("icon")},createShadow(){return this.options.shadowUrl?this._create("shadow"):null},_create(t){const e=C(this.options[`${t}Url`],this.options,`leaflet-marker-${t}`),o=this.options[`${t}Size`],n=this.options[`${t}Anchor`]||this.options.iconAnchor;return o&&(e.style.width=`${o[0]}px`,e.style.height=`${o[1]}px`),n&&(e.style.marginLeft=`${-n[0]}px`,e.style.marginTop=`${-n[1]}px`),e}}),i.Icon.Default=i.Icon.extend({options:{iconUrl:"https://unpkg.com/leaflet@1.9/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41],shadowAnchor:[12,41]}}),i.DivIcon=i.Icon.extend({createIcon(){const t=i.DomUtil.create("div",`leaflet-marker-icon ${this.options.className||""}`);this.options.html instanceof Node?t.append(this.options.html):t.innerHTML=this.options.html||"";const e=this.options.iconSize||[12,12],o=this.options.iconAnchor||e.map(n=>n/2);return t.style.cssText=`width:${e[0]}px;height:${e[1]}px;margin-left:${-o[0]}px;margin-top:${-o[1]}px`,t},createShadow(){return null}}),i.Marker.include({options:{pane:"markerPane",icon:new i.Icon.Default,opacity:1,interactive:!0,zIndexOffset:0},initialize(t,e){i.Util.setOptions(this,e),this._latlng=u(t)},getLatLng(){return this._latlng},setLatLng(t){return this._latlng=u(t),this.update(),this.fire("move",{latlng:this._latlng})},setIcon(t){return this.options.icon=t,this._map&&(this.onRemove(),this.onAdd()),this},getEvents(){return{zoom:this.update,viewreset:this.update}},onAdd(){this._icon=this.options.icon.createIcon(),this._shadow=this.options.icon.createShadow(),this._icon.tabIndex=0,this._icon.setAttribute("role","button"),this._icon.setAttribute("aria-label",this.options.title||"Marker"),this._icon.title=this.options.title||"";for(const t of[this._shadow,this._icon])t&&this.getPane().append(t);this._initInteraction(),this.update()},onRemove(){this.dragging?.disable(),this._icon?.remove(),this._shadow?.remove()},update(){return this._map&&this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng)),this},_setPos(t){for(const e of[this._icon,this._shadow])e&&i.DomUtil.setPosition(e,t);this._zIndex=t.y+this.options.zIndexOffset,this._updateZIndex(0)},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},setOpacity(t){return this.options.opacity=t,this},setZIndexOffset(t){return this.options.zIndexOffset=t,this.update()},_initInteraction(){this._icon._cityLayer=this;const t=this.dragging=new i.Handler(this._map),e=this._icon;i.DomEvent.on(e,"pointerdown",s=>{this._map._moved=!1,s.stopPropagation()}),i.DomEvent.on(e,"keydown",s=>{s.key!=="Enter"&&s.key!==" "||(i.DomEvent.stop(s),this.fire("click",{latlng:this._latlng,originalEvent:s}))}),t._marker=this,t._draggable=new i.Evented,t._onDrag=function(){const s=this._marker;s._latlng=s._map.layerPointToLatLng(i.DomUtil.getPosition(s._icon)),s.fire("move",{latlng:s._latlng}).fire("drag",{latlng:s._latlng})},t._adjustPan=function(){},t._draggable.on("drag",t._onDrag,t);let o,n,a,h;const l=s=>{if(t.enabled())if(s.type==="pointerdown"){if(s.button!==0)return;s.preventDefault(),s.stopPropagation(),o=s.pointerId,n=[s.clientX,s.clientY],a=this._map.latLngToContainerPoint(this._latlng),h=!1,e.setPointerCapture(o),this.fire("dragstart")}else if(s.pointerId===o&&s.type==="pointermove"){const d=new i.Point(a.x+s.clientX-n[0],a.y+s.clientY-n[1]);i.DomUtil.setPosition(e,d),t._draggable._newPos=d,t._draggable.fire("drag",{originalEvent:s}),h=!0}else s.pointerId===o&&(e.hasPointerCapture(o)&&e.releasePointerCapture(o),o=null,this.fire("dragend"),this._map._moved=h)};t.addHooks=()=>i.DomEvent.on(e,"pointerdown pointermove pointerup pointercancel",l),t.removeHooks=()=>i.DomEvent.off(e,"pointerdown pointermove pointerup pointercancel",l),this.options.draggable&&t.enable()}}),i.Map.include({_fireDOMEvent(t,e=t.type,o){const n=this.getContainer().getBoundingClientRect(),a=new i.Point(t.clientX-n.left,t.clientY-n.top),h=this.containerPointToLatLng(a),l=t.target.closest?.(".leaflet-marker-icon")?._cityLayer;if(!(e==="click"&&this._draggableMoved(l)))for(const s of o||(l?[l]:[this]))s.fire(e,{originalEvent:t,latlng:h,containerPoint:a,layerPoint:this.containerPointToLayerPoint(a)})}}),i.Map.addInitHook(function(){for(const[e,o]of[["tilePane",200],["overlayPane",400],["markerPane",600]])this.createPane(e).style.zIndex=o;const t=e=>this._fireDOMEvent(e);i.DomEvent.on(this.getContainer(),"click mousemove mouseout mouseover",t),this.once("unload",()=>i.DomEvent.off(this.getContainer(),"click mousemove mouseout mouseover",t))})})();
98
+ `,document.head.appendChild(b);const i=window.L={version:"1.9.4-openlayers",control:{}};let Z=0;const g=t=>t._leaflet_id||=++Z,w=(t,e)=>t.options={...t.options,...e},M=new Animation(new KeyframeEffect(null,[],{duration:1,fill:"both",easing:"cubic-bezier(0,0,0.25,1)"}));function f(...t){this.initialize?.(...t),this.callInitHooks()}f.extend=function(t){function e(...o){this.initialize?.(...o),this.callInitHooks()}return Object.setPrototypeOf(e,this),e.prototype=Object.create(this.prototype),Object.assign(e.prototype,t,{constructor:e}),e.prototype.options={...this.prototype.options,...t.options},e.prototype._initHooks=[],e},f.include=function(t){return Object.assign(this.prototype,t),this},f.mergeOptions=function(t){return this.prototype.options={...this.prototype.options,...t},this},f.addInitHook=function(t,...e){return Object.hasOwn(this.prototype,"_initHooks")||(this.prototype._initHooks=[]),this.prototype._initHooks.push(typeof t=="function"?t:function(){this[t](...e)}),this},f.prototype.callInitHooks=function(){if(this._initHooksCalled)return;this._initHooksCalled=!0;const t=[];for(let e=Object.getPrototypeOf(this);e;e=Object.getPrototypeOf(e))t.unshift(e);for(const e of t)if(Object.hasOwn(e,"_initHooks"))for(const o of e._initHooks)o.call(this)},i.Evented=f.extend({on(t,e,o){if(typeof t=="object")for(const[n,a]of Object.entries(t))this.on(n,a,e);else{this._events||={};for(const n of t.split(/\s+/)){const a=this._events[n]||=[];a.some(h=>h.fn===e&&h.context===o)||a.push({fn:e,context:o})}}return this},off(t,e,o){if(!t)this._events={};else if(typeof t=="object")for(const[n,a]of Object.entries(t))this.off(n,a,e);else for(const n of t.split(/\s+/))this._events?.[n]&&(this._events[n]=e?this._events[n].filter(a=>a.fn!==e||a.context!==o):[]);return this},once(t,e,o){const n=a=>{this.off(t,n),e.call(o||this,a)};return this.on(t,n)},fire(t,e){for(const o of[...this._events?.[t]||[]])o.fn.call(o.context||this,{...e,type:t,target:this,sourceTarget:this});return this},listens(t){return!!this._events?.[t]?.length}}),i.Util={stamp:g,setOptions:w,throttle(t,e,o){let n,a;const h=(...l)=>{if(n){a=l;return}t.apply(o,l),n=setTimeout(()=>{if(n=null,a){const s=a;a=null,h(...s)}},e)};return h}},i.Point=function(t,e,o){this.x=o?Math.round(t):t,this.y=o?Math.round(e):e};const p=t=>t instanceof i.Point?t:Array.isArray(t)?new i.Point(...t):new i.Point(t.x,t.y);i.Point.prototype={clone(){return new i.Point(this.x,this.y)},add(t){return this.clone()._add(p(t))},_add(t){return this.x+=t.x,this.y+=t.y,this},subtract(t){return this.clone()._subtract(p(t))},_subtract(t){return this.x-=t.x,this.y-=t.y,this},multiplyBy(t){return new i.Point(this.x*t,this.y*t)},divideBy(t){return new i.Point(this.x/t,this.y/t)},scaleBy(t){return new i.Point(this.x*t.x,this.y*t.y)},unscaleBy(t){return new i.Point(this.x/t.x,this.y/t.y)},round(){return new i.Point(Math.round(this.x),Math.round(this.y))},floor(){return new i.Point(Math.floor(this.x),Math.floor(this.y))},ceil(){return new i.Point(Math.ceil(this.x),Math.ceil(this.y))},distanceTo(t){return t=p(t),Math.hypot(this.x-t.x,this.y-t.y)},equals(t){return t=p(t),this.x===t.x&&this.y===t.y},contains(t){return t=p(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)}},i.LatLng=function(t,e,o){if(!Number.isFinite(Number(t))||!Number.isFinite(Number(e)))throw new Error("Invalid LatLng");this.lat=Number(t),this.lng=Number(e),o!==void 0&&(this.alt=o)};const u=t=>t instanceof i.LatLng?t:Array.isArray(t)?new i.LatLng(...t):new i.LatLng(t.lat,t.lng);i.LatLng.prototype={equals(t,e=1e-9){return t=u(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=e},distanceTo(t){return t=u(t),ol.sphere.getDistance([this.lng,this.lat],[t.lng,t.lat])},wrap(){return new i.LatLng(this.lat,((this.lng+180)%360+360)%360-180,this.alt)}},i.Bounds=function(t,e){if(t)for(const o of e?[t,e]:Array.isArray(t)?t:[t])this.extend(o)},i.Bounds.prototype={extend(t){return t instanceof i.Bounds?(this.extend(t.min),this.extend(t.max),this):(t=p(t),this.min?(this.min.x=Math.min(this.min.x,t.x),this.min.y=Math.min(this.min.y,t.y),this.max.x=Math.max(this.max.x,t.x),this.max.y=Math.max(this.max.y,t.y)):(this.min=t.clone(),this.max=t.clone()),this)},getCenter(){return this.min.add(this.max).divideBy(2)},getSize(){return this.max.subtract(this.min)},contains(t){const e=t.min||p(t),o=t.max||e;return e.x>=this.min.x&&o.x<=this.max.x&&e.y>=this.min.y&&o.y<=this.max.y},intersects(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}},i.LatLngBounds=function(t,e){if(t)for(const o of e?[t,e]:t)this.extend(o)},i.LatLngBounds.prototype={extend(t){return t instanceof i.LatLngBounds?(this.extend(t._southWest),this.extend(t._northEast),this):(t=u(t),this._southWest?(this._southWest.lat=Math.min(this._southWest.lat,t.lat),this._southWest.lng=Math.min(this._southWest.lng,t.lng),this._northEast.lat=Math.max(this._northEast.lat,t.lat),this._northEast.lng=Math.max(this._northEast.lng,t.lng)):(this._southWest=new i.LatLng(t.lat,t.lng),this._northEast=new i.LatLng(t.lat,t.lng)),this)},getSouthWest(){return this._southWest},getNorthEast(){return this._northEast},getNorthWest(){return new i.LatLng(this.getNorth(),this.getWest())},getSouthEast(){return new i.LatLng(this.getSouth(),this.getEast())},getNorth(){return this._northEast.lat},getSouth(){return this._southWest.lat},getEast(){return this._northEast.lng},getWest(){return this._southWest.lng},getCenter(){return new i.LatLng((this.getNorth()+this.getSouth())/2,(this.getEast()+this.getWest())/2)},contains(t){return t=u(t),t.lat>=this.getSouth()&&t.lat<=this.getNorth()&&t.lng>=this.getWest()&&t.lng<=this.getEast()},isValid(){return!!(this._southWest&&this._northEast)}};const T=6378137,L=2*Math.PI*T,m={scale:t=>256*2**t,zoom:t=>Math.log2(t/256),project(t){return t=u(t),p(ol.proj.fromLonLat([t.lng,Math.max(-85.0511287798,Math.min(85.0511287798,t.lat))]))},unproject(t){const[e,o]=ol.proj.toLonLat([t.x,t.y]);return new i.LatLng(o,e)},transformation:{transform(t,e){return new i.Point((t.x/L+.5)*e,(.5-t.y/L)*e)},untransform(t,e){return new i.Point((t.x/e-.5)*L,(.5-t.y/e)*L)}}};i.DomUtil={create(t,e="",o){const n=document.createElement(t);return n.className=e,o?.append(n),n},setPosition(t,e){t._leaflet_pos=p(e),t.style.transform=`translate(${e.x}px,${e.y}px)`},getPosition(t){return t._leaflet_pos||new i.Point(0,0)}};const E=new WeakMap;function P(t,e,o,n,a){if(typeof o=="object"){for(const[l,s]of Object.entries(o))P(t,e,l,s,n);return i.DomEvent}let h=E.get(e);h||E.set(e,h=[]);for(const l of o.split(/\s+/)){const s=h.find(d=>d.type===l&&d.fn===n&&d.context===a);if(t&&!s){const d=a?n.bind(a):n;h.push({type:l,fn:n,context:a,handler:d}),e.addEventListener(l,d,{passive:!1})}else!t&&s&&(e.removeEventListener(l,s.handler),h.splice(h.indexOf(s),1))}return i.DomEvent}const k=t=>t.stopPropagation();i.DomEvent={on:(...t)=>P(!0,...t),off:(...t)=>P(!1,...t),stop(t){t.preventDefault(),t.stopPropagation()},disableClickPropagation(t){return t.classList.add("leaflet-control"),i.DomEvent.on(t,"click dblclick pointerdown mousedown touchstart contextmenu",k),this},disableScrollPropagation(t){return this.on(t,"wheel",k)}},i.Handler=f.extend({initialize(t){this._map=t},enable(){return this._enabled||(this._enabled=!0,this.addHooks?.()),this},disable(){return this._enabled&&(this._enabled=!1,this.removeHooks?.()),this},enabled(){return!!this._enabled},moving(){return!!this._moving}}),i.Layer=i.Evented.extend({initialize(t){w(this,t)},addTo(t){return t.addLayer(this),this},remove(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom(t){return t?.removeLayer(this),this},getAttribution(){return this.options.attribution},getPane(t){return this._map.getPane(t||this.options.pane)},_layerAdd({target:t}){t.hasLayer(this)&&(this._map=t,this.getEvents&&(this._mapEvents=this.getEvents(),t.on(this._mapEvents,this)),this.onAdd?.(t),this.fire("add"),t.fire("layeradd",{layer:this}))}}),i.LayerGroup=i.Layer.extend({initialize(t=[],e){w(this,e),this._layers={};for(const o of t)this.addLayer(o)},addLayer(t){return this._layers[g(t)]=t,this._map?.addLayer(t),this},removeLayer(t){return delete this._layers[g(t)],this._map?.removeLayer(t),this},hasLayer(t){return g(t)in this._layers},eachLayer(t,e){for(const o of Object.values(this._layers))t.call(e||this,o);return this},onAdd(t){this.eachLayer(t.addLayer,t)},onRemove(t){this.eachLayer(t.removeLayer,t)}});for(const[t,e]of[["GridLayer",i.Layer],["Marker",i.Layer],["Path",i.Layer],["Polyline",null],["Polygon",null],["CircleMarker",null],["Circle",null],["ImageOverlay",i.Layer],["VideoOverlay",null],["SVGOverlay",null],["Popup",i.Layer],["Tooltip",i.Layer],["DivIcon",f]]){const o=e||{Polyline:i.Path,Polygon:i.Polyline,CircleMarker:i.Path,Circle:i.CircleMarker,VideoOverlay:i.ImageOverlay,SVGOverlay:i.ImageOverlay}[t];i[t]=o.extend({initialize(){throw new Error(`L.${t} is not supported by the OpenLayers bindings; use L.Layer with a source`)},getEvents(){return{}}})}i.Map=i.Evented.extend({options:{crs:m,minZoom:0,maxZoom:24,zoomSnap:1,touchZoom:!0,scrollWheelZoom:!0,keyboard:!0,doubleClickZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60},initialize(t,e){if(w(this,e),this._container=typeof t=="string"?document.getElementById(t):t,!this._container)throw new Error("Map container not found");g(this._container),this._container.classList.add("openlayers-city-mapper"),this._layers={},this._panes={},this._handlers=[],this._controls=new Set;const o=m.project(this.options.center||[0,0]);this.ol=new ol.Map({target:this._container,controls:[new ol.control.Zoom,new ol.control.Attribution({collapsible:!1})],interactions:[],view:new ol.View({center:[o.x,o.y],zoom:this.options.zoom||0,minZoom:this.getMinZoom(),maxZoom:this.getMaxZoom()})});for(const r of this.ol.getControls().getArray()){r.element.classList.add("leaflet-control");for(const c of r.element.querySelectorAll("button[title]"))c.setAttribute("aria-label",c.title);if(r instanceof ol.control.Zoom)for(const[c,y]of[[".ol-zoom-in",1],[".ol-zoom-out",-1]])r.element.querySelector(c).addEventListener("click",_=>{i.DomEvent.stop(_),_.stopImmediatePropagation(),this._zoomBy(y*(_.shiftKey?3:1))},!0)}this._loaded=!0,this._zoomAnimated=!1,this.dragging=new i.Handler(this).enable(),this.touchZoom=new i.Handler(this),this.options.touchZoom&&this.touchZoom.enable(),this._handlers.push(this.dragging,this.touchZoom);for(const r of["scrollWheelZoom","keyboard","doubleClickZoom"])this.addHandler(r,i.Handler);this._container.hasAttribute("tabindex")||(this._container.tabIndex=0);const n=this.ol.getView();this._viewZoom=n.getZoom(),n.on(["change:center","change:resolution"],()=>{if(this._settingView)return;const r=n.getZoom()!==this._viewZoom;this._viewMoving||(this._viewMoving=!0,this.fire("movestart")),r&&!this._viewZooming&&(this._viewZooming=!0,this.fire("zoomstart")),this.fire("move"),r&&this.fire("zoom"),this._viewZoom=n.getZoom(),!n.getAnimating()&&!n.getInteracting()&&this._endViewChange()}),this.ol.on("moveend",()=>this._endViewChange()),this.ol.getCoordinateFromPixel=r=>{const c=m.project(this.containerPointToLatLng(p(r)));return[c.x,c.y]},this._wheelDelta=0,this.ol.addInteraction(new ol.interaction.Interaction({handleEvent:r=>{const c=r.originalEvent;if(c.target.closest(".ol-control"))return!0;if(r.type==="dblclick"&&this.doubleClickZoom.enabled())this._zoomBy(c.shiftKey?-1:1,p(r.pixel));else if(r.type==="wheel"&&this.scrollWheelZoom.enabled()&&!c.shiftKey){const y=window.devicePixelRatio||1,_=/Linux/.test(navigator.platform)&&/Chrome/.test(navigator.userAgent)?y:/Mac/.test(navigator.platform)?3*y:2*y;this._wheelDelta-=c.deltaY*(c.deltaMode===1?20:c.deltaMode===2?60:1/_),this._wheelPixel=p(r.pixel),this._wheelStart??=performance.now(),clearTimeout(this._wheelTimer),this._wheelTimer=setTimeout(()=>{const x=4*Math.log2(2/(1+Math.exp(-Math.abs(this._wheelDelta/(this.options.wheelPxPerZoomLevel*4))))),z=this.options.zoomSnap,S=Math.sign(this._wheelDelta)*(z?Math.ceil(x/z)*z:x);this._wheelDelta=0,this._wheelStart=null,this._loaded&&this.scrollWheelZoom.enabled()&&this._zoomBy(S,this.options.scrollWheelZoom==="center"?void 0:this._wheelPixel)},Math.max(0,this.options.wheelDebounceTime-(performance.now()-this._wheelStart)))}else return!0;return c.preventDefault(),!1}})),this._controlCorners={};for(const r of["topleft","topright","bottomleft","bottomright"])this._controlCorners[r]=i.DomUtil.create("div",`ol-city-corner ol-city-${r}`,this.ol.getOverlayContainerStopEvent());const a=new ol.source.Vector;this.ol.addLayer(new ol.layer.Vector({source:a}));const h=()=>{const r=new Set(['<a href="https://openlayers.org/">OpenLayers</a>']);this.eachLayer(c=>{c.getAttribution?.()&&r.add(c.getAttribution())}),a.setAttributions([...r])};this.on("layeradd layerremove",h),h();let l,s;const d=r=>{const c=this._container.getBoundingClientRect();return new i.Point(r.clientX-c.left,r.clientY-c.top)};this._onPointer=r=>{if(r.type==="pointerdown"){if(!this.dragging.enabled()||r.button!==0||!r.isPrimary||r.target.closest(".ol-control"))return;l=this.containerPointToLatLng(d(r)),s=r.pointerId,this._moved=this.dragging._moving=!1,this._container.focus({preventScroll:!0}),this._container.setPointerCapture(s)}else if(r.pointerId===s&&r.type==="pointermove"&&this.dragging.enabled()){const c=this.project(l).subtract(this.project(this.containerPointToLatLng(d(r))));Math.hypot(c.x,c.y)>1&&(this._moved=this.dragging._moving=!0),this.setView(this.unproject(this.project(this.getCenter()).add(c)),this.getZoom())}else r.pointerId===s&&r.type!=="pointermove"&&(this._container.hasPointerCapture(s)&&this._container.releasePointerCapture(s),l=null,s=null,this.dragging._moving=!1)},this._onKey=r=>{if(!this.keyboard.enabled()||r.target!==this._container||r.altKey||r.ctrlKey||r.metaKey)return;const c={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]};if(c[r.key])this.panBy(c[r.key]);else if(["+","=","-","_"].includes(r.key))this._zoomBy((["-","_"].includes(r.key)?-1:1)*(r.shiftKey?3:1));else return;r.preventDefault()},i.DomEvent.on(this._container,"pointerdown pointermove pointerup pointercancel",this._onPointer),i.DomEvent.on(this._container,"keydown",this._onKey),this.ol.on("change:size",()=>this.fire("resize",{newSize:this.getSize()})),this.ol.updateSize()},getContainer(){return this._container},getSize(){return p(this.ol.getSize()||[this._container.clientWidth,this._container.clientHeight])},getCenter(){return m.unproject(p(this.ol.getView().getCenter()))},getZoom(){return this.ol.getView().getZoom()},getMinZoom(){return this.options.minZoom},getMaxZoom(){return this.options.maxZoom},getZoomScale(t,e=this.getZoom()){return 2**(t-e)},getScaleZoom(t,e=this.getZoom()){return e+Math.log2(t)},_limitZoom(t){return Math.max(this.getMinZoom(),Math.min(this.getMaxZoom(),t))},project(t,e=this.getZoom()){return m.transformation.transform(m.project(t),m.scale(e))},unproject(t,e=this.getZoom()){return m.unproject(m.transformation.untransform(p(t),m.scale(e)))},getPixelOrigin(){return this.project(this.getCenter()).subtract(this.getSize().divideBy(2))},_getMapPanePos(){return new i.Point(0,0)},latLngToLayerPoint(t){return this.project(t).subtract(this.getPixelOrigin())},layerPointToLatLng(t){return this.unproject(p(t).add(this.getPixelOrigin()))},layerPointToContainerPoint(t){return p(t).clone()},containerPointToLayerPoint(t){return p(t).clone()},latLngToContainerPoint(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(t))},containerPointToLatLng(t){return this.layerPointToLatLng(this.containerPointToLayerPoint(t))},getBounds(){return new i.LatLngBounds(this.containerPointToLatLng([0,0]),this.containerPointToLatLng(this.getSize()))},_endViewChange(){if(!this._viewMoving)return;const t=this._viewZooming;this._viewMoving=this._viewZooming=!1,t&&this.fire("zoomend"),this.fire("moveend")},_zoomBy(t,e){if(!t||this.ol.getView().getAnimating())return this;const o=this._limitZoom(this.getZoom()+t);return e?this.setZoomAround(e,o,{animate:!0}):this.setZoom(o,{animate:!0})},setView(t,e=this.getZoom(),o={}){if(t=u(t),e=this._limitZoom(e),(o.animate===!0||o.zoom?.animate===!0)&&e!==this.getZoom()){const l=this.getZoomScale(e),s=m.project(t);return this.ol.getView().animate({center:[s.x,s.y],zoom:e,duration:250,easing:d=>{M.currentTime=d;const r=M.effect.getComputedTiming().progress;return(1-1/(1+(l-1)*r))/(1-1/l)}}),this}this.ol.getView().cancelAnimations(),this._endViewChange();const n=e!==this.getZoom(),a=!t.equals(this.getCenter());if(!n&&!a)return this;this.fire("movestart"),n&&this.fire("zoomstart"),this._settingView=!0;const h=m.project(t);return this.ol.getView().setCenter([h.x,h.y]),this.ol.getView().setZoom(e),this._viewZoom=this.getZoom(),this._settingView=!1,n&&this.fire("zoom"),this.fire("move").fire("viewreset"),n&&this.fire("zoomend"),this.fire("moveend")},setZoom(t,e){return this.setView(this.getCenter(),t,e)},panTo(t){return this.setView(t)},panBy(t){return this.panTo(this.unproject(this.project(this.getCenter()).add(p(t))))},setZoomAround(t,e,o){const n=t instanceof i.Point?t:this.latLngToContainerPoint(t),a=this.getSize().divideBy(2),h=this.getZoomScale(e);return this.setView(this.unproject(this.project(this.getCenter()).add(n.subtract(a).multiplyBy(1-1/h))),e,o)},getBoundsZoom(t,e,o=[0,0]){const n=this.project(t.getSouthEast()).subtract(this.project(t.getNorthWest())),a=this.getSize().subtract(p(o)),h=Math[e?"max":"min"](a.x/n.x,a.y/n.y);return this._limitZoom(this.getScaleZoom(h))},_getBoundsCenterZoom(t,e={}){return{center:t.getCenter(),zoom:this.getBoundsZoom(t,!1,e.padding)}},fitBounds(t,e){const o=this._getBoundsCenterZoom(t,e);return this.setView(o.center,o.zoom)},_limitCenter(t){return t},_limitOffset(t){return t},_tryAnimatedPan(){return!1},panInside(t){return this.getBounds().contains(t)||this.panTo(t),this},whenReady(t,e){return this._loaded?t.call(e||this,{target:this}):this.once("load",t,e),this},addLayer(t){const e=g(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd?.(this),this.whenReady(t._layerAdd,t),this)},removeLayer(t){return this.hasLayer(t)?(t.onRemove?.(this),t._mapEvents&&this.off(t._mapEvents,t),delete this._layers[g(t)],this.fire("layerremove",{layer:t}),t.fire("remove"),t._map=t._mapToAdd=null,this):this},hasLayer(t){return!!this._layers[g(t)]},eachLayer(t,e){for(const o of Object.values(this._layers))t.call(e||this,o);return this},createPane(t,e=this._container){return this._panes[t]=i.DomUtil.create("div",`leaflet-pane leaflet-${t}`,e)},getPane(t="overlayPane"){return this._panes[t]},addHandler(t,e){return this[t]=new e(this),this._handlers.push(this[t]),this.options[t]&&this[t].enable(),this},invalidateSize(){return this.ol.updateSize(),this},_draggableMoved(){return!!this._moved},remove(){clearTimeout(this._wheelTimer),this.ol.getView().cancelAnimations(),this.fire("unload");for(const t of[...this._controls])t.remove();this.eachLayer(this.removeLayer,this);for(const t of this._handlers)t.disable();i.DomEvent.off(this._container,"pointerdown pointermove pointerup pointercancel",this._onPointer),i.DomEvent.off(this._container,"keydown",this._onKey),this.ol.setTarget(void 0),this.ol.dispose();for(const t of Object.values(this._controlCorners))t.remove();for(const t of Object.values(this._panes))t.remove();return this._loaded=!1,delete this._container._leaflet_id,this.off()}}),i.Control=f.extend({options:{position:"topright"},initialize(t){w(this,t)},getPosition(){return this.options.position},getContainer(){return this._container},addTo(t){return this.remove(),this._map=t,this._container=this.onAdd(t),i.Control.Rotate&&this instanceof i.Control.Rotate&&this._container.classList.add("ol-city-rotate"),this._container.classList.add("leaflet-control","ol-control","ol-city-control"),this._olControl=new ol.control.Control({element:this._container,target:t._controlCorners[this.getPosition()]}),t.ol.addControl(this._olControl),t._controls.add(this),this},remove(){if(!this._map)return this;const t=this._map;return this.onRemove?.(t),this._container?.remove(),t.ol.removeControl(this._olControl),t._controls.delete(this),this._map=null,this}}),i.Control.Layers=i.Control.extend({options:{collapsed:!0},initialize(t={},e={},o){w(this,o),this._layers=[];for(const[n,a]of Object.entries(t))this._layers.push({name:n,layer:a,overlay:!1});for(const[n,a]of Object.entries(e))this._layers.push({name:n,layer:a,overlay:!0})},onAdd(t){const e=i.DomUtil.create("div","ol-city-layers");i.DomEvent.disableClickPropagation(e),i.DomEvent.disableScrollPropagation(e);const o=i.DomUtil.create("section","",e);o.setAttribute("aria-label","Map layers");const n=i.DomUtil.create("div","",o);i.DomUtil.create("hr","",o);const a=i.DomUtil.create("div","",o);this._inputs=[];for(const h of this._layers){const l=i.DomUtil.create("label","",h.overlay?a:n),s=i.DomUtil.create("input","leaflet-control-layers-selector",l);s.type=h.overlay?"checkbox":"radio",s.name=`base-${g(this)}`,s.layerId=g(h.layer),s.checked=t.hasLayer(h.layer),l.append(document.createTextNode(` ${h.name}`)),this._inputs.push(s),s.onchange=()=>{const d=s.checked;if(!h.overlay)for(const r of this._layers)!r.overlay&&r!==h&&t.removeLayer(r.layer);d?t.addLayer(h.layer):t.removeLayer(h.layer)}}return t.on("layeradd layerremove",this._update,this),e},_update(){for(const t of this._inputs)t.checked=!!this._map._layers[t.layerId]},onRemove(t){t.off("layeradd layerremove",this._update,this)}});const v=t=>t instanceof i.LatLngBounds?t:new i.LatLngBounds(t),O=t=>t.map(e=>Array.isArray(e)&&typeof e[0]!="number"?O(e):u(e)),C=(t,e,o)=>{const n=document.createElement("img");return n.className=o,e.crossOrigin&&(n.crossOrigin=e.crossOrigin===!0?"":e.crossOrigin),n.src=t,n.draggable=!1,n};i.Layer.include({bindPopup(t){return this._popupContent=t,this.off("click",this.openPopup,this).on("click",this.openPopup,this),this.once("remove",this.closePopup,this),this instanceof i.LayerGroup&&this.eachLayer(e=>e.bindPopup(t)),this},openPopup(t){if(!this._map)return this;this.closePopup();const e=t?.latlng||this.getLatLng?.()||this.getBounds?.().getCenter();if(!e)throw new Error("Popup requires a location");const o=i.DomUtil.create("div","ol-city-popup leaflet-popup");o.setAttribute("role","dialog");const n=i.DomUtil.create("button","",o);n.type="button",n.textContent="\xD7",n.setAttribute("aria-label","Close popup"),n.onclick=()=>this.closePopup();const a=i.DomUtil.create("div","",o),h=typeof this._popupContent=="function"?this._popupContent(this):this._popupContent;return h instanceof Node?a.append(h):a.innerHTML=h,i.DomEvent.disableClickPropagation(o),this._popupOverlay=new ol.Overlay({element:o,positioning:"bottom-center",offset:[0,-12]}),this._map.ol.addOverlay(this._popupOverlay),this._popupLocation=u(e),this._map.on("move zoom rotate pitch",this._positionPopup,this),this._positionPopup(),this},_positionPopup(){const t=this._map.latLngToContainerPoint(this._popupLocation);this._popupOverlay.setPosition(this._map.ol.getCoordinateFromPixelInternal([t.x,t.y]))},closePopup(){return this._popupOverlay&&(this._map?.off("move zoom rotate pitch",this._positionPopup,this),this._map?.ol.removeOverlay(this._popupOverlay),this._popupOverlay=null),this},bindTooltip(t){return this._tooltipContent=t,this.on("mouseover",this._showTooltip,this).on("mouseout remove",this._hideTooltip,this),this instanceof i.LayerGroup&&this.eachLayer(e=>e.bindTooltip(t)),this},_showTooltip(t){if(this._hideTooltip(),!this._map||!t.latlng)return;const e=this._tooltipElement=i.DomUtil.create("div","ol-city-tooltip leaflet-tooltip",this._map.getContainer());e.setAttribute("role","tooltip");const o=typeof this._tooltipContent=="function"?this._tooltipContent(this):this._tooltipContent;o instanceof Node?e.append(o):e.innerHTML=o;const n=this._map.latLngToContainerPoint(t.latlng);e.style.left=`${n.x+12}px`,e.style.top=`${n.y+12}px`},_hideTooltip(){this._tooltipElement?.remove(),this._tooltipElement=null}}),i.LayerGroup.include({getLayers(){return Object.values(this._layers)},getBounds(){const t=new i.LatLngBounds;return this.eachLayer(e=>t.extend(e.getBounds?.()||e.getLatLng())),t}}),i.FeatureGroup=i.LayerGroup.extend({}),i.Path.include({options:{pane:"overlayPane",interactive:!0,stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",fill:!1,fillOpacity:.2},initialize(t){i.Util.setOptions(this,t)},setStyle(t){return i.Util.setOptions(this,t),this.redraw()},redraw(){return this},bringToFront(){return this},bringToBack(){return this}}),i.Polyline.include({initialize(t,e){i.Util.setOptions(this,e),this.setLatLngs(t)},getLatLngs(){return this._latlngs},setLatLngs(t){return this._latlngs=O(t),this.redraw()},addLatLng(t){return this._latlngs.push(u(t)),this.redraw()},getBounds(){const t=new i.LatLngBounds,e=o=>{for(const n of o)Array.isArray(n)?e(n):t.extend(n)};return e(this._latlngs),t},_project(){this._rings=[];const t=e=>{e.length&&(Array.isArray(e[0])?e.forEach(t):this._rings.push(e.map(o=>this._map.latLngToLayerPoint(o))))};t(this._latlngs)},closestLayerPoint(t){this._project();const e=this._rings.map(n=>n.map(a=>[a.x,a.y])),o=new ol.geom.MultiLineString(e).getClosestPoint([t.x,t.y]);return p(o)}}),i.Polyline.mergeOptions(i.Path.prototype.options),i.Polygon.include({initialize:i.Polyline.prototype.initialize}),i.Polygon.mergeOptions(i.Path.prototype.options),i.Polygon.mergeOptions({fill:!0}),i.Rectangle=i.Polygon.extend({initialize(t,e){i.Util.setOptions(this,e),this.setBounds(t)},setBounds(t){return t=v(t),this.setLatLngs([t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()])}}),i.CircleMarker.include({options:{...i.Path.prototype.options,fill:!0,radius:10},initialize(t,e){i.Util.setOptions(this,e),this._latlng=u(t)},getLatLng(){return this._latlng},setLatLng(t){return this._latlng=u(t),this.fire("move",{latlng:this._latlng}),this.redraw()},getRadius(){return this.options.radius},setRadius(t){return this.options.radius=t,this.redraw()}}),i.Circle.include({initialize:i.CircleMarker.prototype.initialize,_project(){this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=this._radiusY=this.getRadius()*this._map.options.crs.scale(this._map.getZoom())/(2*Math.PI*6378137*Math.cos(this._latlng.lat*Math.PI/180))},getBounds(){const t=this.getRadius()/6378137*180/Math.PI,e=t/Math.cos(this._latlng.lat*Math.PI/180);return new i.LatLngBounds([this._latlng.lat-t,this._latlng.lng-e],[this._latlng.lat+t,this._latlng.lng+e])}}),i.Circle.mergeOptions(i.CircleMarker.prototype.options),i.GeoJSON=i.FeatureGroup.extend({initialize(t,e){i.LayerGroup.prototype.initialize.call(this,[],e),t&&this.addData(t)},addData(t){const e=new ol.format.GeoJSON().readFeatures(t),o=(n,a)=>{const h=n.getCoordinates(),l=s=>typeof s[0]=="number"?[s[1],s[0]]:s.map(l);switch(n.getType()){case"Point":return this.options.pointToLayer?this.options.pointToLayer(a,u(l(h))):new i.Marker(l(h));case"MultiPoint":return new i.FeatureGroup(h.map(s=>o(new ol.geom.Point(s),a)));case"LineString":case"MultiLineString":return new i.Polyline(l(h),this.options);case"Polygon":case"MultiPolygon":return new i.Polygon(l(h),this.options);default:throw new Error(`Unsupported GeoJSON geometry: ${n.getType()}`)}};for(const n of e){const a=o(n.getGeometry(),new ol.format.GeoJSON().writeFeatureObject(n));this.addLayer(a)}return this}}),i.GridLayer.include({options:{pane:"tilePane",tileSize:256,opacity:1,minZoom:0,maxZoom:24,updateInterval:200},initialize(t){i.Util.setOptions(this,t),this._tiles={}},getTileSize(){return typeof this.options.tileSize=="number"?new i.Point(this.options.tileSize,this.options.tileSize):p(this.options.tileSize)},getEvents(){return{moveend:this._onMoveEnd,zoomend:this._onMoveEnd,resize:this._onMoveEnd}},_initContainer(){this._container=i.DomUtil.create("div","",this.getPane())},onAdd(){this._initContainer(),this._onMoveEnd()},onRemove(){for(const t of Object.values(this._tiles))this.fire("tileunload",{tile:t.el,coords:t.coords});this._tiles={},this._container?.remove()},_getTiledPixelBounds(){return new i.Bounds(this._map.project(this._map.getBounds().getNorthWest(),this._tileZoom),this._map.project(this._map.getBounds().getSouthEast(),this._tileZoom))},_onMoveEnd(){if(!this._map)return;this._tileZoom=Math.max(this.options.minZoom,Math.min(this.options.maxZoom,Math.round(this._map.getZoom())));const t=this.getTileSize(),e=this._getTiledPixelBounds(this._map.getCenter()),o=e.min.unscaleBy(t).floor(),n=e.max.unscaleBy(t).floor(),a=new Set,h=2**this._tileZoom;for(let l=o.x;l<=n.x;l++)for(let s=o.y;s<=n.y;s++){if(s<0||s>=h)continue;const d=`${this._tileZoom}:${l}:${s}`;if(a.add(d),this._tiles[d])continue;const r=new i.Point(l,s);r.z=this._tileZoom;const c=this._tiles[d]={coords:r,current:!0,loaded:0},y=(_,x)=>{if(this._tiles[d]===c){if(c.el=x,_){this.fire("tileerror",{error:_,tile:x,coords:r});return}c.loaded=Date.now(),this.fire("tileload",{tile:x,coords:r}),this.fire("load")}};c.el=this.createTile(r,y),this.createTile.length<2&&y(null,c.el)}for(const[l,s]of Object.entries(this._tiles))a.has(l)||(delete this._tiles[l],this.fire("tileunload",{tile:s.el,coords:s.coords}))},_tileCoordsToNwSe(t){const e=this.getTileSize(),o=new i.Point(t.x*e.x,t.y*e.y);return[this._map.unproject(o,t.z),this._map.unproject(o.add(e),t.z)]},setOpacity(t){return this.options.opacity=t,this},setZIndex(t){return this.options.zIndex=t,this},redraw(){return this._map&&(this.onRemove(),this._onMoveEnd()),this}}),i.TileLayer=i.GridLayer.extend({initialize(t,e){i.GridLayer.prototype.initialize.call(this,e),this.setUrl(t)},setUrl(t){return this._url=t,this._source=new ol.source.XYZ({url:t,crossOrigin:"anonymous"}),this.redraw()},createTile(t,e){const o=this._source.getTileUrlFunction()([t.z,t.x,t.y],1,ol.proj.get("EPSG:3857")),n=C(o,this.options,"");return n.onload=()=>e(null,n),n.onerror=()=>e(new Error(`Unable to load tile: ${o}`),n),n}}),i.TileLayer.WMS=i.TileLayer.extend({setUrl(t){return this._url=t,this._source=new ol.source.TileWMS({url:t,crossOrigin:"anonymous",params:{LAYERS:this.options.layers,FORMAT:this.options.format||"image/png",TRANSPARENT:this.options.transparent||!1}}),this.redraw()}}),i.ImageOverlay.include({options:{pane:"overlayPane",opacity:1,interactive:!1},initialize(t,e,o){i.Util.setOptions(this,o),this._url=t,this._bounds=v(e)},_initImage(){this._image=C(this._url,this.options,""),this._image.onload=()=>this.fire("load"),this._image.onerror=()=>this.fire("error",{error:new Error(`Unable to load image: ${this._url}`)})},getBounds(){return this._bounds},setBounds(t){return this._bounds=v(t),this},setUrl(t){return this._url=t,this._image&&(this._image.src=t),this},setOpacity(t){return this.options.opacity=t,this},setZIndex(t){return this.options.zIndex=t,this}}),i.Icon=i.Evented.extend({initialize(t){i.Util.setOptions(this,t)},createIcon(){return this._create("icon")},createShadow(){return this.options.shadowUrl?this._create("shadow"):null},_create(t){const e=C(this.options[`${t}Url`],this.options,`leaflet-marker-${t}`),o=this.options[`${t}Size`],n=this.options[`${t}Anchor`]||this.options.iconAnchor;return o&&(e.style.width=`${o[0]}px`,e.style.height=`${o[1]}px`),n&&(e.style.marginLeft=`${-n[0]}px`,e.style.marginTop=`${-n[1]}px`),e}}),i.Icon.Default=i.Icon.extend({options:{iconUrl:"https://unpkg.com/leaflet@1.9/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41],shadowAnchor:[12,41]}}),i.DivIcon=i.Icon.extend({createIcon(){const t=i.DomUtil.create("div",`leaflet-marker-icon ${this.options.className||""}`);this.options.html instanceof Node?t.append(this.options.html):t.innerHTML=this.options.html||"";const e=this.options.iconSize||[12,12],o=this.options.iconAnchor||e.map(n=>n/2);return t.style.cssText=`width:${e[0]}px;height:${e[1]}px;margin-left:${-o[0]}px;margin-top:${-o[1]}px`,t},createShadow(){return null}}),i.Marker.include({options:{pane:"markerPane",icon:new i.Icon.Default,opacity:1,interactive:!0,zIndexOffset:0},initialize(t,e){i.Util.setOptions(this,e),this._latlng=u(t)},getLatLng(){return this._latlng},setLatLng(t){return this._latlng=u(t),this.update(),this.fire("move",{latlng:this._latlng})},setIcon(t){return this.options.icon=t,this._map&&(this.onRemove(),this.onAdd()),this},getEvents(){return{zoom:this.update,viewreset:this.update}},onAdd(){this._icon=this.options.icon.createIcon(),this._shadow=this.options.icon.createShadow(),this._icon.tabIndex=0,this._icon.setAttribute("role","button"),this._icon.setAttribute("aria-label",this.options.title||"Marker"),this._icon.title=this.options.title||"";for(const t of[this._shadow,this._icon])t&&this.getPane().append(t);this._initInteraction(),this.update()},onRemove(){this.dragging?.disable(),this._icon?.remove(),this._shadow?.remove()},update(){return this._map&&this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng)),this},_setPos(t){for(const e of[this._icon,this._shadow])e&&i.DomUtil.setPosition(e,t);this._zIndex=t.y+this.options.zIndexOffset,this._updateZIndex(0)},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},setOpacity(t){return this.options.opacity=t,this},setZIndexOffset(t){return this.options.zIndexOffset=t,this.update()},_initInteraction(){this._icon._cityLayer=this;const t=this.dragging=new i.Handler(this._map),e=this._icon;i.DomEvent.on(e,"pointerdown",s=>{this._map._moved=!1,s.stopPropagation()}),i.DomEvent.on(e,"keydown",s=>{s.key!=="Enter"&&s.key!==" "||(i.DomEvent.stop(s),this.fire("click",{latlng:this._latlng,originalEvent:s}))}),t._marker=this,t._draggable=new i.Evented,t._onDrag=function(){const s=this._marker;s._latlng=s._map.layerPointToLatLng(i.DomUtil.getPosition(s._icon)),s.fire("move",{latlng:s._latlng}).fire("drag",{latlng:s._latlng})},t._adjustPan=function(){},t._draggable.on("drag",t._onDrag,t);let o,n,a,h;const l=s=>{if(t.enabled())if(s.type==="pointerdown"){if(s.button!==0)return;s.preventDefault(),s.stopPropagation(),o=s.pointerId,n=[s.clientX,s.clientY],a=this._map.latLngToContainerPoint(this._latlng),h=!1,e.setPointerCapture(o),this.fire("dragstart")}else if(s.pointerId===o&&s.type==="pointermove"){const d=new i.Point(a.x+s.clientX-n[0],a.y+s.clientY-n[1]);i.DomUtil.setPosition(e,d),t._draggable._newPos=d,t._draggable.fire("drag",{originalEvent:s}),h=!0}else s.pointerId===o&&(e.hasPointerCapture(o)&&e.releasePointerCapture(o),o=null,this.fire("dragend"),this._map._moved=h)};t.addHooks=()=>i.DomEvent.on(e,"pointerdown pointermove pointerup pointercancel",l),t.removeHooks=()=>i.DomEvent.off(e,"pointerdown pointermove pointerup pointercancel",l),this.options.draggable&&t.enable()}}),i.Map.include({_fireDOMEvent(t,e=t.type,o){const n=this.getContainer().getBoundingClientRect(),a=new i.Point(t.clientX-n.left,t.clientY-n.top),h=this.containerPointToLatLng(a),l=t.target.closest?.(".leaflet-marker-icon")?._cityLayer;if(!(e==="click"&&this._draggableMoved(l)))for(const s of o||(l?[l]:[this]))s.fire(e,{originalEvent:t,latlng:h,containerPoint:a,layerPoint:this.containerPointToLayerPoint(a)})}}),i.Map.addInitHook(function(){const t=this.createPane("mapPane");for(const[o,n]of[["tilePane",200],["overlayPane",400],["markerPane",600]])this.createPane(o,t).style.zIndex=n;const e=o=>this._fireDOMEvent(o);i.DomEvent.on(this.getContainer(),"click mousemove mouseout mouseover",e),this.once("unload",()=>i.DomEvent.off(this.getContainer(),"click mousemove mouseout mouseover",e))})})();
99
99
  //# sourceMappingURL=openlayers-bindings.min.js.map