@florasync/leaflet-geokit 0.9.0 → 0.10.0
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/ARCHITECTURE.md +195 -0
- package/CHANGELOG.md +5 -0
- package/README.md +7 -1
- package/custom-toolbar.html +165 -0
- package/dist/django/index.js +734 -734
- package/dist/django/index.js.map +1 -1
- package/dist/leaflet-geokit.es.js +1704 -1704
- package/dist/leaflet-geokit.es.js.map +1 -1
- package/dist/leaflet-geokit.external.es.js +1501 -1496
- package/dist/leaflet-geokit.external.es.js.map +1 -1
- package/dist/leaflet-geokit.umd.js +11 -14
- package/dist/leaflet-geokit.umd.js.map +1 -1
- package/dist/preact/{index-DCKj0r6a.js → index-Z22Un5Tg.js} +474 -469
- package/dist/preact/index-Z22Un5Tg.js.map +1 -0
- package/dist/preact/index.js +1 -1
- package/dist/preact-bundled/index.js +731 -731
- package/dist/preact-bundled/index.js.map +1 -1
- package/dist/react/{index-DCKj0r6a.js → index-Z22Un5Tg.js} +474 -469
- package/dist/react/index-Z22Un5Tg.js.map +1 -0
- package/dist/react/index.js +1 -1
- package/dist/react-bundled/index.js +731 -731
- package/dist/react-bundled/index.js.map +1 -1
- package/dist/types/components/LeafletDrawMapElement.d.ts +6 -6
- package/dist/types/django/index.d.ts +2 -2
- package/dist/types/external.d.ts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types/lib/FeatureStore.d.ts +2 -2
- package/dist/types/lib/LayerRegistry.d.ts +1 -1
- package/dist/types/lib/MapController.d.ts +8 -8
- package/dist/types/lib/layer-cake/LayerCakeManager.d.ts +2 -2
- package/dist/types/lib/layer-style-panel.d.ts +1 -1
- package/dist/types/lib/marker-icons.d.ts +1 -1
- package/dist/types/lib/providers.d.ts +1 -1
- package/dist/types/lib/snapping.d.ts +1 -1
- package/dist/types/lib/tool-buttons.d.ts +1 -1
- package/dist/types/lib/tool-capabilities.d.ts +1 -1
- package/dist/types/lib/toolbar-layout.d.ts +1 -1
- package/dist/types/preact/core.d.ts +2 -2
- package/dist/types/preact/index.d.ts +2 -2
- package/dist/types/preact-bundled/index.d.ts +3 -3
- package/dist/types/react/core.d.ts +2 -2
- package/dist/types/react/index.d.ts +2 -2
- package/dist/types/react-bundled/index.d.ts +3 -3
- package/dist/types/types/events.d.ts +1 -1
- package/dist/types/types/public.d.ts +6 -6
- package/dist/types/utils/geojson-pipeline.d.ts +1 -1
- package/dist/types/utils/geojson.d.ts +1 -1
- package/docs/api-reference.md +249 -0
- package/docs/custom-toolbar.md +168 -0
- package/docs/diagnostics.md +216 -0
- package/docs/grower-measurement.md +23 -0
- package/docs/integration-recipes.md +301 -0
- package/docs/release-verification.md +75 -0
- package/docs/shims/django.md +102 -0
- package/docs/shims/preact.md +98 -0
- package/docs/shims/react.md +98 -0
- package/docs/toolbar-layout.md +158 -0
- package/docs/toolbar-styling.md +2 -2
- package/package.json +15 -4
- package/dist/preact/index-DCKj0r6a.js.map +0 -1
- package/dist/react/index-DCKj0r6a.js.map +0 -1
|
@@ -82,10 +82,6 @@ function xl(l) {
|
|
|
82
82
|
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
83
83
|
}
|
|
84
84
|
var Ge = { exports: {} };
|
|
85
|
-
/* @preserve
|
|
86
|
-
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
87
|
-
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
88
|
-
*/
|
|
89
85
|
var El = Ge.exports, yr;
|
|
90
86
|
function ha() {
|
|
91
87
|
return yr || (yr = 1, (function(l, o) {
|
|
@@ -123,11 +119,11 @@ function ha() {
|
|
|
123
119
|
return "_leaflet_id" in t || (t._leaflet_id = ++c), t._leaflet_id;
|
|
124
120
|
}
|
|
125
121
|
function p(t, n, h) {
|
|
126
|
-
var u, f, _,
|
|
127
|
-
return
|
|
122
|
+
var u, f, _, k;
|
|
123
|
+
return k = function() {
|
|
128
124
|
u = !1, f && (_.apply(h, f), f = !1);
|
|
129
125
|
}, _ = function() {
|
|
130
|
-
u ? f = arguments : (t.apply(h, arguments), setTimeout(
|
|
126
|
+
u ? f = arguments : (t.apply(h, arguments), setTimeout(k, n), u = !0);
|
|
131
127
|
}, _;
|
|
132
128
|
}
|
|
133
129
|
function g(t, n, h) {
|
|
@@ -143,19 +139,19 @@ function ha() {
|
|
|
143
139
|
var h = Math.pow(10, n === void 0 ? 6 : n);
|
|
144
140
|
return Math.round(t * h) / h;
|
|
145
141
|
}
|
|
146
|
-
function
|
|
142
|
+
function v(t) {
|
|
147
143
|
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
148
144
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
145
|
+
function x(t) {
|
|
146
|
+
return v(t).split(/\s+/);
|
|
151
147
|
}
|
|
152
|
-
function
|
|
148
|
+
function b(t, n) {
|
|
153
149
|
Object.prototype.hasOwnProperty.call(t, "options") || (t.options = t.options ? a(t.options) : {});
|
|
154
150
|
for (var h in n)
|
|
155
151
|
t.options[h] = n[h];
|
|
156
152
|
return t.options;
|
|
157
153
|
}
|
|
158
|
-
function
|
|
154
|
+
function w(t, n, h) {
|
|
159
155
|
var u = [];
|
|
160
156
|
for (var f in t)
|
|
161
157
|
u.push(encodeURIComponent(h ? f.toUpperCase() : f) + "=" + encodeURIComponent(t[f]));
|
|
@@ -170,7 +166,7 @@ function ha() {
|
|
|
170
166
|
return typeof f == "function" && (f = f(n)), f;
|
|
171
167
|
});
|
|
172
168
|
}
|
|
173
|
-
var
|
|
169
|
+
var M = Array.isArray || function(t) {
|
|
174
170
|
return Object.prototype.toString.call(t) === "[object Array]";
|
|
175
171
|
};
|
|
176
172
|
function S(t, n) {
|
|
@@ -183,16 +179,16 @@ function ha() {
|
|
|
183
179
|
function O(t) {
|
|
184
180
|
return window["webkit" + t] || window["moz" + t] || window["ms" + t];
|
|
185
181
|
}
|
|
186
|
-
var
|
|
187
|
-
function
|
|
188
|
-
var n = +/* @__PURE__ */ new Date(), h = Math.max(0, 16 - (n -
|
|
189
|
-
return
|
|
182
|
+
var D = 0;
|
|
183
|
+
function z(t) {
|
|
184
|
+
var n = +/* @__PURE__ */ new Date(), h = Math.max(0, 16 - (n - D));
|
|
185
|
+
return D = n + h, window.setTimeout(t, h);
|
|
190
186
|
}
|
|
191
|
-
var U = window.requestAnimationFrame || O("RequestAnimationFrame") ||
|
|
187
|
+
var U = window.requestAnimationFrame || O("RequestAnimationFrame") || z, Z = window.cancelAnimationFrame || O("CancelAnimationFrame") || O("CancelRequestAnimationFrame") || function(t) {
|
|
192
188
|
window.clearTimeout(t);
|
|
193
189
|
};
|
|
194
190
|
function R(t, n, h) {
|
|
195
|
-
if (h && U ===
|
|
191
|
+
if (h && U === z)
|
|
196
192
|
t.call(n);
|
|
197
193
|
else
|
|
198
194
|
return U.call(window, s(t, n));
|
|
@@ -213,12 +209,12 @@ function ha() {
|
|
|
213
209
|
wrapNum: g,
|
|
214
210
|
falseFn: m,
|
|
215
211
|
formatNum: y,
|
|
216
|
-
trim:
|
|
217
|
-
splitWords:
|
|
218
|
-
setOptions:
|
|
219
|
-
getParamString:
|
|
212
|
+
trim: v,
|
|
213
|
+
splitWords: x,
|
|
214
|
+
setOptions: b,
|
|
215
|
+
getParamString: w,
|
|
220
216
|
template: T,
|
|
221
|
-
isArray:
|
|
217
|
+
isArray: M,
|
|
222
218
|
indexOf: S,
|
|
223
219
|
emptyImageUrl: I,
|
|
224
220
|
requestFn: U,
|
|
@@ -230,7 +226,7 @@ function ha() {
|
|
|
230
226
|
}
|
|
231
227
|
K.extend = function(t) {
|
|
232
228
|
var n = function() {
|
|
233
|
-
|
|
229
|
+
b(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
|
|
234
230
|
}, h = n.__super__ = this.prototype, u = a(h);
|
|
235
231
|
u.constructor = n, n.prototype = u;
|
|
236
232
|
for (var f in this)
|
|
@@ -238,7 +234,7 @@ function ha() {
|
|
|
238
234
|
return t.statics && i(n, t.statics), t.includes && (vt(t.includes), i.apply(null, [u].concat(t.includes))), i(u, t), delete u.statics, delete u.includes, u.options && (u.options = h.options ? a(h.options) : {}, i(u.options, t.options)), u._initHooks = [], u.callInitHooks = function() {
|
|
239
235
|
if (!this._initHooksCalled) {
|
|
240
236
|
h.callInitHooks && h.callInitHooks.call(this), this._initHooksCalled = !0;
|
|
241
|
-
for (var _ = 0,
|
|
237
|
+
for (var _ = 0, k = u._initHooks.length; _ < k; _++)
|
|
242
238
|
u._initHooks[_].call(this);
|
|
243
239
|
}
|
|
244
240
|
}, n;
|
|
@@ -255,7 +251,7 @@ function ha() {
|
|
|
255
251
|
};
|
|
256
252
|
function vt(t) {
|
|
257
253
|
if (!(typeof L == "undefined" || !L || !L.Mixin)) {
|
|
258
|
-
t =
|
|
254
|
+
t = M(t) ? t : [t];
|
|
259
255
|
for (var n = 0; n < t.length; n++)
|
|
260
256
|
t[n] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", new Error().stack);
|
|
261
257
|
}
|
|
@@ -273,7 +269,7 @@ function ha() {
|
|
|
273
269
|
for (var u in t)
|
|
274
270
|
this._on(u, t[u], n);
|
|
275
271
|
else {
|
|
276
|
-
t =
|
|
272
|
+
t = x(t);
|
|
277
273
|
for (var f = 0, _ = t.length; f < _; f++)
|
|
278
274
|
this._on(t[f], n, h);
|
|
279
275
|
}
|
|
@@ -297,8 +293,8 @@ function ha() {
|
|
|
297
293
|
for (var u in t)
|
|
298
294
|
this._off(u, t[u], n);
|
|
299
295
|
else {
|
|
300
|
-
t =
|
|
301
|
-
for (var f = arguments.length === 1, _ = 0,
|
|
296
|
+
t = x(t);
|
|
297
|
+
for (var f = arguments.length === 1, _ = 0, k = t.length; _ < k; _++)
|
|
302
298
|
f ? this._off(t[_]) : this._off(t[_], n, h);
|
|
303
299
|
}
|
|
304
300
|
return this;
|
|
@@ -329,10 +325,10 @@ function ha() {
|
|
|
329
325
|
console.warn("wrong listener type: " + typeof n);
|
|
330
326
|
return;
|
|
331
327
|
}
|
|
332
|
-
var
|
|
333
|
-
if (
|
|
334
|
-
var
|
|
335
|
-
this._firingCount && (
|
|
328
|
+
var k = this._listens(t, n, h);
|
|
329
|
+
if (k !== !1) {
|
|
330
|
+
var A = u[k];
|
|
331
|
+
this._firingCount && (A.fn = m, this._events[t] = u = u.slice()), u.splice(k, 1);
|
|
336
332
|
}
|
|
337
333
|
}
|
|
338
334
|
},
|
|
@@ -352,9 +348,9 @@ function ha() {
|
|
|
352
348
|
var f = this._events[t];
|
|
353
349
|
if (f) {
|
|
354
350
|
this._firingCount = this._firingCount + 1 || 1;
|
|
355
|
-
for (var _ = 0,
|
|
356
|
-
var
|
|
357
|
-
|
|
351
|
+
for (var _ = 0, k = f.length; _ < k; _++) {
|
|
352
|
+
var A = f[_], C = A.fn;
|
|
353
|
+
A.once && this.off(t, C, A.ctx), C.call(A.ctx || this, u);
|
|
358
354
|
}
|
|
359
355
|
this._firingCount--;
|
|
360
356
|
}
|
|
@@ -373,8 +369,8 @@ function ha() {
|
|
|
373
369
|
if (_ && _.length && this._listens(t, f, h) !== !1)
|
|
374
370
|
return !0;
|
|
375
371
|
if (u) {
|
|
376
|
-
for (var
|
|
377
|
-
if (this._eventParents[
|
|
372
|
+
for (var k in this._eventParents)
|
|
373
|
+
if (this._eventParents[k].listens(t, n, h, u))
|
|
378
374
|
return !0;
|
|
379
375
|
}
|
|
380
376
|
return !1;
|
|
@@ -399,7 +395,7 @@ function ha() {
|
|
|
399
395
|
for (var u in t)
|
|
400
396
|
this._on(u, t[u], n, !0);
|
|
401
397
|
else {
|
|
402
|
-
t =
|
|
398
|
+
t = x(t);
|
|
403
399
|
for (var f = 0, _ = t.length; f < _; f++)
|
|
404
400
|
this._on(t[f], n, h, !0);
|
|
405
401
|
}
|
|
@@ -539,7 +535,7 @@ function ha() {
|
|
|
539
535
|
}
|
|
540
536
|
};
|
|
541
537
|
function V(t, n, h) {
|
|
542
|
-
return t instanceof q ? t :
|
|
538
|
+
return t instanceof q ? t : M(t) ? new q(t[0], t[1]) : t == null ? t : typeof t == "object" && "x" in t && "y" in t ? new q(t.x, t.y) : new q(t, n, h);
|
|
543
539
|
}
|
|
544
540
|
function it(t, n) {
|
|
545
541
|
if (t)
|
|
@@ -610,16 +606,16 @@ function ha() {
|
|
|
610
606
|
// intersect if they have at least one point in common.
|
|
611
607
|
intersects: function(t) {
|
|
612
608
|
t = bt(t);
|
|
613
|
-
var n = this.min, h = this.max, u = t.min, f = t.max, _ = f.x >= n.x && u.x <= h.x,
|
|
614
|
-
return _ &&
|
|
609
|
+
var n = this.min, h = this.max, u = t.min, f = t.max, _ = f.x >= n.x && u.x <= h.x, k = f.y >= n.y && u.y <= h.y;
|
|
610
|
+
return _ && k;
|
|
615
611
|
},
|
|
616
612
|
// @method overlaps(otherBounds: Bounds): Boolean
|
|
617
613
|
// Returns `true` if the rectangle overlaps the given bounds. Two bounds
|
|
618
614
|
// overlap if their intersection is an area.
|
|
619
615
|
overlaps: function(t) {
|
|
620
616
|
t = bt(t);
|
|
621
|
-
var n = this.min, h = this.max, u = t.min, f = t.max, _ = f.x > n.x && u.x < h.x,
|
|
622
|
-
return _ &&
|
|
617
|
+
var n = this.min, h = this.max, u = t.min, f = t.max, _ = f.x > n.x && u.x < h.x, k = f.y > n.y && u.y < h.y;
|
|
618
|
+
return _ && k;
|
|
623
619
|
},
|
|
624
620
|
// @method isValid(): Boolean
|
|
625
621
|
// Returns `true` if the bounds are properly initialized.
|
|
@@ -741,15 +737,15 @@ function ha() {
|
|
|
741
737
|
// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
|
|
742
738
|
intersects: function(t) {
|
|
743
739
|
t = st(t);
|
|
744
|
-
var n = this._southWest, h = this._northEast, u = t.getSouthWest(), f = t.getNorthEast(), _ = f.lat >= n.lat && u.lat <= h.lat,
|
|
745
|
-
return _ &&
|
|
740
|
+
var n = this._southWest, h = this._northEast, u = t.getSouthWest(), f = t.getNorthEast(), _ = f.lat >= n.lat && u.lat <= h.lat, k = f.lng >= n.lng && u.lng <= h.lng;
|
|
741
|
+
return _ && k;
|
|
746
742
|
},
|
|
747
743
|
// @method overlaps(otherBounds: LatLngBounds): Boolean
|
|
748
744
|
// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
|
|
749
745
|
overlaps: function(t) {
|
|
750
746
|
t = st(t);
|
|
751
|
-
var n = this._southWest, h = this._northEast, u = t.getSouthWest(), f = t.getNorthEast(), _ = f.lat > n.lat && u.lat < h.lat,
|
|
752
|
-
return _ &&
|
|
747
|
+
var n = this._southWest, h = this._northEast, u = t.getSouthWest(), f = t.getNorthEast(), _ = f.lat > n.lat && u.lat < h.lat, k = f.lng > n.lng && u.lng < h.lng;
|
|
748
|
+
return _ && k;
|
|
753
749
|
},
|
|
754
750
|
// @method toBBoxString(): String
|
|
755
751
|
// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
|
|
@@ -817,7 +813,7 @@ function ha() {
|
|
|
817
813
|
}
|
|
818
814
|
};
|
|
819
815
|
function X(t, n, h) {
|
|
820
|
-
return t instanceof tt ? t :
|
|
816
|
+
return t instanceof tt ? t : M(t) && typeof t[0] != "object" ? t.length === 3 ? new tt(t[0], t[1], t[2]) : t.length === 2 ? new tt(t[0], t[1]) : null : t == null ? t : typeof t == "object" && "lat" in t ? new tt(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : n === void 0 ? null : new tt(t, n, h);
|
|
821
817
|
}
|
|
822
818
|
var zt = {
|
|
823
819
|
// @method latLngToPoint(latlng: LatLng, zoom: Number): Point
|
|
@@ -898,8 +894,8 @@ function ha() {
|
|
|
898
894
|
var n = t.getCenter(), h = this.wrapLatLng(n), u = n.lat - h.lat, f = n.lng - h.lng;
|
|
899
895
|
if (u === 0 && f === 0)
|
|
900
896
|
return t;
|
|
901
|
-
var _ = t.getSouthWest(),
|
|
902
|
-
return new Lt(
|
|
897
|
+
var _ = t.getSouthWest(), k = t.getNorthEast(), A = new tt(_.lat - u, _.lng - f), C = new tt(k.lat - u, k.lng - f);
|
|
898
|
+
return new Lt(A, C);
|
|
903
899
|
}
|
|
904
900
|
}, Jt = i({}, zt, {
|
|
905
901
|
wrapLng: [-180, 180],
|
|
@@ -909,7 +905,7 @@ function ha() {
|
|
|
909
905
|
R: 6371e3,
|
|
910
906
|
// distance between two geographical points using spherical law of cosines approximation
|
|
911
907
|
distance: function(t, n) {
|
|
912
|
-
var h = Math.PI / 180, u = t.lat * h, f = n.lat * h, _ = Math.sin((n.lat - t.lat) * h / 2),
|
|
908
|
+
var h = Math.PI / 180, u = t.lat * h, f = n.lat * h, _ = Math.sin((n.lat - t.lat) * h / 2), k = Math.sin((n.lng - t.lng) * h / 2), A = _ * _ + Math.cos(u) * Math.cos(f) * k * k, C = 2 * Math.atan2(Math.sqrt(A), Math.sqrt(1 - A));
|
|
913
909
|
return this.R * C;
|
|
914
910
|
}
|
|
915
911
|
}), sn = 6378137, Ni = {
|
|
@@ -935,7 +931,7 @@ function ha() {
|
|
|
935
931
|
})()
|
|
936
932
|
};
|
|
937
933
|
function Ui(t, n, h, u) {
|
|
938
|
-
if (
|
|
934
|
+
if (M(t)) {
|
|
939
935
|
this._a = t[0], this._b = t[1], this._c = t[2], this._d = t[3];
|
|
940
936
|
return;
|
|
941
937
|
}
|
|
@@ -979,10 +975,10 @@ function ha() {
|
|
|
979
975
|
return document.createElementNS("http://www.w3.org/2000/svg", t);
|
|
980
976
|
}
|
|
981
977
|
function hn(t, n) {
|
|
982
|
-
var h = "", u, f, _,
|
|
978
|
+
var h = "", u, f, _, k, A, C;
|
|
983
979
|
for (u = 0, _ = t.length; u < _; u++) {
|
|
984
|
-
for (
|
|
985
|
-
C =
|
|
980
|
+
for (A = t[u], f = 0, k = A.length; f < k; f++)
|
|
981
|
+
C = A[f], h += (f ? "L" : "M") + C.x + " " + C.y;
|
|
986
982
|
h += n ? F.svg ? "z" : "x" : "";
|
|
987
983
|
}
|
|
988
984
|
return h || "M0 0";
|
|
@@ -1113,14 +1109,14 @@ function ha() {
|
|
|
1113
1109
|
return;
|
|
1114
1110
|
}
|
|
1115
1111
|
if (!(_.pointerType === "mouse" || _.sourceCapabilities && !_.sourceCapabilities.firesTouchEvents)) {
|
|
1116
|
-
var
|
|
1117
|
-
if (!(
|
|
1112
|
+
var k = On(_);
|
|
1113
|
+
if (!(k.some(function(C) {
|
|
1118
1114
|
return C instanceof HTMLLabelElement && C.attributes.for;
|
|
1119
|
-
}) && !
|
|
1115
|
+
}) && !k.some(function(C) {
|
|
1120
1116
|
return C instanceof HTMLInputElement || C instanceof HTMLSelectElement;
|
|
1121
1117
|
}))) {
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1118
|
+
var A = Date.now();
|
|
1119
|
+
A - h <= _s ? (u++, u === 2 && n(gs(_))) : u = 1, h = A;
|
|
1124
1120
|
}
|
|
1125
1121
|
}
|
|
1126
1122
|
}
|
|
@@ -1176,7 +1172,7 @@ function ha() {
|
|
|
1176
1172
|
}
|
|
1177
1173
|
function j(t, n) {
|
|
1178
1174
|
if (t.classList !== void 0)
|
|
1179
|
-
for (var h =
|
|
1175
|
+
for (var h = x(n), u = 0, f = h.length; u < f; u++)
|
|
1180
1176
|
t.classList.add(h[u]);
|
|
1181
1177
|
else if (!ji(t, n)) {
|
|
1182
1178
|
var _ = ii(t);
|
|
@@ -1184,7 +1180,7 @@ function ha() {
|
|
|
1184
1180
|
}
|
|
1185
1181
|
}
|
|
1186
1182
|
function nt(t, n) {
|
|
1187
|
-
t.classList !== void 0 ? t.classList.remove(n) : Yi(t,
|
|
1183
|
+
t.classList !== void 0 ? t.classList.remove(n) : Yi(t, v((" " + ii(t) + " ").replace(" " + n + " ", " ")));
|
|
1188
1184
|
}
|
|
1189
1185
|
function Yi(t, n) {
|
|
1190
1186
|
t.className.baseVal === void 0 ? t.className = n : t.className.baseVal = n;
|
|
@@ -1310,8 +1306,8 @@ function ha() {
|
|
|
1310
1306
|
for (var f in n)
|
|
1311
1307
|
oo(t, f, n[f], h);
|
|
1312
1308
|
else {
|
|
1313
|
-
n =
|
|
1314
|
-
for (var _ = 0,
|
|
1309
|
+
n = x(n);
|
|
1310
|
+
for (var _ = 0, k = n.length; _ < k; _++)
|
|
1315
1311
|
oo(t, n[_], h, u);
|
|
1316
1312
|
}
|
|
1317
1313
|
return this;
|
|
@@ -1323,12 +1319,12 @@ function ha() {
|
|
|
1323
1319
|
else if (n && typeof n == "object")
|
|
1324
1320
|
for (var f in n)
|
|
1325
1321
|
no(t, f, n[f], h);
|
|
1326
|
-
else if (n =
|
|
1327
|
-
In(t, function(
|
|
1328
|
-
return S(n,
|
|
1322
|
+
else if (n = x(n), arguments.length === 2)
|
|
1323
|
+
In(t, function(A) {
|
|
1324
|
+
return S(n, A) !== -1;
|
|
1329
1325
|
});
|
|
1330
1326
|
else
|
|
1331
|
-
for (var _ = 0,
|
|
1327
|
+
for (var _ = 0, k = n.length; _ < k; _++)
|
|
1332
1328
|
no(t, n[_], h, u);
|
|
1333
1329
|
return this;
|
|
1334
1330
|
}
|
|
@@ -1347,12 +1343,12 @@ function ha() {
|
|
|
1347
1343
|
var f = n + d(h) + (u ? "_" + d(u) : "");
|
|
1348
1344
|
if (t[Ct] && t[Ct][f])
|
|
1349
1345
|
return this;
|
|
1350
|
-
var _ = function(
|
|
1351
|
-
return h.call(u || t,
|
|
1352
|
-
},
|
|
1353
|
-
!F.touchNative && F.pointer && n.indexOf("touch") === 0 ? _ = cs(t, n, _) : F.touch && n === "dblclick" ? _ = ys(t, _) : "addEventListener" in t ? n === "touchstart" || n === "touchmove" || n === "wheel" || n === "mousewheel" ? t.addEventListener(io[n] || n, _, F.passiveEvents ? { passive: !1 } : !1) : n === "mouseenter" || n === "mouseleave" ? (_ = function(
|
|
1354
|
-
|
|
1355
|
-
}, t.addEventListener(io[n], _, !1)) : t.addEventListener(n,
|
|
1346
|
+
var _ = function(A) {
|
|
1347
|
+
return h.call(u || t, A || window.event);
|
|
1348
|
+
}, k = _;
|
|
1349
|
+
!F.touchNative && F.pointer && n.indexOf("touch") === 0 ? _ = cs(t, n, _) : F.touch && n === "dblclick" ? _ = ys(t, _) : "addEventListener" in t ? n === "touchstart" || n === "touchmove" || n === "wheel" || n === "mousewheel" ? t.addEventListener(io[n] || n, _, F.passiveEvents ? { passive: !1 } : !1) : n === "mouseenter" || n === "mouseleave" ? (_ = function(A) {
|
|
1350
|
+
A = A || window.event, ao(t, A) && k(A);
|
|
1351
|
+
}, t.addEventListener(io[n], _, !1)) : t.addEventListener(n, k, !1) : t.attachEvent("on" + n, _), t[Ct] = t[Ct] || {}, t[Ct][f] = _;
|
|
1356
1352
|
}
|
|
1357
1353
|
function no(t, n, h, u, f) {
|
|
1358
1354
|
f = f || n + d(h) + (u ? "_" + d(u) : "");
|
|
@@ -1558,7 +1554,7 @@ function ha() {
|
|
|
1558
1554
|
trackResize: !0
|
|
1559
1555
|
},
|
|
1560
1556
|
initialize: function(t, n) {
|
|
1561
|
-
n =
|
|
1557
|
+
n = b(this, n), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(t), this._initLayout(), this._onResize = s(this._onResize, this), this._initEvents(), n.maxBounds && this.setMaxBounds(n.maxBounds), n.zoom !== void 0 && (this._zoom = this._limitZoom(n.zoom)), n.center && n.zoom !== void 0 && this.setView(X(n.center), n.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = Ae && F.any3d && !F.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), J(this._proxy, Cn, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
|
|
1562
1558
|
},
|
|
1563
1559
|
// @section Methods for modifying map state
|
|
1564
1560
|
// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this
|
|
@@ -1595,8 +1591,8 @@ function ha() {
|
|
|
1595
1591
|
// @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this
|
|
1596
1592
|
// Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
|
|
1597
1593
|
setZoomAround: function(t, n, h) {
|
|
1598
|
-
var u = this.getZoomScale(n), f = this.getSize().divideBy(2), _ = t instanceof q ? t : this.latLngToContainerPoint(t),
|
|
1599
|
-
return this.setView(
|
|
1594
|
+
var u = this.getZoomScale(n), f = this.getSize().divideBy(2), _ = t instanceof q ? t : this.latLngToContainerPoint(t), k = _.subtract(f).multiplyBy(1 - 1 / u), A = this.containerPointToLatLng(f.add(k));
|
|
1595
|
+
return this.setView(A, n, { zoom: h });
|
|
1600
1596
|
},
|
|
1601
1597
|
_getBoundsCenterZoom: function(t, n) {
|
|
1602
1598
|
n = n || {}, t = t.getBounds ? t.getBounds() : st(t);
|
|
@@ -1606,7 +1602,7 @@ function ha() {
|
|
|
1606
1602
|
center: t.getCenter(),
|
|
1607
1603
|
zoom: f
|
|
1608
1604
|
};
|
|
1609
|
-
var _ = u.subtract(h).divideBy(2),
|
|
1605
|
+
var _ = u.subtract(h).divideBy(2), k = this.project(t.getSouthWest(), f), A = this.project(t.getNorthEast(), f), C = this.unproject(k.add(A).divideBy(2).add(_), f);
|
|
1610
1606
|
return {
|
|
1611
1607
|
center: C,
|
|
1612
1608
|
zoom: f
|
|
@@ -1657,11 +1653,11 @@ function ha() {
|
|
|
1657
1653
|
if (h = h || {}, h.animate === !1 || !F.any3d)
|
|
1658
1654
|
return this.setView(t, n, h);
|
|
1659
1655
|
this._stop();
|
|
1660
|
-
var u = this.project(this.getCenter()), f = this.project(t), _ = this.getSize(),
|
|
1661
|
-
t = X(t), n = n === void 0 ?
|
|
1662
|
-
var
|
|
1656
|
+
var u = this.project(this.getCenter()), f = this.project(t), _ = this.getSize(), k = this._zoom;
|
|
1657
|
+
t = X(t), n = n === void 0 ? k : n;
|
|
1658
|
+
var A = Math.max(_.x, _.y), C = A * this.getZoomScale(k, n), B = f.distanceTo(u) || 1, N = 1.42, H = N * N;
|
|
1663
1659
|
function Y(ht) {
|
|
1664
|
-
var _i = ht ? -1 : 1, ul = ht ? C :
|
|
1660
|
+
var _i = ht ? -1 : 1, ul = ht ? C : A, dl = C * C - A * A + _i * H * H * B * B, fl = 2 * ul * H * B, yo = dl / fl, gr = Math.sqrt(yo * yo + 1) - yo, pl = gr < 1e-9 ? -18 : Math.log(gr);
|
|
1665
1661
|
return pl;
|
|
1666
1662
|
}
|
|
1667
1663
|
function gt(ht) {
|
|
@@ -1675,10 +1671,10 @@ function ha() {
|
|
|
1675
1671
|
}
|
|
1676
1672
|
var wt = Y(0);
|
|
1677
1673
|
function me(ht) {
|
|
1678
|
-
return
|
|
1674
|
+
return A * (ct(wt) / ct(wt + N * ht));
|
|
1679
1675
|
}
|
|
1680
1676
|
function sl(ht) {
|
|
1681
|
-
return
|
|
1677
|
+
return A * (ct(wt) * Et(wt + N * ht) - gt(wt)) / H;
|
|
1682
1678
|
}
|
|
1683
1679
|
function ll(ht) {
|
|
1684
1680
|
return 1 - Math.pow(1 - ht, 1.5);
|
|
@@ -1687,8 +1683,8 @@ function ha() {
|
|
|
1687
1683
|
function mr() {
|
|
1688
1684
|
var ht = (Date.now() - hl) / cl, _i = ll(ht) * pr;
|
|
1689
1685
|
ht <= 1 ? (this._flyToFrame = R(mr, this), this._move(
|
|
1690
|
-
this.unproject(u.add(f.subtract(u).multiplyBy(sl(_i) /
|
|
1691
|
-
this.getScaleZoom(
|
|
1686
|
+
this.unproject(u.add(f.subtract(u).multiplyBy(sl(_i) / B)), k),
|
|
1687
|
+
this.getScaleZoom(A / me(_i), k),
|
|
1692
1688
|
{ flyTo: !0 }
|
|
1693
1689
|
)) : this._move(t, n)._moveEnd(!0);
|
|
1694
1690
|
}
|
|
@@ -1732,11 +1728,11 @@ function ha() {
|
|
|
1732
1728
|
// the map will not be panned.
|
|
1733
1729
|
panInside: function(t, n) {
|
|
1734
1730
|
n = n || {};
|
|
1735
|
-
var h = V(n.paddingTopLeft || n.padding || [0, 0]), u = V(n.paddingBottomRight || n.padding || [0, 0]), f = this.project(this.getCenter()), _ = this.project(t),
|
|
1736
|
-
if (!
|
|
1731
|
+
var h = V(n.paddingTopLeft || n.padding || [0, 0]), u = V(n.paddingBottomRight || n.padding || [0, 0]), f = this.project(this.getCenter()), _ = this.project(t), k = this.getPixelBounds(), A = bt([k.min.add(h), k.max.subtract(u)]), C = A.getSize();
|
|
1732
|
+
if (!A.contains(_)) {
|
|
1737
1733
|
this._enforcingBounds = !0;
|
|
1738
|
-
var
|
|
1739
|
-
f.x +=
|
|
1734
|
+
var B = _.subtract(A.getCenter()), N = A.extend(_).getSize().subtract(C);
|
|
1735
|
+
f.x += B.x < 0 ? -N.x : N.x, f.y += B.y < 0 ? -N.y : N.y, this.panTo(this.unproject(f), n), this._enforcingBounds = !1;
|
|
1740
1736
|
}
|
|
1741
1737
|
return this;
|
|
1742
1738
|
},
|
|
@@ -1818,17 +1814,17 @@ function ha() {
|
|
|
1818
1814
|
if (this._container._leaflet_id) {
|
|
1819
1815
|
var n = t.coords.latitude, h = t.coords.longitude, u = new tt(n, h), f = u.toBounds(t.coords.accuracy * 2), _ = this._locateOptions;
|
|
1820
1816
|
if (_.setView) {
|
|
1821
|
-
var
|
|
1822
|
-
this.setView(u, _.maxZoom ? Math.min(
|
|
1817
|
+
var k = this.getBoundsZoom(f);
|
|
1818
|
+
this.setView(u, _.maxZoom ? Math.min(k, _.maxZoom) : k);
|
|
1823
1819
|
}
|
|
1824
|
-
var
|
|
1820
|
+
var A = {
|
|
1825
1821
|
latlng: u,
|
|
1826
1822
|
bounds: f,
|
|
1827
1823
|
timestamp: t.timestamp
|
|
1828
1824
|
};
|
|
1829
1825
|
for (var C in t.coords)
|
|
1830
|
-
typeof t.coords[C] == "number" && (
|
|
1831
|
-
this.fire("locationfound",
|
|
1826
|
+
typeof t.coords[C] == "number" && (A[C] = t.coords[C]);
|
|
1827
|
+
this.fire("locationfound", A);
|
|
1832
1828
|
}
|
|
1833
1829
|
},
|
|
1834
1830
|
// TODO Appropriate docs section?
|
|
@@ -1902,7 +1898,7 @@ function ha() {
|
|
|
1902
1898
|
// the given bounds in its entirety.
|
|
1903
1899
|
getBoundsZoom: function(t, n, h) {
|
|
1904
1900
|
t = st(t), h = V(h || [0, 0]);
|
|
1905
|
-
var u = this.getZoom() || 0, f = this.getMinZoom(), _ = this.getMaxZoom(),
|
|
1901
|
+
var u = this.getZoom() || 0, f = this.getMinZoom(), _ = this.getMaxZoom(), k = t.getNorthWest(), A = t.getSouthEast(), C = this.getSize().subtract(h), B = bt(this.project(A, u), this.project(k, u)).getSize(), N = F.any3d ? this.options.zoomSnap : 1, H = C.x / B.x, Y = C.y / B.y, gt = n ? Math.max(H, Y) : Math.min(H, Y);
|
|
1906
1902
|
return u = this.getScaleZoom(gt, u), N && (u = Math.round(u / (N / 100)) * (N / 100), u = n ? Math.ceil(u / N) * N : Math.floor(u / N) * N), Math.max(f, Math.min(_, u));
|
|
1907
1903
|
},
|
|
1908
1904
|
// @method getSize(): Point
|
|
@@ -2142,16 +2138,16 @@ function ha() {
|
|
|
2142
2138
|
Math.max(Math.abs(t.x), Math.abs(t.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom());
|
|
2143
2139
|
},
|
|
2144
2140
|
_findEventTargets: function(t, n) {
|
|
2145
|
-
for (var h = [], u, f = n === "mouseout" || n === "mouseover", _ = t.target || t.srcElement,
|
|
2141
|
+
for (var h = [], u, f = n === "mouseout" || n === "mouseover", _ = t.target || t.srcElement, k = !1; _; ) {
|
|
2146
2142
|
if (u = this._targets[d(_)], u && (n === "click" || n === "preclick") && this._draggableMoved(u)) {
|
|
2147
|
-
|
|
2143
|
+
k = !0;
|
|
2148
2144
|
break;
|
|
2149
2145
|
}
|
|
2150
2146
|
if (u && u.listens(n, !0) && (f && !ao(_, t) || (h.push(u), f)) || _ === this._container)
|
|
2151
2147
|
break;
|
|
2152
2148
|
_ = _.parentNode;
|
|
2153
2149
|
}
|
|
2154
|
-
return !h.length && !
|
|
2150
|
+
return !h.length && !k && !f && this.listens(n, !0) && (h = [this]), h;
|
|
2155
2151
|
},
|
|
2156
2152
|
_isClickDisabled: function(t) {
|
|
2157
2153
|
for (; t && t !== this._container; ) {
|
|
@@ -2175,21 +2171,21 @@ function ha() {
|
|
|
2175
2171
|
}
|
|
2176
2172
|
var f = this._findEventTargets(t, n);
|
|
2177
2173
|
if (h) {
|
|
2178
|
-
for (var _ = [],
|
|
2179
|
-
h[
|
|
2174
|
+
for (var _ = [], k = 0; k < h.length; k++)
|
|
2175
|
+
h[k].listens(n, !0) && _.push(h[k]);
|
|
2180
2176
|
f = _.concat(f);
|
|
2181
2177
|
}
|
|
2182
2178
|
if (f.length) {
|
|
2183
2179
|
n === "contextmenu" && dt(t);
|
|
2184
|
-
var
|
|
2180
|
+
var A = f[0], C = {
|
|
2185
2181
|
originalEvent: t
|
|
2186
2182
|
};
|
|
2187
2183
|
if (t.type !== "keypress" && t.type !== "keydown" && t.type !== "keyup") {
|
|
2188
|
-
var
|
|
2189
|
-
C.containerPoint =
|
|
2184
|
+
var B = A.getLatLng && (!A._radius || A._radius <= 10);
|
|
2185
|
+
C.containerPoint = B ? this.latLngToContainerPoint(A.getLatLng()) : this.mouseEventToContainerPoint(t), C.layerPoint = this.containerPointToLayerPoint(C.containerPoint), C.latlng = B ? A.getLatLng() : this.layerPointToLatLng(C.layerPoint);
|
|
2190
2186
|
}
|
|
2191
|
-
for (
|
|
2192
|
-
if (f[
|
|
2187
|
+
for (k = 0; k < f.length; k++)
|
|
2188
|
+
if (f[k].fire(n, C, !0), C.originalEvent._stopped || f[k].options.bubblingMouseEvents === !1 && S(this._mouseEvents, n) !== -1)
|
|
2193
2189
|
return;
|
|
2194
2190
|
}
|
|
2195
2191
|
},
|
|
@@ -2249,8 +2245,8 @@ function ha() {
|
|
|
2249
2245
|
_limitCenter: function(t, n, h) {
|
|
2250
2246
|
if (!h)
|
|
2251
2247
|
return t;
|
|
2252
|
-
var u = this.project(t, n), f = this.getSize().divideBy(2), _ = new it(u.subtract(f), u.add(f)),
|
|
2253
|
-
return Math.abs(
|
|
2248
|
+
var u = this.project(t, n), f = this.getSize().divideBy(2), _ = new it(u.subtract(f), u.add(f)), k = this._getBoundsOffset(_, h, n);
|
|
2249
|
+
return Math.abs(k.x) <= 1 && Math.abs(k.y) <= 1 ? t : this.unproject(u.add(k), n);
|
|
2254
2250
|
},
|
|
2255
2251
|
// adjust offset for view to get inside bounds
|
|
2256
2252
|
_limitOffset: function(t, n) {
|
|
@@ -2264,8 +2260,8 @@ function ha() {
|
|
|
2264
2260
|
var u = bt(
|
|
2265
2261
|
this.project(n.getNorthEast(), h),
|
|
2266
2262
|
this.project(n.getSouthWest(), h)
|
|
2267
|
-
), f = u.min.subtract(t.min), _ = u.max.subtract(t.max),
|
|
2268
|
-
return new q(
|
|
2263
|
+
), f = u.min.subtract(t.min), _ = u.max.subtract(t.max), k = this._rebound(f.x, -_.x), A = this._rebound(f.y, -_.y);
|
|
2264
|
+
return new q(k, A);
|
|
2269
2265
|
},
|
|
2270
2266
|
_rebound: function(t, n) {
|
|
2271
2267
|
return t + n > 0 ? Math.round(t - n) / 2 : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(n));
|
|
@@ -2338,7 +2334,7 @@ function ha() {
|
|
|
2338
2334
|
position: "topright"
|
|
2339
2335
|
},
|
|
2340
2336
|
initialize: function(t) {
|
|
2341
|
-
|
|
2337
|
+
b(this, t);
|
|
2342
2338
|
},
|
|
2343
2339
|
/* @section
|
|
2344
2340
|
* Classes extending L.Control will inherit the following methods:
|
|
@@ -2392,8 +2388,8 @@ function ha() {
|
|
|
2392
2388
|
_initControlPos: function() {
|
|
2393
2389
|
var t = this._controlCorners = {}, n = "leaflet-", h = this._controlContainer = $("div", n + "control-container", this._container);
|
|
2394
2390
|
function u(f, _) {
|
|
2395
|
-
var
|
|
2396
|
-
t[f + _] = $("div",
|
|
2391
|
+
var k = n + f + " " + n + _;
|
|
2392
|
+
t[f + _] = $("div", k, h);
|
|
2397
2393
|
}
|
|
2398
2394
|
u("top", "left"), u("top", "right"), u("bottom", "left"), u("bottom", "right");
|
|
2399
2395
|
},
|
|
@@ -2432,7 +2428,7 @@ function ha() {
|
|
|
2432
2428
|
}
|
|
2433
2429
|
},
|
|
2434
2430
|
initialize: function(t, n, h) {
|
|
2435
|
-
|
|
2431
|
+
b(this, h), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
|
|
2436
2432
|
for (var u in t)
|
|
2437
2433
|
this._addLayer(t[u], u);
|
|
2438
2434
|
for (u in n)
|
|
@@ -2540,8 +2536,8 @@ function ha() {
|
|
|
2540
2536
|
f.innerHTML = " " + t.name;
|
|
2541
2537
|
var _ = document.createElement("span");
|
|
2542
2538
|
n.appendChild(_), _.appendChild(u), _.appendChild(f);
|
|
2543
|
-
var
|
|
2544
|
-
return
|
|
2539
|
+
var k = t.overlay ? this._overlaysList : this._baseLayersList;
|
|
2540
|
+
return k.appendChild(n), this._checkDisabledLayers(), n;
|
|
2545
2541
|
},
|
|
2546
2542
|
_onInputClick: function() {
|
|
2547
2543
|
if (!this._preventClick) {
|
|
@@ -2702,7 +2698,7 @@ function ha() {
|
|
|
2702
2698
|
prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (F.inlineSvg ? Ts + " " : "") + "Leaflet</a>"
|
|
2703
2699
|
},
|
|
2704
2700
|
initialize: function(t) {
|
|
2705
|
-
|
|
2701
|
+
b(this, t), this._attributions = {};
|
|
2706
2702
|
},
|
|
2707
2703
|
onAdd: function(t) {
|
|
2708
2704
|
t.attributionControl = this, this._container = $("div", "leaflet-control-attribution"), Ie(this._container);
|
|
@@ -2793,7 +2789,7 @@ function ha() {
|
|
|
2793
2789
|
// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
|
|
2794
2790
|
// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
|
|
2795
2791
|
initialize: function(t, n, h, u) {
|
|
2796
|
-
|
|
2792
|
+
b(this, u), this._element = t, this._dragStartTarget = n || t, this._preventOutline = h;
|
|
2797
2793
|
},
|
|
2798
2794
|
// @method enable()
|
|
2799
2795
|
// Enables the dragging ability
|
|
@@ -2847,18 +2843,18 @@ function ha() {
|
|
|
2847
2843
|
}
|
|
2848
2844
|
});
|
|
2849
2845
|
function Fn(t, n, h) {
|
|
2850
|
-
var u, f = [1, 4, 2, 8], _,
|
|
2846
|
+
var u, f = [1, 4, 2, 8], _, k, A, C, B, N, H, Y;
|
|
2851
2847
|
for (_ = 0, N = t.length; _ < N; _++)
|
|
2852
2848
|
t[_]._code = ee(t[_], n);
|
|
2853
|
-
for (
|
|
2854
|
-
for (H = f[
|
|
2855
|
-
C = t[_],
|
|
2849
|
+
for (A = 0; A < 4; A++) {
|
|
2850
|
+
for (H = f[A], u = [], _ = 0, N = t.length, k = N - 1; _ < N; k = _++)
|
|
2851
|
+
C = t[_], B = t[k], C._code & H ? B._code & H || (Y = ai(B, C, H, n, h), Y._code = ee(Y, n), u.push(Y)) : (B._code & H && (Y = ai(B, C, H, n, h), Y._code = ee(Y, n), u.push(Y)), u.push(C));
|
|
2856
2852
|
t = u;
|
|
2857
2853
|
}
|
|
2858
2854
|
return t;
|
|
2859
2855
|
}
|
|
2860
2856
|
function Gn(t, n) {
|
|
2861
|
-
var h, u, f, _,
|
|
2857
|
+
var h, u, f, _, k, A, C, B, N;
|
|
2862
2858
|
if (!t || t.length === 0)
|
|
2863
2859
|
throw new Error("latlngs not passed");
|
|
2864
2860
|
xt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
|
|
@@ -2869,9 +2865,9 @@ function ha() {
|
|
|
2869
2865
|
var wt = X(t[h]);
|
|
2870
2866
|
Et.push(n.project(X([wt.lat - H.lat, wt.lng - H.lng])));
|
|
2871
2867
|
}
|
|
2872
|
-
for (
|
|
2873
|
-
f = Et[h], _ = Et[u],
|
|
2874
|
-
|
|
2868
|
+
for (A = C = B = 0, h = 0, u = ct - 1; h < ct; u = h++)
|
|
2869
|
+
f = Et[h], _ = Et[u], k = f.y * _.x - _.y * f.x, C += (f.x + _.x) * k, B += (f.y + _.y) * k, A += k * 3;
|
|
2870
|
+
A === 0 ? N = Et[0] : N = [C / A, B / A];
|
|
2875
2871
|
var me = n.unproject(V(N));
|
|
2876
2872
|
return X([me.lat + H.lat, me.lng + H.lng]);
|
|
2877
2873
|
}
|
|
@@ -2903,16 +2899,16 @@ function ha() {
|
|
|
2903
2899
|
function Os(t, n) {
|
|
2904
2900
|
var h = t.length, u = typeof Uint8Array != "undefined" ? Uint8Array : Array, f = new u(h);
|
|
2905
2901
|
f[0] = f[h - 1] = 1, co(t, f, n, 0, h - 1);
|
|
2906
|
-
var _,
|
|
2902
|
+
var _, k = [];
|
|
2907
2903
|
for (_ = 0; _ < h; _++)
|
|
2908
|
-
f[_] &&
|
|
2909
|
-
return
|
|
2904
|
+
f[_] && k.push(t[_]);
|
|
2905
|
+
return k;
|
|
2910
2906
|
}
|
|
2911
2907
|
function co(t, n, h, u, f) {
|
|
2912
|
-
var _ = 0,
|
|
2913
|
-
for (
|
|
2914
|
-
C = De(t[
|
|
2915
|
-
_ > h && (n[
|
|
2908
|
+
var _ = 0, k, A, C;
|
|
2909
|
+
for (A = u + 1; A <= f - 1; A++)
|
|
2910
|
+
C = De(t[A], t[u], t[f], !0), C > _ && (k = A, _ = C);
|
|
2911
|
+
_ > h && (n[k] = 1, co(t, n, h, u, k), co(t, n, h, k, f));
|
|
2916
2912
|
}
|
|
2917
2913
|
function Ds(t, n) {
|
|
2918
2914
|
for (var h = [t[0]], u = 1, f = 0, _ = t.length; u < _; u++)
|
|
@@ -2921,18 +2917,18 @@ function ha() {
|
|
|
2921
2917
|
}
|
|
2922
2918
|
var Vn;
|
|
2923
2919
|
function qn(t, n, h, u, f) {
|
|
2924
|
-
var _ = u ? Vn : ee(t, h),
|
|
2925
|
-
for (Vn =
|
|
2926
|
-
if (!(_ |
|
|
2920
|
+
var _ = u ? Vn : ee(t, h), k = ee(n, h), A, C, B;
|
|
2921
|
+
for (Vn = k; ; ) {
|
|
2922
|
+
if (!(_ | k))
|
|
2927
2923
|
return [t, n];
|
|
2928
|
-
if (_ &
|
|
2924
|
+
if (_ & k)
|
|
2929
2925
|
return !1;
|
|
2930
|
-
|
|
2926
|
+
A = _ || k, C = ai(t, n, A, h, f), B = ee(C, h), A === _ ? (t = C, _ = B) : (n = C, k = B);
|
|
2931
2927
|
}
|
|
2932
2928
|
}
|
|
2933
2929
|
function ai(t, n, h, u, f) {
|
|
2934
|
-
var _ = n.x - t.x,
|
|
2935
|
-
return h & 8 ? (
|
|
2930
|
+
var _ = n.x - t.x, k = n.y - t.y, A = u.min, C = u.max, B, N;
|
|
2931
|
+
return h & 8 ? (B = t.x + _ * (C.y - t.y) / k, N = C.y) : h & 4 ? (B = t.x + _ * (A.y - t.y) / k, N = A.y) : h & 2 ? (B = C.x, N = t.y + k * (C.x - t.x) / _) : h & 1 && (B = A.x, N = t.y + k * (A.x - t.x) / _), new q(B, N, f);
|
|
2936
2932
|
}
|
|
2937
2933
|
function ee(t, n) {
|
|
2938
2934
|
var h = 0;
|
|
@@ -2943,17 +2939,17 @@ function ha() {
|
|
|
2943
2939
|
return h * h + u * u;
|
|
2944
2940
|
}
|
|
2945
2941
|
function De(t, n, h, u) {
|
|
2946
|
-
var f = n.x, _ = n.y,
|
|
2947
|
-
return C > 0 && (
|
|
2942
|
+
var f = n.x, _ = n.y, k = h.x - f, A = h.y - _, C = k * k + A * A, B;
|
|
2943
|
+
return C > 0 && (B = ((t.x - f) * k + (t.y - _) * A) / C, B > 1 ? (f = h.x, _ = h.y) : B > 0 && (f += k * B, _ += A * B)), k = t.x - f, A = t.y - _, u ? k * k + A * A : new q(f, _);
|
|
2948
2944
|
}
|
|
2949
2945
|
function xt(t) {
|
|
2950
|
-
return !
|
|
2946
|
+
return !M(t[0]) || typeof t[0][0] != "object" && typeof t[0][0] != "undefined";
|
|
2951
2947
|
}
|
|
2952
2948
|
function Jn(t) {
|
|
2953
2949
|
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), xt(t);
|
|
2954
2950
|
}
|
|
2955
2951
|
function Wn(t, n) {
|
|
2956
|
-
var h, u, f, _,
|
|
2952
|
+
var h, u, f, _, k, A, C, B;
|
|
2957
2953
|
if (!t || t.length === 0)
|
|
2958
2954
|
throw new Error("latlngs not passed");
|
|
2959
2955
|
xt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
|
|
@@ -2967,17 +2963,17 @@ function ha() {
|
|
|
2967
2963
|
for (h = 0, u = 0; h < gt - 1; h++)
|
|
2968
2964
|
u += ct[h].distanceTo(ct[h + 1]) / 2;
|
|
2969
2965
|
if (u === 0)
|
|
2970
|
-
|
|
2966
|
+
B = ct[0];
|
|
2971
2967
|
else
|
|
2972
2968
|
for (h = 0, _ = 0; h < gt - 1; h++)
|
|
2973
|
-
if (
|
|
2974
|
-
C = (_ - u) / f,
|
|
2975
|
-
|
|
2976
|
-
|
|
2969
|
+
if (k = ct[h], A = ct[h + 1], f = k.distanceTo(A), _ += f, _ > u) {
|
|
2970
|
+
C = (_ - u) / f, B = [
|
|
2971
|
+
A.x - C * (A.x - k.x),
|
|
2972
|
+
A.y - C * (A.y - k.y)
|
|
2977
2973
|
];
|
|
2978
2974
|
break;
|
|
2979
2975
|
}
|
|
2980
|
-
var wt = n.unproject(V(
|
|
2976
|
+
var wt = n.unproject(V(B));
|
|
2981
2977
|
return X([wt.lat + N.lat, wt.lng + N.lng]);
|
|
2982
2978
|
}
|
|
2983
2979
|
var Bs = {
|
|
@@ -3005,13 +3001,13 @@ function ha() {
|
|
|
3005
3001
|
R_MINOR: 6356752314245179e-9,
|
|
3006
3002
|
bounds: new it([-2003750834279e-5, -1549657073972e-5], [2003750834279e-5, 1876465623138e-5]),
|
|
3007
3003
|
project: function(t) {
|
|
3008
|
-
var n = Math.PI / 180, h = this.R, u = t.lat * n, f = this.R_MINOR / h, _ = Math.sqrt(1 - f * f),
|
|
3009
|
-
return u = -h * Math.log(Math.max(
|
|
3004
|
+
var n = Math.PI / 180, h = this.R, u = t.lat * n, f = this.R_MINOR / h, _ = Math.sqrt(1 - f * f), k = _ * Math.sin(u), A = Math.tan(Math.PI / 4 - u / 2) / Math.pow((1 - k) / (1 + k), _ / 2);
|
|
3005
|
+
return u = -h * Math.log(Math.max(A, 1e-10)), new q(t.lng * n * h, u);
|
|
3010
3006
|
},
|
|
3011
3007
|
unproject: function(t) {
|
|
3012
|
-
for (var n = 180 / Math.PI, h = this.R, u = this.R_MINOR / h, f = Math.sqrt(1 - u * u), _ = Math.exp(-t.y / h),
|
|
3013
|
-
|
|
3014
|
-
return new tt(
|
|
3008
|
+
for (var n = 180 / Math.PI, h = this.R, u = this.R_MINOR / h, f = Math.sqrt(1 - u * u), _ = Math.exp(-t.y / h), k = Math.PI / 2 - 2 * Math.atan(_), A = 0, C = 0.1, B; A < 15 && Math.abs(C) > 1e-7; A++)
|
|
3009
|
+
B = f * Math.sin(k), B = Math.pow((1 - B) / (1 + B), f / 2), C = Math.PI / 2 - 2 * Math.atan(_ * B) - k, k += C;
|
|
3010
|
+
return new tt(k * n, t.x * n / h);
|
|
3015
3011
|
}
|
|
3016
3012
|
}, Rs = {
|
|
3017
3013
|
__proto__: null,
|
|
@@ -3142,7 +3138,7 @@ function ha() {
|
|
|
3142
3138
|
return this;
|
|
3143
3139
|
},
|
|
3144
3140
|
_addLayers: function(t) {
|
|
3145
|
-
t = t ?
|
|
3141
|
+
t = t ? M(t) ? t : [t] : [];
|
|
3146
3142
|
for (var n = 0, h = t.length; n < h; n++)
|
|
3147
3143
|
this.addLayer(t[n]);
|
|
3148
3144
|
},
|
|
@@ -3164,7 +3160,7 @@ function ha() {
|
|
|
3164
3160
|
});
|
|
3165
3161
|
var ce = At.extend({
|
|
3166
3162
|
initialize: function(t, n) {
|
|
3167
|
-
|
|
3163
|
+
b(this, n), this._layers = {};
|
|
3168
3164
|
var h, u;
|
|
3169
3165
|
if (t)
|
|
3170
3166
|
for (h = 0, u = t.length; h < u; h++)
|
|
@@ -3334,7 +3330,7 @@ function ha() {
|
|
|
3334
3330
|
crossOrigin: !1
|
|
3335
3331
|
},
|
|
3336
3332
|
initialize: function(t) {
|
|
3337
|
-
|
|
3333
|
+
b(this, t);
|
|
3338
3334
|
},
|
|
3339
3335
|
// @method createIcon(oldIcon?: HTMLElement): HTMLElement
|
|
3340
3336
|
// Called internally when the icon has to be shown, returns a `<img>` HTML element
|
|
@@ -3426,16 +3422,16 @@ function ha() {
|
|
|
3426
3422
|
return this._draggable && this._draggable._moved;
|
|
3427
3423
|
},
|
|
3428
3424
|
_adjustPan: function(t) {
|
|
3429
|
-
var n = this._marker, h = n._map, u = this._marker.options.autoPanSpeed, f = this._marker.options.autoPanPadding, _ = Qt(n._icon),
|
|
3430
|
-
|
|
3431
|
-
|
|
3425
|
+
var n = this._marker, h = n._map, u = this._marker.options.autoPanSpeed, f = this._marker.options.autoPanPadding, _ = Qt(n._icon), k = h.getPixelBounds(), A = h.getPixelOrigin(), C = bt(
|
|
3426
|
+
k.min._subtract(A).add(f),
|
|
3427
|
+
k.max._subtract(A).subtract(f)
|
|
3432
3428
|
);
|
|
3433
3429
|
if (!C.contains(_)) {
|
|
3434
|
-
var
|
|
3435
|
-
(Math.max(C.max.x, _.x) - C.max.x) / (
|
|
3436
|
-
(Math.max(C.max.y, _.y) - C.max.y) / (
|
|
3430
|
+
var B = V(
|
|
3431
|
+
(Math.max(C.max.x, _.x) - C.max.x) / (k.max.x - C.max.x) - (Math.min(C.min.x, _.x) - C.min.x) / (k.min.x - C.min.x),
|
|
3432
|
+
(Math.max(C.max.y, _.y) - C.max.y) / (k.max.y - C.max.y) - (Math.min(C.min.y, _.y) - C.min.y) / (k.min.y - C.min.y)
|
|
3437
3433
|
).multiplyBy(u);
|
|
3438
|
-
h.panBy(
|
|
3434
|
+
h.panBy(B, { animate: !1 }), this._draggable._newPos._add(B), this._draggable._startPos._add(B), lt(n._icon, this._draggable._newPos), this._onDrag(t), this._panRequest = R(this._adjustPan.bind(this, t));
|
|
3439
3435
|
}
|
|
3440
3436
|
},
|
|
3441
3437
|
_onDragStart: function() {
|
|
@@ -3520,7 +3516,7 @@ function ha() {
|
|
|
3520
3516
|
* In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
|
|
3521
3517
|
*/
|
|
3522
3518
|
initialize: function(t, n) {
|
|
3523
|
-
|
|
3519
|
+
b(this, n), this._latlng = X(t);
|
|
3524
3520
|
},
|
|
3525
3521
|
onAdd: function(t) {
|
|
3526
3522
|
this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update();
|
|
@@ -3704,7 +3700,7 @@ function ha() {
|
|
|
3704
3700
|
// @method setStyle(style: Path options): this
|
|
3705
3701
|
// Changes the appearance of a Path based on the options in the `Path options` object.
|
|
3706
3702
|
setStyle: function(t) {
|
|
3707
|
-
return
|
|
3703
|
+
return b(this, t), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && t && Object.prototype.hasOwnProperty.call(t, "weight") && this._updateBounds()), this;
|
|
3708
3704
|
},
|
|
3709
3705
|
// @method bringToFront(): this
|
|
3710
3706
|
// Brings the layer to the top of all path layers.
|
|
@@ -3735,7 +3731,7 @@ function ha() {
|
|
|
3735
3731
|
radius: 10
|
|
3736
3732
|
},
|
|
3737
3733
|
initialize: function(t, n) {
|
|
3738
|
-
|
|
3734
|
+
b(this, n), this._latlng = X(t), this._radius = this.options.radius;
|
|
3739
3735
|
},
|
|
3740
3736
|
// @method setLatLng(latLng: LatLng): this
|
|
3741
3737
|
// Sets the position of a circle marker to a new location.
|
|
@@ -3788,7 +3784,7 @@ function ha() {
|
|
|
3788
3784
|
}
|
|
3789
3785
|
var po = li.extend({
|
|
3790
3786
|
initialize: function(t, n, h) {
|
|
3791
|
-
if (typeof n == "number" && (n = i({}, h, { radius: n })),
|
|
3787
|
+
if (typeof n == "number" && (n = i({}, h, { radius: n })), b(this, n), this._latlng = X(t), isNaN(this.options.radius))
|
|
3792
3788
|
throw new Error("Circle radius cannot be NaN");
|
|
3793
3789
|
this._mRadius = this.options.radius;
|
|
3794
3790
|
},
|
|
@@ -3815,8 +3811,8 @@ function ha() {
|
|
|
3815
3811
|
_project: function() {
|
|
3816
3812
|
var t = this._latlng.lng, n = this._latlng.lat, h = this._map, u = h.options.crs;
|
|
3817
3813
|
if (u.distance === Jt.distance) {
|
|
3818
|
-
var f = Math.PI / 180, _ = this._mRadius / Jt.R / f,
|
|
3819
|
-
(isNaN(N) || N === 0) && (N = _ / Math.cos(Math.PI / 180 * n)), this._point = C.subtract(h.getPixelOrigin()), this._radius = isNaN(N) ? 0 : C.x - h.project([
|
|
3814
|
+
var f = Math.PI / 180, _ = this._mRadius / Jt.R / f, k = h.project([n + _, t]), A = h.project([n - _, t]), C = k.add(A).divideBy(2), B = h.unproject(C).lat, N = Math.acos((Math.cos(_ * f) - Math.sin(n * f) * Math.sin(B * f)) / (Math.cos(n * f) * Math.cos(B * f))) / f;
|
|
3815
|
+
(isNaN(N) || N === 0) && (N = _ / Math.cos(Math.PI / 180 * n)), this._point = C.subtract(h.getPixelOrigin()), this._radius = isNaN(N) ? 0 : C.x - h.project([B, t - N]).x, this._radiusY = C.y - k.y;
|
|
3820
3816
|
} else {
|
|
3821
3817
|
var H = u.unproject(u.project(this._latlng).subtract([this._mRadius, 0]));
|
|
3822
3818
|
this._point = h.latLngToLayerPoint(this._latlng), this._radius = this._point.x - h.latLngToLayerPoint(H).x;
|
|
@@ -3840,7 +3836,7 @@ function ha() {
|
|
|
3840
3836
|
noClip: !1
|
|
3841
3837
|
},
|
|
3842
3838
|
initialize: function(t, n) {
|
|
3843
|
-
|
|
3839
|
+
b(this, n), this._setLatLngs(t);
|
|
3844
3840
|
},
|
|
3845
3841
|
// @method getLatLngs(): LatLng[]
|
|
3846
3842
|
// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
|
|
@@ -3860,9 +3856,9 @@ function ha() {
|
|
|
3860
3856
|
// @method closestLayerPoint(p: Point): Point
|
|
3861
3857
|
// Returns the point closest to `p` on the Polyline.
|
|
3862
3858
|
closestLayerPoint: function(t) {
|
|
3863
|
-
for (var n = 1 / 0, h = null, u = De, f, _,
|
|
3864
|
-
for (var C = this._parts[
|
|
3865
|
-
f = C[
|
|
3859
|
+
for (var n = 1 / 0, h = null, u = De, f, _, k = 0, A = this._parts.length; k < A; k++)
|
|
3860
|
+
for (var C = this._parts[k], B = 1, N = C.length; B < N; B++) {
|
|
3861
|
+
f = C[B - 1], _ = C[B];
|
|
3866
3862
|
var H = u(t, f, _, !0);
|
|
3867
3863
|
H < n && (n = H, h = u(t, f, _));
|
|
3868
3864
|
}
|
|
@@ -3912,11 +3908,11 @@ function ha() {
|
|
|
3912
3908
|
},
|
|
3913
3909
|
// recursively turns latlngs into a set of rings with projected coordinates
|
|
3914
3910
|
_projectLatlngs: function(t, n, h) {
|
|
3915
|
-
var u = t[0] instanceof tt, f = t.length, _,
|
|
3911
|
+
var u = t[0] instanceof tt, f = t.length, _, k;
|
|
3916
3912
|
if (u) {
|
|
3917
|
-
for (
|
|
3918
|
-
|
|
3919
|
-
n.push(
|
|
3913
|
+
for (k = [], _ = 0; _ < f; _++)
|
|
3914
|
+
k[_] = this._map.latLngToLayerPoint(t[_]), h.extend(k[_]);
|
|
3915
|
+
n.push(k);
|
|
3920
3916
|
} else
|
|
3921
3917
|
for (_ = 0; _ < f; _++)
|
|
3922
3918
|
this._projectLatlngs(t[_], n, h);
|
|
@@ -3929,10 +3925,10 @@ function ha() {
|
|
|
3929
3925
|
this._parts = this._rings;
|
|
3930
3926
|
return;
|
|
3931
3927
|
}
|
|
3932
|
-
var n = this._parts, h, u, f, _,
|
|
3928
|
+
var n = this._parts, h, u, f, _, k, A, C;
|
|
3933
3929
|
for (h = 0, f = 0, _ = this._rings.length; h < _; h++)
|
|
3934
|
-
for (C = this._rings[h], u = 0,
|
|
3935
|
-
|
|
3930
|
+
for (C = this._rings[h], u = 0, k = C.length; u < k - 1; u++)
|
|
3931
|
+
A = qn(C[u], C[u + 1], t, u, !0), A && (n[f] = n[f] || [], n[f].push(A[0]), (A[1] !== C[u + 1] || u === k - 2) && (n[f].push(A[1]), f++));
|
|
3936
3932
|
}
|
|
3937
3933
|
},
|
|
3938
3934
|
// simplify each clipped part of the polyline for performance
|
|
@@ -3948,12 +3944,12 @@ function ha() {
|
|
|
3948
3944
|
},
|
|
3949
3945
|
// Needed by the `Canvas` renderer for interactivity
|
|
3950
3946
|
_containsPoint: function(t, n) {
|
|
3951
|
-
var h, u, f, _,
|
|
3947
|
+
var h, u, f, _, k, A, C = this._clickTolerance();
|
|
3952
3948
|
if (!this._pxBounds || !this._pxBounds.contains(t))
|
|
3953
3949
|
return !1;
|
|
3954
3950
|
for (h = 0, _ = this._parts.length; h < _; h++)
|
|
3955
|
-
for (
|
|
3956
|
-
if (!(!n && u === 0) && Hn(t,
|
|
3951
|
+
for (A = this._parts[h], u = 0, k = A.length, f = k - 1; u < k; f = u++)
|
|
3952
|
+
if (!(!n && u === 0) && Hn(t, A[f], A[u]) <= C)
|
|
3957
3953
|
return !0;
|
|
3958
3954
|
return !1;
|
|
3959
3955
|
}
|
|
@@ -4002,12 +3998,12 @@ function ha() {
|
|
|
4002
3998
|
},
|
|
4003
3999
|
// Needed by the `Canvas` renderer for interactivity
|
|
4004
4000
|
_containsPoint: function(t) {
|
|
4005
|
-
var n = !1, h, u, f, _,
|
|
4001
|
+
var n = !1, h, u, f, _, k, A, C, B;
|
|
4006
4002
|
if (!this._pxBounds || !this._pxBounds.contains(t))
|
|
4007
4003
|
return !1;
|
|
4008
4004
|
for (_ = 0, C = this._parts.length; _ < C; _++)
|
|
4009
|
-
for (h = this._parts[_],
|
|
4010
|
-
u = h[
|
|
4005
|
+
for (h = this._parts[_], k = 0, B = h.length, A = B - 1; k < B; A = k++)
|
|
4006
|
+
u = h[k], f = h[A], u.y > t.y != f.y > t.y && t.x < (f.x - u.x) * (t.y - u.y) / (f.y - u.y) + u.x && (n = !n);
|
|
4011
4007
|
return n || Rt.prototype._containsPoint.call(this, t, !0);
|
|
4012
4008
|
}
|
|
4013
4009
|
});
|
|
@@ -4065,12 +4061,12 @@ function ha() {
|
|
|
4065
4061
|
* Whether default Markers for "Point" type Features inherit from group options.
|
|
4066
4062
|
*/
|
|
4067
4063
|
initialize: function(t, n) {
|
|
4068
|
-
|
|
4064
|
+
b(this, n), this._layers = {}, t && this.addData(t);
|
|
4069
4065
|
},
|
|
4070
4066
|
// @method addData( <GeoJSON> data ): this
|
|
4071
4067
|
// Adds a GeoJSON object to the layer.
|
|
4072
4068
|
addData: function(t) {
|
|
4073
|
-
var n =
|
|
4069
|
+
var n = M(t) ? t : t.features, h, u, f;
|
|
4074
4070
|
if (n) {
|
|
4075
4071
|
for (h = 0, u = n.length; h < u; h++)
|
|
4076
4072
|
f = n[h], (f.geometries || f.geometry || f.features || f.coordinates) && this.addData(f);
|
|
@@ -4079,8 +4075,8 @@ function ha() {
|
|
|
4079
4075
|
var _ = this.options;
|
|
4080
4076
|
if (_.filter && !_.filter(t))
|
|
4081
4077
|
return this;
|
|
4082
|
-
var
|
|
4083
|
-
return
|
|
4078
|
+
var k = hi(t, _);
|
|
4079
|
+
return k ? (k.feature = di(t), k.defaultOptions = k.options, this.resetStyle(k), _.onEachFeature && _.onEachFeature(t, k), this.addLayer(k)) : this;
|
|
4084
4080
|
},
|
|
4085
4081
|
// @method resetStyle( <Path> layer? ): this
|
|
4086
4082
|
// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
|
|
@@ -4100,26 +4096,26 @@ function ha() {
|
|
|
4100
4096
|
}
|
|
4101
4097
|
});
|
|
4102
4098
|
function hi(t, n) {
|
|
4103
|
-
var h = t.type === "Feature" ? t.geometry : t, u = h ? h.coordinates : null, f = [], _ = n && n.pointToLayer,
|
|
4099
|
+
var h = t.type === "Feature" ? t.geometry : t, u = h ? h.coordinates : null, f = [], _ = n && n.pointToLayer, k = n && n.coordsToLatLng || mo, A, C, B, N;
|
|
4104
4100
|
if (!u && !h)
|
|
4105
4101
|
return null;
|
|
4106
4102
|
switch (h.type) {
|
|
4107
4103
|
case "Point":
|
|
4108
|
-
return
|
|
4104
|
+
return A = k(u), Kn(_, t, A, n);
|
|
4109
4105
|
case "MultiPoint":
|
|
4110
|
-
for (
|
|
4111
|
-
|
|
4106
|
+
for (B = 0, N = u.length; B < N; B++)
|
|
4107
|
+
A = k(u[B]), f.push(Kn(_, t, A, n));
|
|
4112
4108
|
return new Bt(f);
|
|
4113
4109
|
case "LineString":
|
|
4114
4110
|
case "MultiLineString":
|
|
4115
|
-
return C = ci(u, h.type === "LineString" ? 0 : 1,
|
|
4111
|
+
return C = ci(u, h.type === "LineString" ? 0 : 1, k), new Rt(C, n);
|
|
4116
4112
|
case "Polygon":
|
|
4117
4113
|
case "MultiPolygon":
|
|
4118
|
-
return C = ci(u, h.type === "Polygon" ? 1 : 2,
|
|
4114
|
+
return C = ci(u, h.type === "Polygon" ? 1 : 2, k), new de(C, n);
|
|
4119
4115
|
case "GeometryCollection":
|
|
4120
|
-
for (
|
|
4116
|
+
for (B = 0, N = h.geometries.length; B < N; B++) {
|
|
4121
4117
|
var H = hi({
|
|
4122
|
-
geometry: h.geometries[
|
|
4118
|
+
geometry: h.geometries[B],
|
|
4123
4119
|
type: "Feature",
|
|
4124
4120
|
properties: t.properties
|
|
4125
4121
|
}, n);
|
|
@@ -4127,8 +4123,8 @@ function ha() {
|
|
|
4127
4123
|
}
|
|
4128
4124
|
return new Bt(f);
|
|
4129
4125
|
case "FeatureCollection":
|
|
4130
|
-
for (
|
|
4131
|
-
var Y = hi(h.features[
|
|
4126
|
+
for (B = 0, N = h.features.length; B < N; B++) {
|
|
4127
|
+
var Y = hi(h.features[B], n);
|
|
4132
4128
|
Y && f.push(Y);
|
|
4133
4129
|
}
|
|
4134
4130
|
return new Bt(f);
|
|
@@ -4143,15 +4139,15 @@ function ha() {
|
|
|
4143
4139
|
return new tt(t[1], t[0], t[2]);
|
|
4144
4140
|
}
|
|
4145
4141
|
function ci(t, n, h) {
|
|
4146
|
-
for (var u = [], f = 0, _ = t.length,
|
|
4147
|
-
|
|
4142
|
+
for (var u = [], f = 0, _ = t.length, k; f < _; f++)
|
|
4143
|
+
k = n ? ci(t[f], n - 1, h) : (h || mo)(t[f]), u.push(k);
|
|
4148
4144
|
return u;
|
|
4149
4145
|
}
|
|
4150
4146
|
function go(t, n) {
|
|
4151
4147
|
return t = X(t), t.alt !== void 0 ? [y(t.lng, n), y(t.lat, n), y(t.alt, n)] : [y(t.lng, n), y(t.lat, n)];
|
|
4152
4148
|
}
|
|
4153
4149
|
function ui(t, n, h, u) {
|
|
4154
|
-
for (var f = [], _ = 0,
|
|
4150
|
+
for (var f = [], _ = 0, k = t.length; _ < k; _++)
|
|
4155
4151
|
f.push(n ? ui(t[_], xt(t[_]) ? 0 : n - 1, h, u) : go(t[_], u));
|
|
4156
4152
|
return !n && h && f.length > 0 && f.push(f[0].slice()), f;
|
|
4157
4153
|
}
|
|
@@ -4213,8 +4209,8 @@ function ha() {
|
|
|
4213
4209
|
if (h)
|
|
4214
4210
|
u.push(_.geometry);
|
|
4215
4211
|
else {
|
|
4216
|
-
var
|
|
4217
|
-
|
|
4212
|
+
var k = di(_);
|
|
4213
|
+
k.type === "FeatureCollection" ? u.push.apply(u, k.features) : u.push(k);
|
|
4218
4214
|
}
|
|
4219
4215
|
}
|
|
4220
4216
|
}), h ? fe(this, {
|
|
@@ -4258,7 +4254,7 @@ function ha() {
|
|
|
4258
4254
|
className: ""
|
|
4259
4255
|
},
|
|
4260
4256
|
initialize: function(t, n, h) {
|
|
4261
|
-
this._url = t, this._bounds = st(n),
|
|
4257
|
+
this._url = t, this._bounds = st(n), b(this, h);
|
|
4262
4258
|
},
|
|
4263
4259
|
onAdd: function() {
|
|
4264
4260
|
this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (j(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset();
|
|
@@ -4384,10 +4380,10 @@ function ha() {
|
|
|
4384
4380
|
this._url = h.length > 0 ? u : [n.src];
|
|
4385
4381
|
return;
|
|
4386
4382
|
}
|
|
4387
|
-
|
|
4383
|
+
M(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(n.style, "objectFit") && (n.style.objectFit = "fill"), n.autoplay = !!this.options.autoplay, n.loop = !!this.options.loop, n.muted = !!this.options.muted, n.playsInline = !!this.options.playsInline;
|
|
4388
4384
|
for (var _ = 0; _ < this._url.length; _++) {
|
|
4389
|
-
var
|
|
4390
|
-
|
|
4385
|
+
var k = $("source");
|
|
4386
|
+
k.src = this._url[_], n.appendChild(k);
|
|
4391
4387
|
}
|
|
4392
4388
|
}
|
|
4393
4389
|
// @method getElement(): HTMLVideoElement
|
|
@@ -4431,7 +4427,7 @@ function ha() {
|
|
|
4431
4427
|
content: ""
|
|
4432
4428
|
},
|
|
4433
4429
|
initialize: function(t, n) {
|
|
4434
|
-
t && (t instanceof tt ||
|
|
4430
|
+
t && (t instanceof tt || M(t)) ? (this._latlng = X(t), b(this, n)) : (b(this, t), this._source = n), this.options.content && (this._content = this.options.content);
|
|
4435
4431
|
},
|
|
4436
4432
|
// @method openOn(map: Map): this
|
|
4437
4433
|
// Adds the overlay to the map.
|
|
@@ -4574,7 +4570,7 @@ function ha() {
|
|
|
4574
4570
|
}), At.include({
|
|
4575
4571
|
_initOverlay: function(t, n, h, u) {
|
|
4576
4572
|
var f = h;
|
|
4577
|
-
return f instanceof t ? (
|
|
4573
|
+
return f instanceof t ? (b(f, u), f._source = this) : (f = n && !u ? n : new t(u, this), f.setContent(h)), f;
|
|
4578
4574
|
}
|
|
4579
4575
|
});
|
|
4580
4576
|
var pi = St.extend({
|
|
@@ -4685,8 +4681,8 @@ function ha() {
|
|
|
4685
4681
|
}
|
|
4686
4682
|
var t = this._map, n = parseInt(Te(this._container, "marginBottom"), 10) || 0, h = this._container.offsetHeight + n, u = this._containerWidth, f = new q(this._containerLeft, -h - this._containerBottom);
|
|
4687
4683
|
f._add(Qt(this._container));
|
|
4688
|
-
var _ = t.layerPointToContainerPoint(f),
|
|
4689
|
-
_.x + u + C.x >
|
|
4684
|
+
var _ = t.layerPointToContainerPoint(f), k = V(this.options.autoPanPadding), A = V(this.options.autoPanPaddingTopLeft || k), C = V(this.options.autoPanPaddingBottomRight || k), B = t.getSize(), N = 0, H = 0;
|
|
4685
|
+
_.x + u + C.x > B.x && (N = _.x + u - B.x + C.x), _.x - N - A.x < 0 && (N = _.x - A.x), _.y + h + C.y > B.y && (H = _.y + h - B.y + C.y), _.y - H - A.y < 0 && (H = _.y - A.y), (N || H) && (this.options.keepInView && (this._autopanning = !0), t.fire("autopanstart").panBy([N, H]));
|
|
4690
4686
|
}
|
|
4691
4687
|
},
|
|
4692
4688
|
_getAnchor: function() {
|
|
@@ -4827,8 +4823,8 @@ function ha() {
|
|
|
4827
4823
|
_adjustPan: function() {
|
|
4828
4824
|
},
|
|
4829
4825
|
_setPosition: function(t) {
|
|
4830
|
-
var n, h, u = this._map, f = this._container, _ = u.latLngToContainerPoint(u.getCenter()),
|
|
4831
|
-
|
|
4826
|
+
var n, h, u = this._map, f = this._container, _ = u.latLngToContainerPoint(u.getCenter()), k = u.layerPointToContainerPoint(t), A = this.options.direction, C = f.offsetWidth, B = f.offsetHeight, N = V(this.options.offset), H = this._getAnchor();
|
|
4827
|
+
A === "top" ? (n = C / 2, h = B) : A === "bottom" ? (n = C / 2, h = 0) : A === "center" ? (n = C / 2, h = B / 2) : A === "right" ? (n = 0, h = B / 2) : A === "left" ? (n = C, h = B / 2) : k.x < _.x ? (A = "right", n = 0, h = B / 2) : (A = "left", n = C + (N.x + H.x) * 2, h = B / 2), t = t.subtract(V(n, h, !0)).add(N).add(H), nt(f, "leaflet-tooltip-right"), nt(f, "leaflet-tooltip-left"), nt(f, "leaflet-tooltip-top"), nt(f, "leaflet-tooltip-bottom"), j(f, "leaflet-tooltip-" + A), lt(f, t);
|
|
4832
4828
|
},
|
|
4833
4829
|
_updatePosition: function() {
|
|
4834
4830
|
var t = this._map.latLngToLayerPoint(this._latlng);
|
|
@@ -5040,7 +5036,7 @@ function ha() {
|
|
|
5040
5036
|
keepBuffer: 2
|
|
5041
5037
|
},
|
|
5042
5038
|
initialize: function(t) {
|
|
5043
|
-
|
|
5039
|
+
b(this, t);
|
|
5044
5040
|
},
|
|
5045
5041
|
onAdd: function() {
|
|
5046
5042
|
this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView();
|
|
@@ -5186,17 +5182,17 @@ function ha() {
|
|
|
5186
5182
|
this._removeAllTiles(), this._tileZoom = void 0;
|
|
5187
5183
|
},
|
|
5188
5184
|
_retainParent: function(t, n, h, u) {
|
|
5189
|
-
var f = Math.floor(t / 2), _ = Math.floor(n / 2),
|
|
5190
|
-
|
|
5191
|
-
var C = this._tileCoordsToKey(
|
|
5192
|
-
return
|
|
5185
|
+
var f = Math.floor(t / 2), _ = Math.floor(n / 2), k = h - 1, A = new q(+f, +_);
|
|
5186
|
+
A.z = +k;
|
|
5187
|
+
var C = this._tileCoordsToKey(A), B = this._tiles[C];
|
|
5188
|
+
return B && B.active ? (B.retain = !0, !0) : (B && B.loaded && (B.retain = !0), k > u ? this._retainParent(f, _, k, u) : !1);
|
|
5193
5189
|
},
|
|
5194
5190
|
_retainChildren: function(t, n, h, u) {
|
|
5195
5191
|
for (var f = 2 * t; f < 2 * t + 2; f++)
|
|
5196
5192
|
for (var _ = 2 * n; _ < 2 * n + 2; _++) {
|
|
5197
|
-
var
|
|
5198
|
-
|
|
5199
|
-
var
|
|
5193
|
+
var k = new q(f, _);
|
|
5194
|
+
k.z = h + 1;
|
|
5195
|
+
var A = this._tileCoordsToKey(k), C = this._tiles[A];
|
|
5200
5196
|
if (C && C.active) {
|
|
5201
5197
|
C.retain = !0;
|
|
5202
5198
|
continue;
|
|
@@ -5252,15 +5248,15 @@ function ha() {
|
|
|
5252
5248
|
if (n) {
|
|
5253
5249
|
var h = this._clampZoom(n.getZoom());
|
|
5254
5250
|
if (t === void 0 && (t = n.getCenter()), this._tileZoom !== void 0) {
|
|
5255
|
-
var u = this._getTiledPixelBounds(t), f = this._pxBoundsToTileRange(u), _ = f.getCenter(),
|
|
5256
|
-
f.getBottomLeft().subtract([
|
|
5257
|
-
f.getTopRight().add([
|
|
5251
|
+
var u = this._getTiledPixelBounds(t), f = this._pxBoundsToTileRange(u), _ = f.getCenter(), k = [], A = this.options.keepBuffer, C = new it(
|
|
5252
|
+
f.getBottomLeft().subtract([A, -A]),
|
|
5253
|
+
f.getTopRight().add([A, -A])
|
|
5258
5254
|
);
|
|
5259
5255
|
if (!(isFinite(f.min.x) && isFinite(f.min.y) && isFinite(f.max.x) && isFinite(f.max.y)))
|
|
5260
5256
|
throw new Error("Attempted to load an infinite number of tiles");
|
|
5261
|
-
for (var
|
|
5262
|
-
var N = this._tiles[
|
|
5263
|
-
(N.z !== this._tileZoom || !C.contains(new q(N.x, N.y))) && (this._tiles[
|
|
5257
|
+
for (var B in this._tiles) {
|
|
5258
|
+
var N = this._tiles[B].coords;
|
|
5259
|
+
(N.z !== this._tileZoom || !C.contains(new q(N.x, N.y))) && (this._tiles[B].current = !1);
|
|
5264
5260
|
}
|
|
5265
5261
|
if (Math.abs(h - this._tileZoom) > 1) {
|
|
5266
5262
|
this._setView(t, h);
|
|
@@ -5271,16 +5267,16 @@ function ha() {
|
|
|
5271
5267
|
var gt = new q(Y, H);
|
|
5272
5268
|
if (gt.z = this._tileZoom, !!this._isValidTile(gt)) {
|
|
5273
5269
|
var ct = this._tiles[this._tileCoordsToKey(gt)];
|
|
5274
|
-
ct ? ct.current = !0 :
|
|
5270
|
+
ct ? ct.current = !0 : k.push(gt);
|
|
5275
5271
|
}
|
|
5276
5272
|
}
|
|
5277
|
-
if (
|
|
5273
|
+
if (k.sort(function(wt, me) {
|
|
5278
5274
|
return wt.distanceTo(_) - me.distanceTo(_);
|
|
5279
|
-
}),
|
|
5275
|
+
}), k.length !== 0) {
|
|
5280
5276
|
this._loading || (this._loading = !0, this.fire("loading"));
|
|
5281
5277
|
var Et = document.createDocumentFragment();
|
|
5282
|
-
for (Y = 0; Y <
|
|
5283
|
-
this._addTile(
|
|
5278
|
+
for (Y = 0; Y < k.length; Y++)
|
|
5279
|
+
this._addTile(k[Y], Et);
|
|
5284
5280
|
this._level.el.appendChild(Et);
|
|
5285
5281
|
}
|
|
5286
5282
|
}
|
|
@@ -5302,8 +5298,8 @@ function ha() {
|
|
|
5302
5298
|
return this._tileCoordsToBounds(this._keyToTileCoords(t));
|
|
5303
5299
|
},
|
|
5304
5300
|
_tileCoordsToNwSe: function(t) {
|
|
5305
|
-
var n = this._map, h = this.getTileSize(), u = t.scaleBy(h), f = u.add(h), _ = n.unproject(u, t.z),
|
|
5306
|
-
return [_,
|
|
5301
|
+
var n = this._map, h = this.getTileSize(), u = t.scaleBy(h), f = u.add(h), _ = n.unproject(u, t.z), k = n.unproject(f, t.z);
|
|
5302
|
+
return [_, k];
|
|
5307
5303
|
},
|
|
5308
5304
|
// converts tile coordinates to its geographical bounds
|
|
5309
5305
|
_tileCoordsToBounds: function(t) {
|
|
@@ -5423,7 +5419,7 @@ function ha() {
|
|
|
5423
5419
|
referrerPolicy: !1
|
|
5424
5420
|
},
|
|
5425
5421
|
initialize: function(t, n) {
|
|
5426
|
-
this._url = t, n =
|
|
5422
|
+
this._url = t, n = b(this, n), n.detectRetina && F.retina && n.maxZoom > 0 ? (n.tileSize = Math.floor(n.tileSize / 2), n.zoomReverse ? (n.zoomOffset--, n.minZoom = Math.min(n.maxZoom, n.minZoom + 1)) : (n.zoomOffset++, n.maxZoom = Math.max(n.minZoom, n.maxZoom - 1)), n.minZoom = Math.max(0, n.minZoom)) : n.zoomReverse ? n.minZoom = Math.min(n.maxZoom, n.minZoom) : n.maxZoom = Math.max(n.minZoom, n.maxZoom), typeof n.subdomains == "string" && (n.subdomains = n.subdomains.split("")), this.on("tileunload", this._onTileRemove);
|
|
5427
5423
|
},
|
|
5428
5424
|
// @method setUrl(url: String, noRedraw?: Boolean): this
|
|
5429
5425
|
// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).
|
|
@@ -5543,7 +5539,7 @@ function ha() {
|
|
|
5543
5539
|
var h = i({}, this.defaultWmsParams);
|
|
5544
5540
|
for (var u in n)
|
|
5545
5541
|
u in this.options || (h[u] = n[u]);
|
|
5546
|
-
n =
|
|
5542
|
+
n = b(this, n);
|
|
5547
5543
|
var f = n.detectRetina && F.retina ? 2 : 1, _ = this.getTileSize();
|
|
5548
5544
|
h.width = _.x * f, h.height = _.y * f, this.wmsParams = h;
|
|
5549
5545
|
},
|
|
@@ -5553,8 +5549,8 @@ function ha() {
|
|
|
5553
5549
|
this.wmsParams[n] = this._crs.code, pe.prototype.onAdd.call(this, t);
|
|
5554
5550
|
},
|
|
5555
5551
|
getTileUrl: function(t) {
|
|
5556
|
-
var n = this._tileCoordsToNwSe(t), h = this._crs, u = bt(h.project(n[0]), h.project(n[1])), f = u.min, _ = u.max,
|
|
5557
|
-
return
|
|
5552
|
+
var n = this._tileCoordsToNwSe(t), h = this._crs, u = bt(h.project(n[0]), h.project(n[1])), f = u.min, _ = u.max, k = (this._wmsVersion >= 1.3 && this._crs === jn ? [f.y, f.x, _.y, _.x] : [f.x, f.y, _.x, _.y]).join(","), A = pe.prototype.getTileUrl.call(this, t);
|
|
5553
|
+
return A + w(this.wmsParams, A, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + k;
|
|
5558
5554
|
},
|
|
5559
5555
|
// @method setParams(params: Object, noRedraw?: Boolean): this
|
|
5560
5556
|
// Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).
|
|
@@ -5576,7 +5572,7 @@ function ha() {
|
|
|
5576
5572
|
padding: 0.1
|
|
5577
5573
|
},
|
|
5578
5574
|
initialize: function(t) {
|
|
5579
|
-
|
|
5575
|
+
b(this, t), d(this), this._layers = this._layers || {};
|
|
5580
5576
|
},
|
|
5581
5577
|
onAdd: function() {
|
|
5582
5578
|
this._container || (this._initContainer(), j(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this);
|
|
@@ -5731,11 +5727,11 @@ function ha() {
|
|
|
5731
5727
|
},
|
|
5732
5728
|
_updatePoly: function(t, n) {
|
|
5733
5729
|
if (this._drawing) {
|
|
5734
|
-
var h, u, f, _,
|
|
5735
|
-
if (
|
|
5736
|
-
for (C.beginPath(), h = 0; h <
|
|
5737
|
-
for (u = 0, f =
|
|
5738
|
-
_ =
|
|
5730
|
+
var h, u, f, _, k = t._parts, A = k.length, C = this._ctx;
|
|
5731
|
+
if (A) {
|
|
5732
|
+
for (C.beginPath(), h = 0; h < A; h++) {
|
|
5733
|
+
for (u = 0, f = k[h].length; u < f; u++)
|
|
5734
|
+
_ = k[h][u], C[u ? "lineTo" : "moveTo"](_.x, _.y);
|
|
5739
5735
|
n && C.closePath();
|
|
5740
5736
|
}
|
|
5741
5737
|
this._fillStroke(C, t);
|
|
@@ -5838,7 +5834,7 @@ function ha() {
|
|
|
5838
5834
|
},
|
|
5839
5835
|
_updateStyle: function(t) {
|
|
5840
5836
|
var n = t._stroke, h = t._fill, u = t.options, f = t._container;
|
|
5841
|
-
f.stroked = !!u.stroke, f.filled = !!u.fill, u.stroke ? (n || (n = t._stroke = Re("stroke")), f.appendChild(n), n.weight = u.weight + "px", n.color = u.color, n.opacity = u.opacity, u.dashArray ? n.dashStyle =
|
|
5837
|
+
f.stroked = !!u.stroke, f.filled = !!u.fill, u.stroke ? (n || (n = t._stroke = Re("stroke")), f.appendChild(n), n.weight = u.weight + "px", n.color = u.color, n.opacity = u.opacity, u.dashArray ? n.dashStyle = M(u.dashArray) ? u.dashArray.join(" ") : u.dashArray.replace(/( *, *)/g, " ") : n.dashStyle = "", n.endcap = u.lineCap.replace("butt", "flat"), n.joinstyle = u.lineJoin) : n && (f.removeChild(n), t._stroke = null), u.fill ? (h || (h = t._fill = Re("fill")), f.appendChild(h), h.color = u.fillColor || u.color, h.opacity = u.fillOpacity) : h && (f.removeChild(h), t._fill = null);
|
|
5842
5838
|
},
|
|
5843
5839
|
_updateCircle: function(t) {
|
|
5844
5840
|
var n = t._point.round(), h = Math.round(t._radius), u = Math.round(t._radiusY || h);
|
|
@@ -6125,8 +6121,8 @@ function ha() {
|
|
|
6125
6121
|
}
|
|
6126
6122
|
},
|
|
6127
6123
|
_onPreDragWrap: function() {
|
|
6128
|
-
var t = this._worldWidth, n = Math.round(t / 2), h = this._initialWorldOffset, u = this._draggable._newPos.x, f = (u - n + h) % t + n - h, _ = (u + n + h) % t - n - h,
|
|
6129
|
-
this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x =
|
|
6124
|
+
var t = this._worldWidth, n = Math.round(t / 2), h = this._initialWorldOffset, u = this._draggable._newPos.x, f = (u - n + h) % t + n - h, _ = (u + n + h) % t - n - h, k = Math.abs(f + h) < Math.abs(_ + h) ? f : _;
|
|
6125
|
+
this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = k;
|
|
6130
6126
|
},
|
|
6131
6127
|
_onDragEnd: function(t) {
|
|
6132
6128
|
var n = this._map, h = n.options, u = !h.inertia || t.noInertia || this._times.length < 2;
|
|
@@ -6134,11 +6130,11 @@ function ha() {
|
|
|
6134
6130
|
n.fire("moveend");
|
|
6135
6131
|
else {
|
|
6136
6132
|
this._prunePositions(+/* @__PURE__ */ new Date());
|
|
6137
|
-
var f = this._lastPos.subtract(this._positions[0]), _ = (this._lastTime - this._times[0]) / 1e3,
|
|
6133
|
+
var f = this._lastPos.subtract(this._positions[0]), _ = (this._lastTime - this._times[0]) / 1e3, k = h.easeLinearity, A = f.multiplyBy(k / _), C = A.distanceTo([0, 0]), B = Math.min(h.inertiaMaxSpeed, C), N = A.multiplyBy(B / C), H = B / (h.inertiaDeceleration * k), Y = N.multiplyBy(-H / 2).round();
|
|
6138
6134
|
!Y.x && !Y.y ? n.fire("moveend") : (Y = n._limitOffset(Y, n.options.maxBounds), R(function() {
|
|
6139
6135
|
n.panBy(Y, {
|
|
6140
6136
|
duration: H,
|
|
6141
|
-
easeLinearity:
|
|
6137
|
+
easeLinearity: k,
|
|
6142
6138
|
noMoveStart: !0,
|
|
6143
6139
|
animate: !0
|
|
6144
6140
|
});
|
|
@@ -6276,8 +6272,8 @@ function ha() {
|
|
|
6276
6272
|
_performZoom: function() {
|
|
6277
6273
|
var t = this._map, n = t.getZoom(), h = this._map.options.zoomSnap || 0;
|
|
6278
6274
|
t._stop();
|
|
6279
|
-
var u = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), f = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(u)))) / Math.LN2, _ = h ? Math.ceil(f / h) * h : f,
|
|
6280
|
-
this._delta = 0, this._startTime = null,
|
|
6275
|
+
var u = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), f = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(u)))) / Math.LN2, _ = h ? Math.ceil(f / h) * h : f, k = t._limitZoom(n + (this._delta > 0 ? _ : -_)) - n;
|
|
6276
|
+
this._delta = 0, this._startTime = null, k && (t.options.scrollWheelZoom === "center" ? t.setZoom(n + k) : t.setZoomAround(this._lastMousePos, n + k));
|
|
6281
6277
|
}
|
|
6282
6278
|
});
|
|
6283
6279
|
Q.addInitHook("addHandler", "scrollWheelZoom", ur);
|
|
@@ -6376,8 +6372,8 @@ function ha() {
|
|
|
6376
6372
|
this._center = n.unproject(n.project(this._pinchStartLatLng, this._zoom).subtract(_), this._zoom);
|
|
6377
6373
|
}
|
|
6378
6374
|
this._moved || (n._moveStart(!0, !1), this._moved = !0), G(this._animRequest);
|
|
6379
|
-
var
|
|
6380
|
-
this._animRequest = R(
|
|
6375
|
+
var k = s(n._move, n, this._center, this._zoom, { pinch: !0, round: !1 }, void 0);
|
|
6376
|
+
this._animRequest = R(k, this, !0), dt(t);
|
|
6381
6377
|
}
|
|
6382
6378
|
},
|
|
6383
6379
|
_onTouchEnd: function() {
|
|
@@ -6388,7 +6384,7 @@ function ha() {
|
|
|
6388
6384
|
this._zooming = !1, G(this._animRequest), et(document, "touchmove", this._onTouchMove, this), et(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
|
|
6389
6385
|
}
|
|
6390
6386
|
});
|
|
6391
|
-
Q.addInitHook("addHandler", "touchZoom", fr), Q.BoxZoom = sr, Q.DoubleClickZoom = lr, Q.Drag = hr, Q.Keyboard = cr, Q.ScrollWheelZoom = ur, Q.TapHold = dr, Q.TouchZoom = fr, e.Bounds = it, e.Browser = F, e.CRS = zt, e.Canvas = or, e.Circle = po, e.CircleMarker = li, e.Class = K, e.Control = Mt, e.DivIcon = tr, e.DivOverlay = St, e.DomEvent = ks, e.DomUtil = Ls, e.Draggable = Wt, e.Evented = Dt, e.FeatureGroup = Bt, e.GeoJSON = Nt, e.GridLayer = Be, e.Handler = Pt, e.Icon = ue, e.ImageOverlay = fi, e.LatLng = tt, e.LatLngBounds = Lt, e.Layer = At, e.LayerGroup = ce, e.LineUtil = Bs, e.Map = Q, e.Marker = si, e.Mixin = Ps, e.Path = jt, e.Point = q, e.PolyUtil = Ss, e.Polygon = de, e.Polyline = Rt, e.Popup = pi, e.PosAnimation = Bn, e.Projection = Rs, e.Rectangle = ar, e.Renderer = Ut, e.SVG = Ne, e.SVGOverlay = $n, e.TileLayer = pe, e.Tooltip = mi, e.Transformation = Ui, e.Util = W, e.VideoOverlay = Qn, e.bind = s, e.bounds = bt, e.canvas = nr, e.circle = qs, e.circleMarker = Vs, e.control = Oe, e.divIcon = tl, e.extend = i, e.featureGroup = Gs, e.geoJSON = Xn, e.geoJson = js, e.gridLayer = el, e.icon = Zs, e.imageOverlay = Ys, e.latLng = X, e.latLngBounds = st, e.layerGroup = Fs, e.map = xs, e.marker = Hs, e.point = V, e.polygon = Ws, e.polyline = Js, e.popup = Qs, e.rectangle = nl, e.setOptions =
|
|
6387
|
+
Q.addInitHook("addHandler", "touchZoom", fr), Q.BoxZoom = sr, Q.DoubleClickZoom = lr, Q.Drag = hr, Q.Keyboard = cr, Q.ScrollWheelZoom = ur, Q.TapHold = dr, Q.TouchZoom = fr, e.Bounds = it, e.Browser = F, e.CRS = zt, e.Canvas = or, e.Circle = po, e.CircleMarker = li, e.Class = K, e.Control = Mt, e.DivIcon = tr, e.DivOverlay = St, e.DomEvent = ks, e.DomUtil = Ls, e.Draggable = Wt, e.Evented = Dt, e.FeatureGroup = Bt, e.GeoJSON = Nt, e.GridLayer = Be, e.Handler = Pt, e.Icon = ue, e.ImageOverlay = fi, e.LatLng = tt, e.LatLngBounds = Lt, e.Layer = At, e.LayerGroup = ce, e.LineUtil = Bs, e.Map = Q, e.Marker = si, e.Mixin = Ps, e.Path = jt, e.Point = q, e.PolyUtil = Ss, e.Polygon = de, e.Polyline = Rt, e.Popup = pi, e.PosAnimation = Bn, e.Projection = Rs, e.Rectangle = ar, e.Renderer = Ut, e.SVG = Ne, e.SVGOverlay = $n, e.TileLayer = pe, e.Tooltip = mi, e.Transformation = Ui, e.Util = W, e.VideoOverlay = Qn, e.bind = s, e.bounds = bt, e.canvas = nr, e.circle = qs, e.circleMarker = Vs, e.control = Oe, e.divIcon = tl, e.extend = i, e.featureGroup = Gs, e.geoJSON = Xn, e.geoJson = js, e.gridLayer = el, e.icon = Zs, e.imageOverlay = Ys, e.latLng = X, e.latLngBounds = st, e.layerGroup = Fs, e.map = xs, e.marker = Hs, e.point = V, e.polygon = Ws, e.polyline = Js, e.popup = Qs, e.rectangle = nl, e.setOptions = b, e.stamp = d, e.svg = rr, e.svgOverlay = Xs, e.tileLayer = er, e.tooltip = $s, e.transformation = Ee, e.version = r, e.videoOverlay = Ks;
|
|
6392
6388
|
var al = window.L;
|
|
6393
6389
|
e.noConflict = function() {
|
|
6394
6390
|
return window.L = al, this;
|
|
@@ -7217,7 +7213,6 @@ function Ul(l) {
|
|
|
7217
7213
|
case "nauticalMile":
|
|
7218
7214
|
a *= 0.53996, g = L.GeometryUtil.formattedNumber(a / 1e3, m.nm) + " nm";
|
|
7219
7215
|
break;
|
|
7220
|
-
case "yards":
|
|
7221
7216
|
default:
|
|
7222
7217
|
a *= 1.09361, g = a > 1760 ? L.GeometryUtil.formattedNumber(a / 1760, m.mi) + " miles" : L.GeometryUtil.formattedNumber(a, m.yd) + " yd";
|
|
7223
7218
|
}
|
|
@@ -7511,10 +7506,10 @@ function Fl() {
|
|
|
7511
7506
|
_calculateBearingAndDistance: function() {
|
|
7512
7507
|
var r = this._clickedLatLong.lat, i = this._clickedLatLong.lng, a = this._movingLatLong.lat, s = this._movingLatLong.lng, c = Math.PI / 180, d = Math.sin((s - i) * c) * Math.cos(a * c), p = Math.cos(r * c) * Math.sin(a * c) - Math.sin(r * c) * Math.cos(a * c) * Math.cos((s - i) * c), g = Math.atan2(d, p) * ((this.options.angleUnit.factor ? this.options.angleUnit.factor / 2 : 180) / Math.PI);
|
|
7513
7508
|
g += g < 0 ? this.options.angleUnit.factor ? this.options.angleUnit.factor : 360 : 0;
|
|
7514
|
-
var m = this.options.lengthUnit.factor ? 6371 * this.options.lengthUnit.factor : 6371, y = (a - r) * c,
|
|
7509
|
+
var m = this.options.lengthUnit.factor ? 6371 * this.options.lengthUnit.factor : 6371, y = (a - r) * c, v = (s - i) * c, x = Math.sin(y / 2) * Math.sin(y / 2) + Math.cos(r * c) * Math.cos(a * c) * Math.sin(v / 2) * Math.sin(v / 2), b = 2 * Math.atan2(Math.sqrt(x), Math.sqrt(1 - x)), w = m * b;
|
|
7515
7510
|
this._result = {
|
|
7516
7511
|
Bearing: g,
|
|
7517
|
-
Distance:
|
|
7512
|
+
Distance: w
|
|
7518
7513
|
};
|
|
7519
7514
|
},
|
|
7520
7515
|
_closePath: function() {
|
|
@@ -7658,16 +7653,16 @@ function tn(l, o = {}) {
|
|
|
7658
7653
|
for (const a of l.features) {
|
|
7659
7654
|
if (!a || a.type !== "Feature") continue;
|
|
7660
7655
|
const s = (i = a.properties) != null ? i : {}, c = Ft(a), d = (g, m) => {
|
|
7661
|
-
const y = s && typeof s == "object" ? { ...s } : {},
|
|
7662
|
-
|
|
7663
|
-
const
|
|
7656
|
+
const y = s && typeof s == "object" ? { ...s } : {}, v = c !== void 0 ? `${c}::${m}` : void 0;
|
|
7657
|
+
v !== void 0 && (y.id = v);
|
|
7658
|
+
const x = Array.isArray(s[Ot]) ? s[Ot] : [], b = {
|
|
7664
7659
|
type: a.geometry.type,
|
|
7665
7660
|
hasPropertyId: Object.prototype.hasOwnProperty.call(s, "id"),
|
|
7666
7661
|
nullProperties: a.properties === null
|
|
7667
7662
|
};
|
|
7668
|
-
return a.id !== void 0 ?
|
|
7663
|
+
return a.id !== void 0 ? b.id = a.id : c !== void 0 && (b.id = c), b.hasPropertyId && (b.propertyId = s.id), o.preserveMetadata && (y[Ot] = [...x, b]), {
|
|
7669
7664
|
type: "Feature",
|
|
7670
|
-
id:
|
|
7665
|
+
id: v,
|
|
7671
7666
|
properties: y,
|
|
7672
7667
|
geometry: g
|
|
7673
7668
|
};
|
|
@@ -7720,8 +7715,8 @@ function ua(l, o = {}) {
|
|
|
7720
7715
|
if (!a(m)) continue;
|
|
7721
7716
|
const y = Lo(m);
|
|
7722
7717
|
if (!y) continue;
|
|
7723
|
-
const
|
|
7724
|
-
|
|
7718
|
+
const v = s.get(y.baseId);
|
|
7719
|
+
v ? v.push(y) : s.set(y.baseId, [y]);
|
|
7725
7720
|
}
|
|
7726
7721
|
if (s.size === 0) return l;
|
|
7727
7722
|
const c = /* @__PURE__ */ new Set(), d = [];
|
|
@@ -8415,12 +8410,12 @@ class sh extends HTMLElement {
|
|
|
8415
8410
|
), this.entries.forEach(({ element: d, config: p }) => {
|
|
8416
8411
|
const g = ah(p, r.width), m = getComputedStyle(d), y = nh(
|
|
8417
8412
|
m.getPropertyValue("--geokit-toolbar-zone").trim() || g.position
|
|
8418
|
-
),
|
|
8413
|
+
), v = this.querySelector(
|
|
8419
8414
|
`[data-geokit-zone="${y}"]`
|
|
8420
8415
|
);
|
|
8421
|
-
if (d.parentElement !==
|
|
8416
|
+
if (d.parentElement !== v) {
|
|
8422
8417
|
const E = d.getRootNode() instanceof ShadowRoot ? d.getRootNode().activeElement : document.activeElement;
|
|
8423
|
-
|
|
8418
|
+
v.appendChild(d), E instanceof HTMLElement && d.contains(E) && E.focus({ preventScroll: !0 });
|
|
8424
8419
|
}
|
|
8425
8420
|
d.dataset.geokitToolbarPosition = y, d.style.setProperty(
|
|
8426
8421
|
"--_geokit-direction",
|
|
@@ -8432,18 +8427,18 @@ class sh extends HTMLElement {
|
|
|
8432
8427
|
"--_geokit-wrap",
|
|
8433
8428
|
g.overflow === "scroll" ? "nowrap" : "wrap"
|
|
8434
8429
|
);
|
|
8435
|
-
const [
|
|
8430
|
+
const [x, b] = g.offset;
|
|
8436
8431
|
d.style.setProperty(
|
|
8437
8432
|
"--_geokit-layout-x",
|
|
8438
|
-
`${Number.isFinite(
|
|
8433
|
+
`${Number.isFinite(x) ? Math.max(0, x) : 10}px`
|
|
8439
8434
|
), d.style.setProperty(
|
|
8440
8435
|
"--_geokit-layout-y",
|
|
8441
|
-
`${Number.isFinite(
|
|
8436
|
+
`${Number.isFinite(b) ? Math.max(0, b) : 10}px`
|
|
8442
8437
|
);
|
|
8443
|
-
const
|
|
8438
|
+
const w = getComputedStyle(d).flexDirection.startsWith("row");
|
|
8444
8439
|
d.setAttribute(
|
|
8445
8440
|
"aria-orientation",
|
|
8446
|
-
|
|
8441
|
+
w ? "horizontal" : "vertical"
|
|
8447
8442
|
);
|
|
8448
8443
|
});
|
|
8449
8444
|
const s = qe.filter(
|
|
@@ -8724,14 +8719,14 @@ function bh(l, o, e) {
|
|
|
8724
8719
|
g === "horizontal" ? "row" : "column"
|
|
8725
8720
|
), typeof d.gap == "number" && Number.isFinite(d.gap) && d.gap >= 0 && p.style.setProperty("--_geokit-gap", `${d.gap}px`), kh(p, d.position, d.offset);
|
|
8726
8721
|
const m = Bi(d.className);
|
|
8727
|
-
m.length > 0 && p.classList.add(...m), d.tools.forEach((
|
|
8728
|
-
const
|
|
8729
|
-
ga(
|
|
8722
|
+
m.length > 0 && p.classList.add(...m), d.tools.forEach((v, x) => {
|
|
8723
|
+
const b = wh(v, d, x, o == null ? void 0 : o[v]);
|
|
8724
|
+
ga(b, v, {
|
|
8730
8725
|
source: "toolbar",
|
|
8731
8726
|
activate: !0,
|
|
8732
8727
|
groupId: d.id,
|
|
8733
8728
|
onTrigger: e.onTrigger
|
|
8734
|
-
}), p.appendChild(
|
|
8729
|
+
}), p.appendChild(b);
|
|
8735
8730
|
}), rh(d) ? (p.setAttribute(
|
|
8736
8731
|
"part",
|
|
8737
8732
|
`toolbar-group toolbar-group-${d.id.replace(/[^a-zA-Z0-9_-]/g, "-")}`
|
|
@@ -8751,30 +8746,30 @@ function Lh(l, o) {
|
|
|
8751
8746
|
});
|
|
8752
8747
|
}
|
|
8753
8748
|
function wh(l, o, e, r) {
|
|
8754
|
-
var g, m, y,
|
|
8749
|
+
var g, m, y, v, x, b, w, E, T;
|
|
8755
8750
|
const i = document.createElement("button");
|
|
8756
8751
|
i.type = "button", i.dataset.geokitTool = (m = (g = Ke[l]) == null ? void 0 : g.dataTool) != null ? m : l, i.dataset.geokitToolbarGroup = o.id, i.dataset.geokitToolbarPosition = (y = o.position) != null ? y : "topright", i.dataset.geokitToolInstance = Th(
|
|
8757
8752
|
o.id,
|
|
8758
8753
|
l,
|
|
8759
8754
|
e
|
|
8760
8755
|
), i.className = "leaflet-geokit-toolbar-button", i.disabled = (r == null ? void 0 : r.disabled) === !0, i.setAttribute("aria-disabled", String(i.disabled));
|
|
8761
|
-
const a = (
|
|
8762
|
-
i.title = a, i.setAttribute("aria-label", (
|
|
8756
|
+
const a = (v = r == null ? void 0 : r.title) != null ? v : _a(l);
|
|
8757
|
+
i.title = a, i.setAttribute("aria-label", (x = r == null ? void 0 : r.ariaLabel) != null ? x : a), r != null && r.popover && (i.setAttribute("aria-haspopup", "dialog"), i.setAttribute("aria-expanded", "false"));
|
|
8763
8758
|
const s = Bi(r == null ? void 0 : r.className);
|
|
8764
8759
|
if (s.length > 0 && i.classList.add(...s), r && (i.__geokitToolButtonConfig = r, gh(r) && Mi(i, r, { tool: l, groupId: o.id })), !i.querySelector(`.${Bo}`)) {
|
|
8765
|
-
const
|
|
8760
|
+
const M = {
|
|
8766
8761
|
iconHtml: Ch(l),
|
|
8767
|
-
iconSize: (
|
|
8762
|
+
iconSize: (b = r == null ? void 0 : r.iconSize) != null ? b : [20, 20]
|
|
8768
8763
|
};
|
|
8769
|
-
Mi(i,
|
|
8764
|
+
Mi(i, M, { tool: l, groupId: o.id });
|
|
8770
8765
|
}
|
|
8771
8766
|
const c = `${o.id}-${l}-${e}`, d = i.querySelector(`.${Bo}`), p = document.createElement("slot");
|
|
8772
8767
|
p.name = `${c}-icon`, p.append(...Array.from(d.childNodes)), d.appendChild(p);
|
|
8773
|
-
for (const
|
|
8768
|
+
for (const M of ["badge", "tooltip"]) {
|
|
8774
8769
|
const S = document.createElement("span");
|
|
8775
|
-
S.className = `leaflet-geokit-tool-${
|
|
8770
|
+
S.className = `leaflet-geokit-tool-${M}`, S.setAttribute("part", M), S.setAttribute("aria-hidden", "true");
|
|
8776
8771
|
const I = document.createElement("slot");
|
|
8777
|
-
I.name = `${c}-${
|
|
8772
|
+
I.name = `${c}-${M}`, I.textContent = M === "badge" ? (w = r == null ? void 0 : r.badge) != null ? w : "" : (T = (E = r == null ? void 0 : r.tooltip) != null ? E : r == null ? void 0 : r.ariaLabel) != null ? T : a, S.appendChild(I), i.appendChild(S);
|
|
8778
8773
|
}
|
|
8779
8774
|
return i;
|
|
8780
8775
|
}
|
|
@@ -8783,7 +8778,7 @@ function kh(l, o = "topright", e) {
|
|
|
8783
8778
|
l.dataset.geokitToolbarPosition = o, l.style.setProperty("--_geokit-offset-x", `${r}px`), l.style.setProperty("--_geokit-offset-y", `${i}px`);
|
|
8784
8779
|
}
|
|
8785
8780
|
function xh(l, o, e, r) {
|
|
8786
|
-
var c, d, p, g, m, y,
|
|
8781
|
+
var c, d, p, g, m, y, v, x, b;
|
|
8787
8782
|
if (!e.popover) return;
|
|
8788
8783
|
Je(r.container);
|
|
8789
8784
|
const i = document.createElement("div");
|
|
@@ -8791,16 +8786,16 @@ function xh(l, o, e, r) {
|
|
|
8791
8786
|
"aria-label",
|
|
8792
8787
|
(g = (p = e.popover.ariaLabel) != null ? p : e.popover.title) != null ? g : _a(o)
|
|
8793
8788
|
), e.popover.title) {
|
|
8794
|
-
const
|
|
8795
|
-
|
|
8789
|
+
const w = document.createElement("strong");
|
|
8790
|
+
w.textContent = e.popover.title, i.appendChild(w);
|
|
8796
8791
|
}
|
|
8797
8792
|
if (e.popover.body) {
|
|
8798
|
-
const
|
|
8799
|
-
|
|
8793
|
+
const w = document.createElement("div");
|
|
8794
|
+
w.textContent = e.popover.body, i.appendChild(w);
|
|
8800
8795
|
}
|
|
8801
8796
|
if (e.popover.html) {
|
|
8802
|
-
const
|
|
8803
|
-
|
|
8797
|
+
const w = document.createElement("div");
|
|
8798
|
+
w.innerHTML = e.popover.html, i.appendChild(w);
|
|
8804
8799
|
}
|
|
8805
8800
|
const a = (y = (m = e.popover).render) == null ? void 0 : y.call(m, {
|
|
8806
8801
|
tool: o,
|
|
@@ -8811,17 +8806,17 @@ function xh(l, o, e, r) {
|
|
|
8811
8806
|
if (a instanceof HTMLElement || s)
|
|
8812
8807
|
i.appendChild(a);
|
|
8813
8808
|
else if (typeof a == "string" && a.trim()) {
|
|
8814
|
-
const
|
|
8815
|
-
|
|
8809
|
+
const w = document.createElement("div");
|
|
8810
|
+
w.innerHTML = a, i.appendChild(w);
|
|
8816
8811
|
}
|
|
8817
8812
|
r.container.appendChild(i), Eh(r.container, l, i), l.setAttribute("aria-expanded", "true"), Uo.set(i, {
|
|
8818
8813
|
tool: o,
|
|
8819
8814
|
groupId: r.groupId,
|
|
8820
8815
|
button: l,
|
|
8821
8816
|
config: e
|
|
8822
|
-
}), Mh(r.container, l, i), i.tabIndex = -1, ((
|
|
8817
|
+
}), Mh(r.container, l, i), i.tabIndex = -1, ((v = i.querySelector(
|
|
8823
8818
|
"button:not(:disabled), [href], input, select, textarea, [tabindex='0']"
|
|
8824
|
-
)) != null ?
|
|
8819
|
+
)) != null ? v : i).focus(), (b = (x = e.popover).onOpen) == null || b.call(x, {
|
|
8825
8820
|
tool: o,
|
|
8826
8821
|
groupId: r.groupId,
|
|
8827
8822
|
button: l,
|
|
@@ -9008,49 +9003,49 @@ function ya(l, o, e) {
|
|
|
9008
9003
|
s = !1;
|
|
9009
9004
|
};
|
|
9010
9005
|
l.on("unload", c);
|
|
9011
|
-
const d = (
|
|
9012
|
-
target:
|
|
9013
|
-
originalEvent:
|
|
9014
|
-
latlng: l.mouseEventToLatLng(
|
|
9015
|
-
}), p = (
|
|
9016
|
-
|
|
9006
|
+
const d = (b, w) => ({
|
|
9007
|
+
target: w,
|
|
9008
|
+
originalEvent: b,
|
|
9009
|
+
latlng: l.mouseEventToLatLng(b)
|
|
9010
|
+
}), p = (b) => {
|
|
9011
|
+
b.preventDefault(), b.stopPropagation();
|
|
9017
9012
|
}, g = () => {
|
|
9018
|
-
var
|
|
9019
|
-
const
|
|
9020
|
-
a = null,
|
|
9021
|
-
}, m = (
|
|
9022
|
-
if (a !== null || !
|
|
9023
|
-
let
|
|
9024
|
-
const E =
|
|
9013
|
+
var w;
|
|
9014
|
+
const b = a;
|
|
9015
|
+
a = null, b !== null && ((w = r.hasPointerCapture) != null && w.call(r, b)) && r.releasePointerCapture(b), s && l.dragging.enable(), s = !1;
|
|
9016
|
+
}, m = (b) => {
|
|
9017
|
+
if (a !== null || !b.isPrimary || b.button !== 0) return;
|
|
9018
|
+
let w;
|
|
9019
|
+
const E = b.composedPath(), T = l.mouseEventToLayerPoint(b), M = /* @__PURE__ */ new Set();
|
|
9025
9020
|
if (o.eachLayer((S) => {
|
|
9026
|
-
var
|
|
9027
|
-
const I = (
|
|
9028
|
-
I && E.includes(I) && (
|
|
9021
|
+
var D;
|
|
9022
|
+
const I = (D = S.getElement) == null ? void 0 : D.call(S);
|
|
9023
|
+
I && E.includes(I) && (w = S);
|
|
9029
9024
|
const O = S._renderer;
|
|
9030
|
-
if (!I && O && !
|
|
9031
|
-
|
|
9032
|
-
for (let
|
|
9033
|
-
const U =
|
|
9034
|
-
o.hasLayer(U) && U.options.interactive && U._containsPoint(T) && (
|
|
9025
|
+
if (!I && O && !M.has(O) && E.includes(O._container)) {
|
|
9026
|
+
M.add(O);
|
|
9027
|
+
for (let z = O._drawFirst; z; z = z.next) {
|
|
9028
|
+
const U = z.layer;
|
|
9029
|
+
o.hasLayer(U) && U.options.interactive && U._containsPoint(T) && (w = U);
|
|
9035
9030
|
}
|
|
9036
9031
|
}
|
|
9037
|
-
}), !!
|
|
9038
|
-
a =
|
|
9032
|
+
}), !!w && (p(b), !e.pending())) {
|
|
9033
|
+
a = b.pointerId, s = l.dragging.enabled(), l.dragging.disable(), e.start(d(b, w));
|
|
9039
9034
|
try {
|
|
9040
9035
|
r.setPointerCapture(a);
|
|
9041
9036
|
} catch {
|
|
9042
9037
|
g(), e.cancel();
|
|
9043
9038
|
}
|
|
9044
9039
|
}
|
|
9045
|
-
}, y = (
|
|
9046
|
-
|
|
9047
|
-
},
|
|
9048
|
-
|
|
9049
|
-
},
|
|
9050
|
-
|
|
9040
|
+
}, y = (b) => {
|
|
9041
|
+
b.pointerId === a && (p(b), e.move(d(b)));
|
|
9042
|
+
}, v = (b) => {
|
|
9043
|
+
b.pointerId === a && (p(b), e.move(d(b)), g(), e.end(d(b)));
|
|
9044
|
+
}, x = (b) => {
|
|
9045
|
+
b.pointerId === a && (p(b), g(), e.cancel());
|
|
9051
9046
|
};
|
|
9052
|
-
return r.addEventListener("pointerdown", m, !0), r.addEventListener("pointermove", y, !0), r.addEventListener("pointerup",
|
|
9053
|
-
g(), e.cancel(), l.off("unload", c), r.style.touchAction = i, r.removeEventListener("pointerdown", m, !0), r.removeEventListener("pointermove", y, !0), r.removeEventListener("pointerup",
|
|
9047
|
+
return r.addEventListener("pointerdown", m, !0), r.addEventListener("pointermove", y, !0), r.addEventListener("pointerup", v, !0), r.addEventListener("pointercancel", x, !0), r.addEventListener("lostpointercapture", x, !0), () => {
|
|
9048
|
+
g(), e.cancel(), l.off("unload", c), r.style.touchAction = i, r.removeEventListener("pointerdown", m, !0), r.removeEventListener("pointermove", y, !0), r.removeEventListener("pointerup", v, !0), r.removeEventListener("pointercancel", x, !0), r.removeEventListener("lostpointercapture", x, !0);
|
|
9054
9049
|
};
|
|
9055
9050
|
}
|
|
9056
9051
|
const Di = class Di extends rt.Draw.Feature {
|
|
@@ -9379,8 +9374,8 @@ function Ar(l) {
|
|
|
9379
9374
|
return l * 180 / Math.PI;
|
|
9380
9375
|
}
|
|
9381
9376
|
function zh(l, o, e) {
|
|
9382
|
-
const r = o / Dh, i = xo(e), a = xo(l.lat), s = xo(l.lng), c = Math.sin(a), d = Math.cos(a), p = Math.sin(r), g = Math.cos(r), m = c * g + d * p * Math.cos(i), y = Math.asin(m),
|
|
9383
|
-
return { lat: Ar(y), lng: Ar(
|
|
9377
|
+
const r = o / Dh, i = xo(e), a = xo(l.lat), s = xo(l.lng), c = Math.sin(a), d = Math.cos(a), p = Math.sin(r), g = Math.cos(r), m = c * g + d * p * Math.cos(i), y = Math.asin(m), v = Math.sin(i) * p * d, x = g - c * m, b = s + Math.atan2(v, x);
|
|
9378
|
+
return { lat: Ar(y), lng: Ar(b) };
|
|
9384
9379
|
}
|
|
9385
9380
|
function Bh(l) {
|
|
9386
9381
|
let o = 0;
|
|
@@ -9514,6 +9509,7 @@ function Fe(l, o) {
|
|
|
9514
9509
|
}
|
|
9515
9510
|
class Zh {
|
|
9516
9511
|
constructor(o, e, r, i = "metric", a) {
|
|
9512
|
+
P(this, "onChange");
|
|
9517
9513
|
P(this, "map");
|
|
9518
9514
|
P(this, "layers", []);
|
|
9519
9515
|
P(this, "controlsGroup");
|
|
@@ -9530,28 +9526,28 @@ class Zh {
|
|
|
9530
9526
|
this.onChange = a, this.map = o, this.onSave = r, this.measurementSystem = i, this.controlsGroup = rt.layerGroup().addTo(o), this.baseCircleOptions = { ...e.options }, Object.assign(this.baseCircleOptions, this.style), delete this.baseCircleOptions.editing, delete this.baseCircleOptions.original, this.addLayer(e), this.installEditEventBridges(), this.renderControls();
|
|
9531
9527
|
}
|
|
9532
9528
|
installEditEventBridges() {
|
|
9533
|
-
var g, m, y,
|
|
9534
|
-
const o = Ei, e = (m = (g = o == null ? void 0 : o.Draw) == null ? void 0 : g.Event) == null ? void 0 : m.EDITMOVE, r = (
|
|
9529
|
+
var g, m, y, v, x, b, w, E;
|
|
9530
|
+
const o = Ei, e = (m = (g = o == null ? void 0 : o.Draw) == null ? void 0 : g.Event) == null ? void 0 : m.EDITMOVE, r = (v = (y = o == null ? void 0 : o.Draw) == null ? void 0 : y.Event) == null ? void 0 : v.EDITRESIZE, i = (b = (x = o == null ? void 0 : o.Draw) == null ? void 0 : x.Event) == null ? void 0 : b.EDITSTART, a = (E = (w = o == null ? void 0 : o.Draw) == null ? void 0 : w.Event) == null ? void 0 : E.EDITSTOP;
|
|
9535
9531
|
if (!e || !r) return;
|
|
9536
9532
|
const s = (T) => {
|
|
9537
|
-
const
|
|
9538
|
-
|
|
9533
|
+
const M = T == null ? void 0 : T.layer;
|
|
9534
|
+
M && this.layers.includes(M) && this.syncCenters(M);
|
|
9539
9535
|
}, c = (T) => {
|
|
9540
|
-
const
|
|
9541
|
-
|
|
9536
|
+
const M = T == null ? void 0 : T.layer;
|
|
9537
|
+
M && this.layers.includes(M) && (this.updateLabels(M), this.requestRenderControls());
|
|
9542
9538
|
}, d = (T) => {
|
|
9543
9539
|
var O;
|
|
9544
|
-
const
|
|
9545
|
-
if (!
|
|
9546
|
-
const S =
|
|
9547
|
-
(
|
|
9540
|
+
const M = T == null ? void 0 : T.layer;
|
|
9541
|
+
if (!M || !this.layers.includes(M)) return;
|
|
9542
|
+
const S = M;
|
|
9543
|
+
(O = S.getTooltip) != null && O.call(S) && this.updateLabels(S);
|
|
9548
9544
|
}, p = () => {
|
|
9549
9545
|
this.layers.forEach((T) => {
|
|
9550
9546
|
var S;
|
|
9551
|
-
const
|
|
9552
|
-
|
|
9547
|
+
const M = (S = T.getTooltip) == null ? void 0 : S.call(T);
|
|
9548
|
+
M && (T.setTooltipContent(
|
|
9553
9549
|
Fe(T.getRadius(), this.measurementSystem)
|
|
9554
|
-
),
|
|
9550
|
+
), M.options.offset = [10, 0], M.options.direction = "right", T.closeTooltip(), T.openTooltip());
|
|
9555
9551
|
});
|
|
9556
9552
|
};
|
|
9557
9553
|
this.map.on(e, s), this.map.on(r, c), i && (this.map.on(i, d), this.detachMapListeners.push(() => this.map.off(i, d))), a && (this.map.on(a, p), this.detachMapListeners.push(() => this.map.off(a, p))), this.detachMapListeners.push(() => this.map.off(e, s)), this.detachMapListeners.push(() => this.map.off(r, c));
|
|
@@ -9796,229 +9792,233 @@ function ba(l, o, e, r) {
|
|
|
9796
9792
|
}
|
|
9797
9793
|
function jh(l, o, e, r) {
|
|
9798
9794
|
const i = Le(l), a = Le(e), s = Le(r - o), c = Math.atan((1 - oe) * Math.tan(i)), d = Math.atan((1 - oe) * Math.tan(a)), p = Math.sin(c), g = Math.cos(c), m = Math.sin(d), y = Math.cos(d);
|
|
9799
|
-
let
|
|
9800
|
-
const
|
|
9801
|
-
let E = 0, T = 0,
|
|
9802
|
-
for (; Math.abs(
|
|
9803
|
-
const G = Math.sin(
|
|
9795
|
+
let v = s, x = Number.POSITIVE_INFINITY, b = 0;
|
|
9796
|
+
const w = 200;
|
|
9797
|
+
let E = 0, T = 0, M = 0, S = 0, I = 0;
|
|
9798
|
+
for (; Math.abs(v - x) > 1e-12 && b < w; ) {
|
|
9799
|
+
const G = Math.sin(v), W = Math.cos(v);
|
|
9804
9800
|
if (E = Math.sqrt(
|
|
9805
9801
|
(y * G) ** 2 + (g * m - p * y * W) ** 2
|
|
9806
9802
|
), E === 0)
|
|
9807
9803
|
return {
|
|
9808
9804
|
distanceMeters: 0,
|
|
9809
9805
|
bearingRad: 0,
|
|
9810
|
-
iterations:
|
|
9806
|
+
iterations: b,
|
|
9811
9807
|
converged: !0
|
|
9812
9808
|
};
|
|
9813
|
-
T = p * m + g * y * W,
|
|
9809
|
+
T = p * m + g * y * W, M = Math.atan2(E, T);
|
|
9814
9810
|
const K = g * y * G / E;
|
|
9815
9811
|
S = 1 - K ** 2, I = S === 0 ? 0 : T - 2 * p * m / S;
|
|
9816
9812
|
const vt = oe / 16 * S * (4 + oe * (4 - 3 * S));
|
|
9817
|
-
|
|
9813
|
+
x = v, v = s + (1 - vt) * oe * K * (M + vt * E * (I + vt * T * (-1 + 2 * I ** 2))), b += 1;
|
|
9818
9814
|
}
|
|
9819
|
-
if (
|
|
9815
|
+
if (b >= w)
|
|
9820
9816
|
return {
|
|
9821
9817
|
distanceMeters: Number.NaN,
|
|
9822
9818
|
bearingRad: 0,
|
|
9823
|
-
iterations:
|
|
9819
|
+
iterations: b,
|
|
9824
9820
|
converged: !1
|
|
9825
9821
|
};
|
|
9826
|
-
const O = (va ** 2 - be ** 2) / be ** 2 * S,
|
|
9827
|
-
y * Math.sin(
|
|
9828
|
-
g * m - p * y * Math.cos(
|
|
9822
|
+
const O = (va ** 2 - be ** 2) / be ** 2 * S, D = 1 + O / 16384 * (4096 + O * (-768 + O * (320 - 175 * O))), z = O / 1024 * (256 + O * (-128 + O * (74 - 47 * O))), U = z * E * (I + z / 4 * (T * (-1 + 2 * I ** 2) - z / 6 * I * (-3 + 4 * E ** 2) * (-3 + 4 * I ** 2))), Z = be * D * (M - U), R = Math.atan2(
|
|
9823
|
+
y * Math.sin(v),
|
|
9824
|
+
g * m - p * y * Math.cos(v)
|
|
9829
9825
|
);
|
|
9830
9826
|
return {
|
|
9831
9827
|
distanceMeters: Z,
|
|
9832
9828
|
bearingRad: R,
|
|
9833
|
-
iterations:
|
|
9829
|
+
iterations: b,
|
|
9834
9830
|
converged: !0
|
|
9835
9831
|
};
|
|
9836
9832
|
}
|
|
9837
9833
|
function Yh(l, o, e, r) {
|
|
9838
|
-
const i = Le(l), a = Le(e), s = Le(r - o), c = Math.atan((1 - oe) * Math.tan(i)), d = Math.atan((1 - oe) * Math.tan(a)), p = Math.sin(c), g = Math.cos(c), m = Math.sin(d), y = Math.cos(d),
|
|
9834
|
+
const i = Le(l), a = Le(e), s = Le(r - o), c = Math.atan((1 - oe) * Math.tan(i)), d = Math.atan((1 - oe) * Math.tan(a)), p = Math.sin(c), g = Math.cos(c), m = Math.sin(d), y = Math.cos(d), v = Math.sqrt(
|
|
9839
9835
|
(y * Math.sin(s)) ** 2 + (g * m - p * y * Math.cos(s)) ** 2
|
|
9840
|
-
),
|
|
9841
|
-
if (
|
|
9836
|
+
), x = p * m + g * y * Math.cos(s), b = Math.atan2(v, x);
|
|
9837
|
+
if (b === 0)
|
|
9842
9838
|
return { distanceMeters: 0, bearingRad: 0 };
|
|
9843
|
-
const E = 1 - (g * y * Math.sin(s) / Math.sin(
|
|
9839
|
+
const E = 1 - (g * y * Math.sin(s) / Math.sin(b)) ** 2, T = E === 0 ? 0 : x - 2 * p * m / E, M = (va ** 2 - be ** 2) / be ** 2 * E, S = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), I = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M))), O = I * v * (T + I / 4 * (x * (-1 + 2 * T ** 2) - I / 6 * T * (-3 + 4 * v ** 2) * (-3 + 4 * T ** 2))), D = be * S * (b - O), z = Math.atan2(
|
|
9844
9840
|
y * Math.sin(s),
|
|
9845
9841
|
g * m - p * y * Math.cos(s)
|
|
9846
9842
|
);
|
|
9847
|
-
return { distanceMeters:
|
|
9843
|
+
return { distanceMeters: D, bearingRad: z };
|
|
9848
9844
|
}
|
|
9849
9845
|
const ie = (l) => l !== null && typeof l == "object" && !Array.isArray(l), Cr = (l) => JSON.parse(JSON.stringify(l));
|
|
9850
9846
|
function Ci(l) {
|
|
9851
9847
|
const o = [];
|
|
9852
9848
|
let e = 0;
|
|
9853
|
-
const r = /* @__PURE__ */ new Set(), i = (
|
|
9854
|
-
o.push({ code:
|
|
9855
|
-
}, a = (
|
|
9856
|
-
"crs" in
|
|
9849
|
+
const r = /* @__PURE__ */ new Set(), i = (w, E, T, M = "error") => {
|
|
9850
|
+
o.push({ code: w, path: E, message: T, severity: M });
|
|
9851
|
+
}, a = (w, E) => {
|
|
9852
|
+
"crs" in w && i(
|
|
9857
9853
|
"crs-mismatch",
|
|
9858
|
-
`${
|
|
9854
|
+
`${E}.crs`,
|
|
9859
9855
|
"RFC 7946 uses WGS84 longitude/latitude; legacy CRS is not reprojected.",
|
|
9860
9856
|
"warning"
|
|
9861
9857
|
);
|
|
9862
|
-
}, s = (
|
|
9863
|
-
if (Array.isArray(
|
|
9858
|
+
}, s = (w, E) => {
|
|
9859
|
+
if (Array.isArray(w) && w.length === 0 && i("empty-geometry", E, "Point has no coordinates."), !Array.isArray(w) || w.length < 2 || !w.every((T) => typeof T == "number" && Number.isFinite(T))) {
|
|
9864
9860
|
i(
|
|
9865
9861
|
"invalid-position",
|
|
9866
|
-
|
|
9862
|
+
E,
|
|
9867
9863
|
"Expected at least two finite ordinates."
|
|
9868
9864
|
);
|
|
9869
9865
|
return;
|
|
9870
9866
|
}
|
|
9871
|
-
(Math.abs(
|
|
9867
|
+
(Math.abs(w[0]) > 180 || Math.abs(w[1]) > 90) && i(
|
|
9872
9868
|
"crs-mismatch",
|
|
9873
|
-
|
|
9869
|
+
E,
|
|
9874
9870
|
"Position outside WGS84 longitude/latitude range.",
|
|
9875
9871
|
"warning"
|
|
9876
9872
|
);
|
|
9877
|
-
}, c = (
|
|
9878
|
-
if (!Array.isArray(
|
|
9873
|
+
}, c = (w, E, T) => {
|
|
9874
|
+
if (!Array.isArray(w) || w.length === 0) {
|
|
9879
9875
|
i(
|
|
9880
9876
|
"empty-geometry",
|
|
9881
|
-
|
|
9877
|
+
E,
|
|
9882
9878
|
"Expected a non-empty coordinate/geometry array."
|
|
9883
9879
|
);
|
|
9884
9880
|
return;
|
|
9885
9881
|
}
|
|
9886
|
-
|
|
9887
|
-
}, d = (
|
|
9888
|
-
c(
|
|
9882
|
+
w.forEach((M, S) => T(M, `${E}[${S}]`));
|
|
9883
|
+
}, d = (w, E) => {
|
|
9884
|
+
c(w, E, s), Array.isArray(w) && w.length < 2 && i(
|
|
9889
9885
|
"invalid-line",
|
|
9890
|
-
|
|
9886
|
+
E,
|
|
9891
9887
|
"LineString requires at least two positions."
|
|
9892
9888
|
);
|
|
9893
|
-
}, p = (
|
|
9894
|
-
c(
|
|
9895
|
-
const
|
|
9896
|
-
Array.isArray(
|
|
9889
|
+
}, p = (w, E) => {
|
|
9890
|
+
c(w, E, s);
|
|
9891
|
+
const T = Array.isArray(w) ? w[0] : void 0, M = Array.isArray(w) ? w[w.length - 1] : void 0, S = Array.isArray(T) && Array.isArray(M) && T.length === M.length && T.every((I, O) => I === M[O]);
|
|
9892
|
+
Array.isArray(w) && (w.length < 4 || !S) && i(
|
|
9897
9893
|
"invalid-ring",
|
|
9898
|
-
|
|
9894
|
+
E,
|
|
9899
9895
|
"Linear rings require four positions and exact closure."
|
|
9900
9896
|
);
|
|
9901
|
-
}, g = (
|
|
9902
|
-
if (
|
|
9903
|
-
i("nesting-limit",
|
|
9897
|
+
}, g = (w, E) => c(w, E, p), m = (w, E, T) => {
|
|
9898
|
+
if (T > 64) {
|
|
9899
|
+
i("nesting-limit", E, "Geometry nesting exceeds 64.");
|
|
9904
9900
|
return;
|
|
9905
9901
|
}
|
|
9906
|
-
if (!ie(
|
|
9907
|
-
i("empty-geometry",
|
|
9902
|
+
if (!ie(w)) {
|
|
9903
|
+
i("empty-geometry", E, "Missing or null geometry.");
|
|
9908
9904
|
return;
|
|
9909
9905
|
}
|
|
9910
|
-
a(
|
|
9911
|
-
const
|
|
9912
|
-
switch (
|
|
9906
|
+
a(w, E);
|
|
9907
|
+
const M = `${E}.coordinates`;
|
|
9908
|
+
switch (w.type) {
|
|
9913
9909
|
case "Point":
|
|
9914
|
-
s(
|
|
9910
|
+
s(w.coordinates, M);
|
|
9915
9911
|
break;
|
|
9916
9912
|
case "LineString":
|
|
9917
|
-
d(
|
|
9913
|
+
d(w.coordinates, M);
|
|
9918
9914
|
break;
|
|
9919
9915
|
case "Polygon":
|
|
9920
|
-
g(
|
|
9916
|
+
g(w.coordinates, M);
|
|
9921
9917
|
break;
|
|
9922
9918
|
case "MultiPoint":
|
|
9923
|
-
c(
|
|
9919
|
+
c(w.coordinates, M, s);
|
|
9924
9920
|
break;
|
|
9925
9921
|
case "MultiLineString":
|
|
9926
|
-
c(
|
|
9922
|
+
c(w.coordinates, M, d);
|
|
9927
9923
|
break;
|
|
9928
9924
|
case "MultiPolygon":
|
|
9929
|
-
c(
|
|
9925
|
+
c(w.coordinates, M, g);
|
|
9930
9926
|
break;
|
|
9931
9927
|
case "GeometryCollection":
|
|
9932
9928
|
c(
|
|
9933
|
-
|
|
9934
|
-
`${
|
|
9935
|
-
(
|
|
9929
|
+
w.geometries,
|
|
9930
|
+
`${E}.geometries`,
|
|
9931
|
+
(S, I) => m(S, I, T + 1)
|
|
9936
9932
|
);
|
|
9937
9933
|
break;
|
|
9938
9934
|
default:
|
|
9939
9935
|
i(
|
|
9940
9936
|
"unsupported-geometry",
|
|
9941
|
-
|
|
9942
|
-
`Unsupported geometry: ${typeof
|
|
9937
|
+
E,
|
|
9938
|
+
`Unsupported geometry: ${typeof w.type == "string" ? w.type : "missing or non-string type"}.`
|
|
9943
9939
|
);
|
|
9944
9940
|
}
|
|
9945
|
-
typeof
|
|
9941
|
+
typeof w.type == "string" && (w.type.startsWith("Multi") || w.type === "GeometryCollection") && i(
|
|
9946
9942
|
"multi-expansion",
|
|
9947
|
-
|
|
9943
|
+
E,
|
|
9948
9944
|
"Editing adapters expand this geometry into single-geometry features.",
|
|
9949
9945
|
"info"
|
|
9950
9946
|
);
|
|
9951
|
-
}, y = (
|
|
9952
|
-
var
|
|
9953
|
-
if (e++, !ie(
|
|
9954
|
-
i("invalid-feature",
|
|
9947
|
+
}, y = (w, E) => {
|
|
9948
|
+
var S;
|
|
9949
|
+
if (e++, !ie(w) || w.type !== "Feature") {
|
|
9950
|
+
i("invalid-feature", E, "Expected a Feature.");
|
|
9955
9951
|
return;
|
|
9956
9952
|
}
|
|
9957
|
-
if (a(
|
|
9953
|
+
if (a(w, E), w.properties === null || ie(w.properties) || i(
|
|
9958
9954
|
"invalid-properties",
|
|
9959
|
-
`${
|
|
9955
|
+
`${E}.properties`,
|
|
9960
9956
|
"Expected an object or null."
|
|
9961
|
-
), ie(
|
|
9962
|
-
const
|
|
9963
|
-
|
|
9957
|
+
), ie(w.properties)) {
|
|
9958
|
+
const I = w.properties.id;
|
|
9959
|
+
w.id === void 0 && I !== void 0 && !(typeof I == "string" && I.length > 0) && !(typeof I == "number" && Number.isFinite(I)) && i(
|
|
9964
9960
|
"invalid-id",
|
|
9965
|
-
`${
|
|
9961
|
+
`${E}.properties.id`,
|
|
9966
9962
|
"Fallback ID must be a non-empty string or finite number."
|
|
9967
9963
|
);
|
|
9968
|
-
const
|
|
9969
|
-
|
|
9970
|
-
(
|
|
9964
|
+
const O = w.properties["geokit:source"];
|
|
9965
|
+
O !== void 0 && (!Array.isArray(O) || O.length === 0 || O.length > 64 || !O.every(
|
|
9966
|
+
(D) => ie(D) && typeof D.type == "string" && [
|
|
9971
9967
|
"MultiPoint",
|
|
9972
9968
|
"MultiLineString",
|
|
9973
9969
|
"MultiPolygon",
|
|
9974
9970
|
"GeometryCollection"
|
|
9975
|
-
].includes(
|
|
9971
|
+
].includes(D.type) && (typeof D.id == "string" || typeof D.id == "number") && typeof D.hasPropertyId == "boolean" && typeof D.nullProperties == "boolean"
|
|
9976
9972
|
)) && i(
|
|
9977
9973
|
"invalid-provenance",
|
|
9978
|
-
`${
|
|
9974
|
+
`${E}.properties.geokit:source`,
|
|
9979
9975
|
"Reserved expansion provenance is malformed."
|
|
9980
9976
|
);
|
|
9981
9977
|
}
|
|
9982
|
-
|
|
9978
|
+
w.id !== void 0 && !(typeof w.id == "string" && w.id.length > 0) && !(typeof w.id == "number" && Number.isFinite(w.id)) && i(
|
|
9983
9979
|
"invalid-id",
|
|
9984
|
-
`${
|
|
9980
|
+
`${E}.id`,
|
|
9985
9981
|
"Feature ID must be a non-empty string or finite number."
|
|
9986
9982
|
);
|
|
9987
|
-
const
|
|
9988
|
-
|
|
9989
|
-
},
|
|
9990
|
-
|
|
9991
|
-
|
|
9983
|
+
const T = (S = w.id) != null ? S : ie(w.properties) ? w.properties.id : void 0, M = typeof T == "string" || typeof T == "number" ? String(T) : void 0;
|
|
9984
|
+
M !== void 0 && (r.has(M) && i("duplicate-id", `${E}.id`, `Duplicate feature ID: ${M}.`), r.add(M)), m(w.geometry, `${E}.geometry`, 0);
|
|
9985
|
+
}, v = /* @__PURE__ */ new Set();
|
|
9986
|
+
let x = !1;
|
|
9987
|
+
const b = (w, E, T) => {
|
|
9988
|
+
if (T > 128) {
|
|
9989
|
+
x = !0, i("nesting-limit", E, "JSON nesting exceeds 128.");
|
|
9992
9990
|
return;
|
|
9993
9991
|
}
|
|
9994
|
-
if (!(
|
|
9995
|
-
if (typeof
|
|
9996
|
-
i("invalid-json",
|
|
9992
|
+
if (!(w === null || typeof w == "string" || typeof w == "boolean") && !(typeof w == "number" && Number.isFinite(w))) {
|
|
9993
|
+
if (typeof w != "object" || w === null || v.has(w)) {
|
|
9994
|
+
typeof w == "object" && w !== null && v.has(w) && (x = !0), i("invalid-json", E, "Expected finite, acyclic JSON values.");
|
|
9997
9995
|
return;
|
|
9998
9996
|
}
|
|
9999
|
-
if (!Array.isArray(
|
|
10000
|
-
i("invalid-json",
|
|
9997
|
+
if (!Array.isArray(w) && Object.getPrototypeOf(w) !== Object.prototype && Object.getPrototypeOf(w) !== null) {
|
|
9998
|
+
i("invalid-json", E, "Expected a plain JSON object.");
|
|
10001
9999
|
return;
|
|
10002
10000
|
}
|
|
10003
|
-
if (
|
|
10004
|
-
for (let
|
|
10005
|
-
|
|
10001
|
+
if (v.add(w), Array.isArray(w))
|
|
10002
|
+
for (let M = 0; M < w.length; M++)
|
|
10003
|
+
b(w[M], `${E}[${M}]`, T + 1);
|
|
10006
10004
|
else
|
|
10007
|
-
Object.entries(
|
|
10008
|
-
([
|
|
10005
|
+
Object.entries(w).forEach(
|
|
10006
|
+
([M, S]) => b(S, `${E}.${M}`, T + 1)
|
|
10009
10007
|
);
|
|
10010
|
-
|
|
10008
|
+
v.delete(w);
|
|
10011
10009
|
}
|
|
10012
10010
|
};
|
|
10013
|
-
return
|
|
10014
|
-
valid: !o.some((
|
|
10011
|
+
return b(l, "$", 0), x ? { valid: !1, featureCount: e, diagnostics: o } : (ie(l) ? l.type === "FeatureCollection" ? (a(l, "$"), Array.isArray(l.features) ? l.features.forEach((w, E) => y(w, `$.features[${E}]`)) : i("invalid-collection", "$.features", "Expected a features array.")) : l.type === "Feature" ? y(l, "$") : (e = 1, m(l, "$", 0)) : i("invalid-input", "$", "Expected a GeoJSON object."), {
|
|
10012
|
+
valid: !o.some((w) => w.severity === "error"),
|
|
10015
10013
|
featureCount: e,
|
|
10016
10014
|
diagnostics: o
|
|
10017
|
-
};
|
|
10015
|
+
});
|
|
10018
10016
|
}
|
|
10019
10017
|
class Jo extends Error {
|
|
10020
|
-
constructor(
|
|
10021
|
-
super("GeoJSON validation failed")
|
|
10018
|
+
constructor(e) {
|
|
10019
|
+
super("GeoJSON validation failed");
|
|
10020
|
+
P(this, "summary");
|
|
10021
|
+
this.summary = e, this.name = "GeoJSONValidationError";
|
|
10022
10022
|
}
|
|
10023
10023
|
}
|
|
10024
10024
|
function Wo(l, o = {}) {
|
|
@@ -10421,67 +10421,67 @@ function Ta(l, o, e, r, i = {}, a) {
|
|
|
10421
10421
|
if (!Number.isFinite(c) || c <= 0) return null;
|
|
10422
10422
|
const d = e(l);
|
|
10423
10423
|
let p = null;
|
|
10424
|
-
const g = (
|
|
10425
|
-
const E = oc(d,
|
|
10424
|
+
const g = (v, x, b = {}, w) => {
|
|
10425
|
+
const E = oc(d, v);
|
|
10426
10426
|
if (E > c) return;
|
|
10427
|
-
const T = s.indexOf(
|
|
10428
|
-
p && (E > p.distancePx + 1e-3 || E >= p.distancePx - 1e-3 && T >
|
|
10429
|
-
latlng:
|
|
10430
|
-
point:
|
|
10427
|
+
const T = s.indexOf(x), M = p ? s.indexOf(p.mode) : Number.MAX_SAFE_INTEGER;
|
|
10428
|
+
p && (E > p.distancePx + 1e-3 || E >= p.distancePx - 1e-3 && T > M) || (p = {
|
|
10429
|
+
latlng: w != null ? w : r(v),
|
|
10430
|
+
point: v,
|
|
10431
10431
|
distancePx: E,
|
|
10432
|
-
mode:
|
|
10433
|
-
...
|
|
10432
|
+
mode: x,
|
|
10433
|
+
...b
|
|
10434
10434
|
});
|
|
10435
10435
|
};
|
|
10436
|
-
for (const
|
|
10437
|
-
if (!
|
|
10436
|
+
for (const v of o) {
|
|
10437
|
+
if (!v.visible || v.layerKind === "measurement" || v.featureId === a)
|
|
10438
10438
|
continue;
|
|
10439
|
-
const
|
|
10440
|
-
(
|
|
10439
|
+
const x = v.layerKind === "guide" ? s.includes("guide") ? ["guide"] : [] : s.filter(
|
|
10440
|
+
(b) => b === "vertex" || b === "edge"
|
|
10441
10441
|
);
|
|
10442
|
-
for (const
|
|
10443
|
-
|
|
10444
|
-
const E = Ao(
|
|
10442
|
+
for (const b of x)
|
|
10443
|
+
b === "vertex" ? Aa(v.feature.geometry, (w) => {
|
|
10444
|
+
const E = Ao(w);
|
|
10445
10445
|
E && g(
|
|
10446
10446
|
e({ lng: E[0], lat: E[1] }),
|
|
10447
|
-
|
|
10447
|
+
b,
|
|
10448
10448
|
{
|
|
10449
|
-
targetFeatureId:
|
|
10450
|
-
targetLayerId:
|
|
10449
|
+
targetFeatureId: v.featureId,
|
|
10450
|
+
targetLayerId: v.layerId
|
|
10451
10451
|
},
|
|
10452
10452
|
{ lng: E[0], lat: E[1] }
|
|
10453
10453
|
);
|
|
10454
|
-
}) : Ma(
|
|
10455
|
-
for (let E = 1; E <
|
|
10456
|
-
const T = Ao(
|
|
10457
|
-
if (!T || !
|
|
10458
|
-
const S = e({ lng: T[0], lat: T[1] }), I = e({ lng:
|
|
10454
|
+
}) : Ma(v.feature.geometry, (w) => {
|
|
10455
|
+
for (let E = 1; E < w.length; E++) {
|
|
10456
|
+
const T = Ao(w[E - 1]), M = Ao(w[E]);
|
|
10457
|
+
if (!T || !M) continue;
|
|
10458
|
+
const S = e({ lng: T[0], lat: T[1] }), I = e({ lng: M[0], lat: M[1] }), O = nc(d, S, I), D = (I.x - S.x) ** 2 + (I.y - S.y) ** 2, z = D === 0 ? 0 : Math.max(
|
|
10459
10459
|
0,
|
|
10460
10460
|
Math.min(
|
|
10461
10461
|
1,
|
|
10462
|
-
((O.x - S.x) * (I.x - S.x) + (O.y - S.y) * (I.y - S.y)) /
|
|
10462
|
+
((O.x - S.x) * (I.x - S.x) + (O.y - S.y) * (I.y - S.y)) / D
|
|
10463
10463
|
)
|
|
10464
10464
|
);
|
|
10465
10465
|
g(
|
|
10466
10466
|
O,
|
|
10467
|
-
|
|
10467
|
+
b,
|
|
10468
10468
|
{
|
|
10469
|
-
targetFeatureId:
|
|
10470
|
-
targetLayerId:
|
|
10469
|
+
targetFeatureId: v.featureId,
|
|
10470
|
+
targetLayerId: v.layerId
|
|
10471
10471
|
},
|
|
10472
10472
|
{
|
|
10473
|
-
lng: T[0] + (
|
|
10474
|
-
lat: T[1] + (
|
|
10473
|
+
lng: T[0] + (M[0] - T[0]) * z,
|
|
10474
|
+
lat: T[1] + (M[1] - T[1]) * z
|
|
10475
10475
|
}
|
|
10476
10476
|
);
|
|
10477
10477
|
}
|
|
10478
10478
|
});
|
|
10479
10479
|
}
|
|
10480
10480
|
if (s.includes("grid") && Number.isFinite(i.gridSizeMeters) && ((y = i.gridSizeMeters) != null ? y : 0) > 0) {
|
|
10481
|
-
const
|
|
10482
|
-
if (
|
|
10483
|
-
const
|
|
10484
|
-
g(
|
|
10481
|
+
const v = hc(l, i);
|
|
10482
|
+
if (v) {
|
|
10483
|
+
const x = e(v);
|
|
10484
|
+
g(x, "grid", {}, v);
|
|
10485
10485
|
}
|
|
10486
10486
|
}
|
|
10487
10487
|
return p;
|
|
@@ -10544,30 +10544,30 @@ function Or(l) {
|
|
|
10544
10544
|
return !isNaN(l) && l !== null && !Array.isArray(l);
|
|
10545
10545
|
}
|
|
10546
10546
|
function Ca(l, o) {
|
|
10547
|
-
var e, r, i, a, s, c, d, p, g, m, y = 0,
|
|
10548
|
-
for (e = 0; e <
|
|
10549
|
-
for (c =
|
|
10547
|
+
var e, r, i, a, s, c, d, p, g, m, y = 0, v = l.type === "FeatureCollection", x = l.type === "Feature", b = v ? l.features.length : 1;
|
|
10548
|
+
for (e = 0; e < b; e++) {
|
|
10549
|
+
for (c = v ? (
|
|
10550
10550
|
// @ts-expect-error: Known type conflict
|
|
10551
10551
|
l.features[e].geometry
|
|
10552
|
-
) :
|
|
10552
|
+
) : x ? (
|
|
10553
10553
|
// @ts-expect-error: Known type conflict
|
|
10554
10554
|
l.geometry
|
|
10555
|
-
) : l, p =
|
|
10555
|
+
) : l, p = v ? (
|
|
10556
10556
|
// @ts-expect-error: Known type conflict
|
|
10557
10557
|
l.features[e].properties
|
|
10558
|
-
) :
|
|
10558
|
+
) : x ? (
|
|
10559
10559
|
// @ts-expect-error: Known type conflict
|
|
10560
10560
|
l.properties
|
|
10561
|
-
) : {}, g =
|
|
10561
|
+
) : {}, g = v ? (
|
|
10562
10562
|
// @ts-expect-error: Known type conflict
|
|
10563
10563
|
l.features[e].bbox
|
|
10564
|
-
) :
|
|
10564
|
+
) : x ? (
|
|
10565
10565
|
// @ts-expect-error: Known type conflict
|
|
10566
10566
|
l.bbox
|
|
10567
|
-
) : void 0, m =
|
|
10567
|
+
) : void 0, m = v ? (
|
|
10568
10568
|
// @ts-expect-error: Known type conflict
|
|
10569
10569
|
l.features[e].id
|
|
10570
|
-
) :
|
|
10570
|
+
) : x ? (
|
|
10571
10571
|
// @ts-expect-error: Known type conflict
|
|
10572
10572
|
l.id
|
|
10573
10573
|
) : void 0, d = c ? c.type === "GeometryCollection" : !1, s = d ? c.geometries.length : 1, i = 0; i < s; i++) {
|
|
@@ -10771,15 +10771,15 @@ const Zt = 11102230246251565e-32, pt = 134217729, gc = (3 + 8 * Zt) * Zt;
|
|
|
10771
10771
|
function Co(l, o, e, r, i) {
|
|
10772
10772
|
let a, s, c, d, p = o[0], g = r[0], m = 0, y = 0;
|
|
10773
10773
|
g > p == g > -p ? (a = p, p = o[++m]) : (a = g, g = r[++y]);
|
|
10774
|
-
let
|
|
10774
|
+
let v = 0;
|
|
10775
10775
|
if (m < l && y < e)
|
|
10776
|
-
for (g > p == g > -p ? (s = p + a, c = a - (s - p), p = o[++m]) : (s = g + a, c = a - (s - g), g = r[++y]), a = s, c !== 0 && (i[
|
|
10777
|
-
g > p == g > -p ? (s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m]) : (s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y]), a = s, c !== 0 && (i[
|
|
10776
|
+
for (g > p == g > -p ? (s = p + a, c = a - (s - p), p = o[++m]) : (s = g + a, c = a - (s - g), g = r[++y]), a = s, c !== 0 && (i[v++] = c); m < l && y < e; )
|
|
10777
|
+
g > p == g > -p ? (s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m]) : (s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y]), a = s, c !== 0 && (i[v++] = c);
|
|
10778
10778
|
for (; m < l; )
|
|
10779
|
-
s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m], a = s, c !== 0 && (i[
|
|
10779
|
+
s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m], a = s, c !== 0 && (i[v++] = c);
|
|
10780
10780
|
for (; y < e; )
|
|
10781
|
-
s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y], a = s, c !== 0 && (i[
|
|
10782
|
-
return (a !== 0 ||
|
|
10781
|
+
s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y], a = s, c !== 0 && (i[v++] = c);
|
|
10782
|
+
return (a !== 0 || v === 0) && (i[v++] = a), v;
|
|
10783
10783
|
}
|
|
10784
10784
|
function _c(l, o) {
|
|
10785
10785
|
let e = o[0];
|
|
@@ -10791,16 +10791,16 @@ function Xe(l) {
|
|
|
10791
10791
|
}
|
|
10792
10792
|
const yc = (3 + 16 * Zt) * Zt, vc = (2 + 12 * Zt) * Zt, bc = (9 + 64 * Zt) * Zt * Zt, ge = Xe(4), Rr = Xe(8), Nr = Xe(12), Ur = Xe(16), _t = Xe(4);
|
|
10793
10793
|
function Lc(l, o, e, r, i, a, s) {
|
|
10794
|
-
let c, d, p, g, m, y,
|
|
10794
|
+
let c, d, p, g, m, y, v, x, b, w, E, T, M, S, I, O, D, z;
|
|
10795
10795
|
const U = l - i, Z = e - i, R = o - a, G = r - a;
|
|
10796
|
-
S = U * G, y = pt * U,
|
|
10796
|
+
S = U * G, y = pt * U, v = y - (y - U), x = U - v, y = pt * G, b = y - (y - G), w = G - b, I = x * w - (S - v * b - x * b - v * w), O = R * Z, y = pt * R, v = y - (y - R), x = R - v, y = pt * Z, b = y - (y - Z), w = Z - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, ge[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, ge[1] = M - (E + m) + (m - O), z = T + E, m = z - T, ge[2] = T - (z - m) + (E - m), ge[3] = z;
|
|
10797
10797
|
let W = _c(4, ge), K = vc * s;
|
|
10798
10798
|
if (W >= K || -W >= K || (m = l - U, c = l - (U + m) + (m - i), m = e - Z, p = e - (Z + m) + (m - i), m = o - R, d = o - (R + m) + (m - a), m = r - G, g = r - (G + m) + (m - a), c === 0 && d === 0 && p === 0 && g === 0) || (K = bc * s + gc * Math.abs(W), W += U * g + G * c - (R * p + Z * d), W >= K || -W >= K)) return W;
|
|
10799
|
-
S = c * G, y = pt * c,
|
|
10799
|
+
S = c * G, y = pt * c, v = y - (y - c), x = c - v, y = pt * G, b = y - (y - G), w = G - b, I = x * w - (S - v * b - x * b - v * w), O = d * Z, y = pt * d, v = y - (y - d), x = d - v, y = pt * Z, b = y - (y - Z), w = Z - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, _t[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, _t[1] = M - (E + m) + (m - O), z = T + E, m = z - T, _t[2] = T - (z - m) + (E - m), _t[3] = z;
|
|
10800
10800
|
const vt = Co(4, ge, 4, _t, Rr);
|
|
10801
|
-
S = U * g, y = pt * U,
|
|
10801
|
+
S = U * g, y = pt * U, v = y - (y - U), x = U - v, y = pt * g, b = y - (y - g), w = g - b, I = x * w - (S - v * b - x * b - v * w), O = R * p, y = pt * R, v = y - (y - R), x = R - v, y = pt * p, b = y - (y - p), w = p - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, _t[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, _t[1] = M - (E + m) + (m - O), z = T + E, m = z - T, _t[2] = T - (z - m) + (E - m), _t[3] = z;
|
|
10802
10802
|
const at = Co(vt, Rr, 4, _t, Nr);
|
|
10803
|
-
S = c * g, y = pt * c,
|
|
10803
|
+
S = c * g, y = pt * c, v = y - (y - c), x = c - v, y = pt * g, b = y - (y - g), w = g - b, I = x * w - (S - v * b - x * b - v * w), O = d * p, y = pt * d, v = y - (y - d), x = d - v, y = pt * p, b = y - (y - p), w = p - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, _t[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, _t[1] = M - (E + m) + (m - O), z = T + E, m = z - T, _t[2] = T - (z - m) + (E - m), _t[3] = z;
|
|
10804
10804
|
const Dt = Co(at, Nr, 4, _t, Ur);
|
|
10805
10805
|
return Ur[Dt - 1];
|
|
10806
10806
|
}
|
|
@@ -10809,14 +10809,14 @@ function wc(l, o, e, r, i, a) {
|
|
|
10809
10809
|
return Math.abs(d) >= yc * p ? d : -Lc(l, o, e, r, i, a, p);
|
|
10810
10810
|
}
|
|
10811
10811
|
function kc(l, o) {
|
|
10812
|
-
var e, r, i = 0, a, s, c, d, p, g, m, y = l[0],
|
|
10813
|
-
for (e = 0; e <
|
|
10812
|
+
var e, r, i = 0, a, s, c, d, p, g, m, y = l[0], v = l[1], x = o.length;
|
|
10813
|
+
for (e = 0; e < x; e++) {
|
|
10814
10814
|
r = 0;
|
|
10815
|
-
var
|
|
10816
|
-
if (g =
|
|
10815
|
+
var b = o[e], w = b.length - 1;
|
|
10816
|
+
if (g = b[0], g[0] !== b[w][0] && g[1] !== b[w][1])
|
|
10817
10817
|
throw new Error("First and last coordinates in a ring must be the same");
|
|
10818
|
-
for (s = g[0] - y, c = g[1] -
|
|
10819
|
-
if (m =
|
|
10818
|
+
for (s = g[0] - y, c = g[1] - v, r; r < w; r++) {
|
|
10819
|
+
if (m = b[r + 1], d = m[0] - y, p = m[1] - v, c === 0 && p === 0) {
|
|
10820
10820
|
if (d <= 0 && s >= 0 || s <= 0 && d >= 0)
|
|
10821
10821
|
return 0;
|
|
10822
10822
|
} else if (p >= 0 && c <= 0 || p <= 0 && c >= 0) {
|
|
@@ -10892,15 +10892,15 @@ const Ht = 11102230246251565e-32, mt = 134217729, Mc = (3 + 8 * Ht) * Ht;
|
|
|
10892
10892
|
function Po(l, o, e, r, i) {
|
|
10893
10893
|
let a, s, c, d, p = o[0], g = r[0], m = 0, y = 0;
|
|
10894
10894
|
g > p == g > -p ? (a = p, p = o[++m]) : (a = g, g = r[++y]);
|
|
10895
|
-
let
|
|
10895
|
+
let v = 0;
|
|
10896
10896
|
if (m < l && y < e)
|
|
10897
|
-
for (g > p == g > -p ? (s = p + a, c = a - (s - p), p = o[++m]) : (s = g + a, c = a - (s - g), g = r[++y]), a = s, c !== 0 && (i[
|
|
10898
|
-
g > p == g > -p ? (s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m]) : (s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y]), a = s, c !== 0 && (i[
|
|
10897
|
+
for (g > p == g > -p ? (s = p + a, c = a - (s - p), p = o[++m]) : (s = g + a, c = a - (s - g), g = r[++y]), a = s, c !== 0 && (i[v++] = c); m < l && y < e; )
|
|
10898
|
+
g > p == g > -p ? (s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m]) : (s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y]), a = s, c !== 0 && (i[v++] = c);
|
|
10899
10899
|
for (; m < l; )
|
|
10900
|
-
s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m], a = s, c !== 0 && (i[
|
|
10900
|
+
s = a + p, d = s - a, c = a - (s - d) + (p - d), p = o[++m], a = s, c !== 0 && (i[v++] = c);
|
|
10901
10901
|
for (; y < e; )
|
|
10902
|
-
s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y], a = s, c !== 0 && (i[
|
|
10903
|
-
return (a !== 0 ||
|
|
10902
|
+
s = a + g, d = s - a, c = a - (s - d) + (g - d), g = r[++y], a = s, c !== 0 && (i[v++] = c);
|
|
10903
|
+
return (a !== 0 || v === 0) && (i[v++] = a), v;
|
|
10904
10904
|
}
|
|
10905
10905
|
function Ac(l, o) {
|
|
10906
10906
|
let e = o[0];
|
|
@@ -10912,16 +10912,16 @@ function Qe(l) {
|
|
|
10912
10912
|
}
|
|
10913
10913
|
const Tc = (3 + 16 * Ht) * Ht, Cc = (2 + 12 * Ht) * Ht, Pc = (9 + 64 * Ht) * Ht * Ht, _e = Qe(4), Fr = Qe(8), Gr = Qe(12), Zr = Qe(16), yt = Qe(4);
|
|
10914
10914
|
function Sc(l, o, e, r, i, a, s) {
|
|
10915
|
-
let c, d, p, g, m, y,
|
|
10915
|
+
let c, d, p, g, m, y, v, x, b, w, E, T, M, S, I, O, D, z;
|
|
10916
10916
|
const U = l - i, Z = e - i, R = o - a, G = r - a;
|
|
10917
|
-
S = U * G, y = mt * U,
|
|
10917
|
+
S = U * G, y = mt * U, v = y - (y - U), x = U - v, y = mt * G, b = y - (y - G), w = G - b, I = x * w - (S - v * b - x * b - v * w), O = R * Z, y = mt * R, v = y - (y - R), x = R - v, y = mt * Z, b = y - (y - Z), w = Z - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, _e[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, _e[1] = M - (E + m) + (m - O), z = T + E, m = z - T, _e[2] = T - (z - m) + (E - m), _e[3] = z;
|
|
10918
10918
|
let W = Ac(4, _e), K = Cc * s;
|
|
10919
10919
|
if (W >= K || -W >= K || (m = l - U, c = l - (U + m) + (m - i), m = e - Z, p = e - (Z + m) + (m - i), m = o - R, d = o - (R + m) + (m - a), m = r - G, g = r - (G + m) + (m - a), c === 0 && d === 0 && p === 0 && g === 0) || (K = Pc * s + Mc * Math.abs(W), W += U * g + G * c - (R * p + Z * d), W >= K || -W >= K)) return W;
|
|
10920
|
-
S = c * G, y = mt * c,
|
|
10920
|
+
S = c * G, y = mt * c, v = y - (y - c), x = c - v, y = mt * G, b = y - (y - G), w = G - b, I = x * w - (S - v * b - x * b - v * w), O = d * Z, y = mt * d, v = y - (y - d), x = d - v, y = mt * Z, b = y - (y - Z), w = Z - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, yt[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, yt[1] = M - (E + m) + (m - O), z = T + E, m = z - T, yt[2] = T - (z - m) + (E - m), yt[3] = z;
|
|
10921
10921
|
const vt = Po(4, _e, 4, yt, Fr);
|
|
10922
|
-
S = U * g, y = mt * U,
|
|
10922
|
+
S = U * g, y = mt * U, v = y - (y - U), x = U - v, y = mt * g, b = y - (y - g), w = g - b, I = x * w - (S - v * b - x * b - v * w), O = R * p, y = mt * R, v = y - (y - R), x = R - v, y = mt * p, b = y - (y - p), w = p - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, yt[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, yt[1] = M - (E + m) + (m - O), z = T + E, m = z - T, yt[2] = T - (z - m) + (E - m), yt[3] = z;
|
|
10923
10923
|
const at = Po(vt, Fr, 4, yt, Gr);
|
|
10924
|
-
S = c * g, y = mt * c,
|
|
10924
|
+
S = c * g, y = mt * c, v = y - (y - c), x = c - v, y = mt * g, b = y - (y - g), w = g - b, I = x * w - (S - v * b - x * b - v * w), O = d * p, y = mt * d, v = y - (y - d), x = d - v, y = mt * p, b = y - (y - p), w = p - b, D = x * w - (O - v * b - x * b - v * w), E = I - D, m = I - E, yt[0] = I - (E + m) + (m - D), T = S + E, m = T - S, M = S - (T - m) + (E - m), E = M - O, m = M - E, yt[1] = M - (E + m) + (m - O), z = T + E, m = z - T, yt[2] = T - (z - m) + (E - m), yt[3] = z;
|
|
10925
10925
|
const Dt = Po(at, Gr, 4, yt, Zr);
|
|
10926
10926
|
return Zr[Dt - 1];
|
|
10927
10927
|
}
|
|
@@ -11022,12 +11022,12 @@ function Rc(l, o) {
|
|
|
11022
11022
|
if (l.leftSweepEvent.isSamePoint(o.rightSweepEvent))
|
|
11023
11023
|
return o.rightSweepEvent.asNewXY();
|
|
11024
11024
|
}
|
|
11025
|
-
const y = (p - c) * (i - e) - (d - s) * (a - r),
|
|
11025
|
+
const y = (p - c) * (i - e) - (d - s) * (a - r), v = (d - s) * (r - c) - (p - c) * (e - s), x = (i - e) * (r - c) - (a - r) * (e - s);
|
|
11026
11026
|
if (y === 0)
|
|
11027
11027
|
return !1;
|
|
11028
|
-
const
|
|
11029
|
-
if (
|
|
11030
|
-
const E = e +
|
|
11028
|
+
const b = v / y, w = x / y;
|
|
11029
|
+
if (b >= 0 && b <= 1 && w >= 0 && w <= 1) {
|
|
11030
|
+
const E = e + b * (i - e), T = r + b * (a - r);
|
|
11031
11031
|
return [E, T];
|
|
11032
11032
|
}
|
|
11033
11033
|
return !1;
|
|
@@ -11314,22 +11314,22 @@ function $o(l, o, e = {}) {
|
|
|
11314
11314
|
return !1;
|
|
11315
11315
|
}
|
|
11316
11316
|
function jc(l, o, e, r, i) {
|
|
11317
|
-
const a = e[0], s = e[1], c = l[0], d = l[1], p = o[0], g = o[1], m = e[0] - c, y = e[1] - d,
|
|
11317
|
+
const a = e[0], s = e[1], c = l[0], d = l[1], p = o[0], g = o[1], m = e[0] - c, y = e[1] - d, v = p - c, x = g - d, b = m * x - y * v;
|
|
11318
11318
|
if (i !== null) {
|
|
11319
|
-
if (Math.abs(
|
|
11319
|
+
if (Math.abs(b) > i)
|
|
11320
11320
|
return !1;
|
|
11321
|
-
} else if (
|
|
11321
|
+
} else if (b !== 0)
|
|
11322
11322
|
return !1;
|
|
11323
|
-
if (Math.abs(
|
|
11323
|
+
if (Math.abs(v) === Math.abs(x) && Math.abs(v) === 0)
|
|
11324
11324
|
return r ? !1 : e[0] === l[0] && e[1] === l[1];
|
|
11325
11325
|
if (r) {
|
|
11326
11326
|
if (r === "start")
|
|
11327
|
-
return Math.abs(
|
|
11327
|
+
return Math.abs(v) >= Math.abs(x) ? v > 0 ? c < a && a <= p : p <= a && a < c : x > 0 ? d < s && s <= g : g <= s && s < d;
|
|
11328
11328
|
if (r === "end")
|
|
11329
|
-
return Math.abs(
|
|
11329
|
+
return Math.abs(v) >= Math.abs(x) ? v > 0 ? c <= a && a < p : p < a && a <= c : x > 0 ? d <= s && s < g : g < s && s <= d;
|
|
11330
11330
|
if (r === "both")
|
|
11331
|
-
return Math.abs(
|
|
11332
|
-
} else return Math.abs(
|
|
11331
|
+
return Math.abs(v) >= Math.abs(x) ? v > 0 ? c < a && a < p : p < a && a < c : x > 0 ? d < s && s < g : g < s && s < d;
|
|
11332
|
+
} else return Math.abs(v) >= Math.abs(x) ? v > 0 ? c <= a && a <= p : p <= a && a <= c : x > 0 ? d <= s && s <= g : g <= s && s <= d;
|
|
11333
11333
|
return !1;
|
|
11334
11334
|
}
|
|
11335
11335
|
function jr(l, o = {}) {
|
|
@@ -11590,13 +11590,13 @@ function tu(l) {
|
|
|
11590
11590
|
}
|
|
11591
11591
|
function eu(l, o, e, r, i, a, s, c) {
|
|
11592
11592
|
let d, p, g, m, y;
|
|
11593
|
-
const
|
|
11593
|
+
const v = {
|
|
11594
11594
|
x: null,
|
|
11595
11595
|
y: null,
|
|
11596
11596
|
onLine1: !1,
|
|
11597
11597
|
onLine2: !1
|
|
11598
11598
|
};
|
|
11599
|
-
return d = (c - a) * (e - l) - (s - i) * (r - o), d === 0 ?
|
|
11599
|
+
return d = (c - a) * (e - l) - (s - i) * (r - o), d === 0 ? v.x !== null && v.y !== null ? v : !1 : (p = o - a, g = l - i, m = (s - i) * p - (c - a) * g, y = (e - l) * p - (r - o) * g, p = m / d, g = y / d, v.x = l + p * (e - l), v.y = o + p * (r - o), p >= 0 && p <= 1 && (v.onLine1 = !0), g >= 0 && g <= 1 && (v.onLine2 = !0), v.onLine1 && v.onLine2 ? [v.x, v.y] : !1);
|
|
11600
11600
|
}
|
|
11601
11601
|
const iu = 3.280839895013123, ou = 10.763910416709722, ea = 1609.344, ia = 4046.8564224, oa = 1e4, on = (l) => ({
|
|
11602
11602
|
ok: !0,
|
|
@@ -12145,7 +12145,7 @@ class fu {
|
|
|
12145
12145
|
return this.executeToolCommand(r, e, o, !1, o);
|
|
12146
12146
|
}
|
|
12147
12147
|
executeToolCommand(o, e, r, i, a) {
|
|
12148
|
-
var p, g, m, y,
|
|
12148
|
+
var p, g, m, y, v, x, b, w, E, T, M, S, I;
|
|
12149
12149
|
const s = this.beginToolCommand(
|
|
12150
12150
|
o,
|
|
12151
12151
|
e,
|
|
@@ -12155,8 +12155,8 @@ class fu {
|
|
|
12155
12155
|
);
|
|
12156
12156
|
delete this.toolErrors[o];
|
|
12157
12157
|
const c = (g = (p = this.toolButtonConfig) == null ? void 0 : p[o]) == null ? void 0 : g.requirements, d = this.getToolCapabilities().tools[o];
|
|
12158
|
-
if (e !== "deactivate" && (((m = d == null ? void 0 : d.reason) == null ? void 0 : m.code) === "missing_attribute" || ((y = d == null ? void 0 : d.reason) == null ? void 0 : y.code) === "no_editable_layers" || this.options.readOnly && ((
|
|
12159
|
-
const O = `Tool "${o}" is not available: ${(
|
|
12158
|
+
if (e !== "deactivate" && (((m = d == null ? void 0 : d.reason) == null ? void 0 : m.code) === "missing_attribute" || ((y = d == null ? void 0 : d.reason) == null ? void 0 : y.code) === "no_editable_layers" || this.options.readOnly && ((v = Pi[o]) != null && v.mutates) || c != null && c.selection && this.getToolCapabilities().selectedFeatureIds.length === 0 || c != null && c.provider && this.toolProvider.state !== "enabled")) {
|
|
12159
|
+
const O = `Tool "${o}" is not available: ${(b = (x = d == null ? void 0 : d.reason) == null ? void 0 : x.message) != null ? b : "Tool requirements are not met"}`;
|
|
12160
12160
|
return this.failToolCommand(s, O), this.emitToolTrigger({
|
|
12161
12161
|
tool: o,
|
|
12162
12162
|
source: s.source,
|
|
@@ -12168,8 +12168,8 @@ class fu {
|
|
|
12168
12168
|
}
|
|
12169
12169
|
try {
|
|
12170
12170
|
if (e === "deactivate" || o === "select") {
|
|
12171
|
-
const
|
|
12172
|
-
return this.cancelActiveTool("Deactivated by select command"), this.disablePhysicalTool(
|
|
12171
|
+
const D = (w = this.activeToolCommand) == null ? void 0 : w.tool;
|
|
12172
|
+
return this.cancelActiveTool("Deactivated by select command"), this.disablePhysicalTool(D), this.toggleMeasurementModal(!1), this.emitToolLifecycle("leaflet-geokit:tool-completed", s, {
|
|
12173
12173
|
activeTool: null
|
|
12174
12174
|
}), this.emitToolTrigger({
|
|
12175
12175
|
tool: "select",
|
|
@@ -12180,16 +12180,16 @@ class fu {
|
|
|
12180
12180
|
}), !0;
|
|
12181
12181
|
}
|
|
12182
12182
|
if (o === "save") {
|
|
12183
|
-
const
|
|
12183
|
+
const D = this.store.toFeatureCollection(), z = D.features.map((U) => Ft(U)).filter((U) => !!U);
|
|
12184
12184
|
return (T = (E = this.options.callbacks) == null ? void 0 : E.onSaved) == null || T.call(E, {
|
|
12185
|
-
geoJSON:
|
|
12186
|
-
featureCount:
|
|
12185
|
+
geoJSON: D,
|
|
12186
|
+
featureCount: D.features.length
|
|
12187
12187
|
}), this.emitToolEvent("tool:save", {
|
|
12188
|
-
geoJSON:
|
|
12189
|
-
featureCount:
|
|
12188
|
+
geoJSON: D,
|
|
12189
|
+
featureCount: D.features.length
|
|
12190
12190
|
}), this.emitToolLifecycle("leaflet-geokit:tool-completed", s, {
|
|
12191
|
-
featureIds:
|
|
12192
|
-
geometry:
|
|
12191
|
+
featureIds: z,
|
|
12192
|
+
geometry: D
|
|
12193
12193
|
}), this.emitToolTrigger({
|
|
12194
12194
|
tool: o,
|
|
12195
12195
|
source: s.source,
|
|
@@ -12202,13 +12202,13 @@ class fu {
|
|
|
12202
12202
|
if (o === "measurementSettings")
|
|
12203
12203
|
this.toggleMeasurementModal(!0);
|
|
12204
12204
|
else {
|
|
12205
|
-
(
|
|
12206
|
-
const
|
|
12207
|
-
(I = (S = this.options.callbacks) == null ? void 0 : S.onLayerStyleRequested) != null && I.call(S,
|
|
12205
|
+
(M = this.closeLayerStylePanel) == null || M.call(this);
|
|
12206
|
+
const D = { layers: this.getLayers() };
|
|
12207
|
+
(I = (S = this.options.callbacks) == null ? void 0 : S.onLayerStyleRequested) != null && I.call(S, D) || (this.closeLayerStylePanel = eh(
|
|
12208
12208
|
this.container,
|
|
12209
|
-
|
|
12210
|
-
(
|
|
12211
|
-
this.setLayerStyle(
|
|
12209
|
+
D.layers,
|
|
12210
|
+
(z, U) => {
|
|
12211
|
+
this.setLayerStyle(z, U);
|
|
12212
12212
|
}
|
|
12213
12213
|
));
|
|
12214
12214
|
}
|
|
@@ -12222,25 +12222,25 @@ class fu {
|
|
|
12222
12222
|
}
|
|
12223
12223
|
if (o === "ruler") {
|
|
12224
12224
|
if (!this.canTriggerRulerTool()) {
|
|
12225
|
-
const
|
|
12226
|
-
return this.failToolCommand(s,
|
|
12225
|
+
const z = "Ruler control is not available";
|
|
12226
|
+
return this.failToolCommand(s, z), this.emitToolTrigger({
|
|
12227
12227
|
tool: o,
|
|
12228
12228
|
source: s.source,
|
|
12229
12229
|
groupId: s.groupId,
|
|
12230
12230
|
commandId: s.commandId,
|
|
12231
12231
|
handled: !1,
|
|
12232
|
-
error:
|
|
12232
|
+
error: z
|
|
12233
12233
|
}), !1;
|
|
12234
12234
|
}
|
|
12235
12235
|
if (this.preparePersistentTool(s), !this.triggerRulerTool()) {
|
|
12236
|
-
const
|
|
12237
|
-
return this.failToolCommand(s,
|
|
12236
|
+
const z = "Ruler control is not available";
|
|
12237
|
+
return this.failToolCommand(s, z), this.emitToolTrigger({
|
|
12238
12238
|
tool: o,
|
|
12239
12239
|
source: s.source,
|
|
12240
12240
|
groupId: s.groupId,
|
|
12241
12241
|
commandId: s.commandId,
|
|
12242
12242
|
handled: !1,
|
|
12243
|
-
error:
|
|
12243
|
+
error: z
|
|
12244
12244
|
}), !1;
|
|
12245
12245
|
}
|
|
12246
12246
|
return this.startPersistentTool(s), this.emitToolTrigger({
|
|
@@ -12253,25 +12253,25 @@ class fu {
|
|
|
12253
12253
|
}
|
|
12254
12254
|
const O = this.findLeafletDrawHandler(o);
|
|
12255
12255
|
if (!O || typeof O.enable != "function") {
|
|
12256
|
-
const
|
|
12257
|
-
return this.failToolCommand(s,
|
|
12256
|
+
const D = `Tool "${o}" is not available on this map`;
|
|
12257
|
+
return this.failToolCommand(s, D), this.emitToolTrigger({
|
|
12258
12258
|
tool: o,
|
|
12259
12259
|
source: s.source,
|
|
12260
12260
|
groupId: s.groupId,
|
|
12261
12261
|
commandId: s.commandId,
|
|
12262
12262
|
handled: !1,
|
|
12263
|
-
error:
|
|
12263
|
+
error: D
|
|
12264
12264
|
}), !1;
|
|
12265
12265
|
}
|
|
12266
12266
|
if (this.preparePersistentTool(s), this.pendingToolCommand = s, O.enable(), this.pendingToolCommand = null, typeof O.enabled == "function" && O.enabled() === !1) {
|
|
12267
|
-
const
|
|
12268
|
-
return this.failToolCommand(s,
|
|
12267
|
+
const D = `Tool "${o}" could not be started`;
|
|
12268
|
+
return this.failToolCommand(s, D), this.emitToolTrigger({
|
|
12269
12269
|
tool: o,
|
|
12270
12270
|
source: s.source,
|
|
12271
12271
|
groupId: s.groupId,
|
|
12272
12272
|
commandId: s.commandId,
|
|
12273
12273
|
handled: !1,
|
|
12274
|
-
error:
|
|
12274
|
+
error: D
|
|
12275
12275
|
}), !1;
|
|
12276
12276
|
}
|
|
12277
12277
|
return this.startPersistentTool(s), this.emitToolTrigger({
|
|
@@ -12283,14 +12283,14 @@ class fu {
|
|
|
12283
12283
|
}), !0;
|
|
12284
12284
|
} catch (O) {
|
|
12285
12285
|
this.pendingToolCommand = null;
|
|
12286
|
-
const
|
|
12287
|
-
return this.toolErrors[o] =
|
|
12286
|
+
const D = e === "deactivate" ? "Failed to deactivate active map tools" : "Failed to activate tool " + o, z = O instanceof Error ? O.message : D;
|
|
12287
|
+
return this.toolErrors[o] = z, this._error(D, O), this.failToolCommand(s, z), this.emitToolTrigger({
|
|
12288
12288
|
tool: o,
|
|
12289
12289
|
source: s.source,
|
|
12290
12290
|
groupId: s.groupId,
|
|
12291
12291
|
commandId: s.commandId,
|
|
12292
12292
|
handled: !1,
|
|
12293
|
-
error:
|
|
12293
|
+
error: z
|
|
12294
12294
|
}), !1;
|
|
12295
12295
|
}
|
|
12296
12296
|
}
|
|
@@ -12334,46 +12334,46 @@ class fu {
|
|
|
12334
12334
|
zoom: g,
|
|
12335
12335
|
minZoom: m,
|
|
12336
12336
|
maxZoom: y,
|
|
12337
|
-
tileUrl:
|
|
12338
|
-
tileAttribution:
|
|
12339
|
-
preferCanvas:
|
|
12337
|
+
tileUrl: v,
|
|
12338
|
+
tileAttribution: x,
|
|
12339
|
+
preferCanvas: b = !0,
|
|
12340
12340
|
// Default to Canvas rendering for better performance
|
|
12341
|
-
useExternalLeaflet:
|
|
12341
|
+
useExternalLeaflet: w
|
|
12342
12342
|
} = this.options.map, E = [d, p], T = this.L;
|
|
12343
|
-
|
|
12344
|
-
onError: (
|
|
12343
|
+
w && Eo(T, {
|
|
12344
|
+
onError: (D) => this.logger.warn("external-leaflet-missing-draw", { message: D })
|
|
12345
12345
|
}), this.map = T.map(this.container, {
|
|
12346
12346
|
zoomControl: !0,
|
|
12347
12347
|
minZoom: m,
|
|
12348
|
-
preferCanvas:
|
|
12348
|
+
preferCanvas: b
|
|
12349
12349
|
}).setView(E, g), this.setTileLayer(
|
|
12350
12350
|
{
|
|
12351
|
-
urlTemplate:
|
|
12352
|
-
attribution:
|
|
12351
|
+
urlTemplate: v,
|
|
12352
|
+
attribution: x != null ? x : "",
|
|
12353
12353
|
maxZoom: y
|
|
12354
12354
|
},
|
|
12355
12355
|
{
|
|
12356
|
-
onTileError: (
|
|
12357
|
-
var
|
|
12358
|
-
(U = (
|
|
12356
|
+
onTileError: (D) => {
|
|
12357
|
+
var z, U;
|
|
12358
|
+
(U = (z = this.options.callbacks) == null ? void 0 : z.onTileError) == null || U.call(z, D);
|
|
12359
12359
|
}
|
|
12360
12360
|
}
|
|
12361
12361
|
), this.drawnItems = T.featureGroup().addTo(this.map), this.drawnItems.on(
|
|
12362
12362
|
"layeradd layerremove",
|
|
12363
12363
|
() => this.notifyToolCapabilities()
|
|
12364
12364
|
);
|
|
12365
|
-
const
|
|
12365
|
+
const M = this.buildDrawOptions(
|
|
12366
12366
|
this.options.controls,
|
|
12367
12367
|
!!this.options.readOnly
|
|
12368
12368
|
), S = T.Control.Draw;
|
|
12369
|
-
this.drawControl = new S(
|
|
12369
|
+
this.drawControl = new S(M), this.map.addControl(this.drawControl), this.applyLayerCakeToolbarIcon(), this.applyMoveToolbarIcon(), this.restoreVisibleLayersFromStore(), this.options.controls.ruler && (this.logger.debug("init:ruler", {
|
|
12370
12370
|
available: typeof T.control.ruler == "function"
|
|
12371
12371
|
}), typeof T.control.ruler == "function" ? (this.addRulerControl(), this.installMeasurementSettingsControl()) : this.logger.warn("init:ruler:missing", {
|
|
12372
12372
|
msg: "L.control.ruler is not defined"
|
|
12373
12373
|
})), this.applyToolButtonCustomizations(), this.patchLeafletDrawBugs(), this.installPolygonFinishPatch(), this.installVertexEditSurfaceMenu(), this.map.invalidateSize(), setTimeout(() => {
|
|
12374
|
-
var
|
|
12374
|
+
var D;
|
|
12375
12375
|
try {
|
|
12376
|
-
(
|
|
12376
|
+
(D = this.map) == null || D.invalidateSize();
|
|
12377
12377
|
} catch {
|
|
12378
12378
|
}
|
|
12379
12379
|
}, 0), this.bindDrawEvents(), this.installInteractionIntegrations();
|
|
@@ -12438,8 +12438,8 @@ class fu {
|
|
|
12438
12438
|
continue;
|
|
12439
12439
|
}
|
|
12440
12440
|
for (const y of m.featureIds) {
|
|
12441
|
-
const
|
|
12442
|
-
|
|
12441
|
+
const v = this.featureLayers.get(y);
|
|
12442
|
+
v && (m.visible ? this.drawnItems.addLayer(v) : this.drawnItems.removeLayer(v), (i = v.setStyle) == null || i.call(v, m.style), (s = v.setOpacity) == null || s.call(v, (a = m.style.opacity) != null ? a : 1), m.visible && ((c = v.bringToFront) == null || c.call(v)), (d = v.setZIndexOffset) == null || d.call(v, m.order * 100));
|
|
12443
12443
|
}
|
|
12444
12444
|
}
|
|
12445
12445
|
(g = (p = this.options.callbacks) == null ? void 0 : p.onLayerEvent) == null || g.call(p, "leaflet-geokit:layers-changed", {
|
|
@@ -12932,7 +12932,7 @@ class fu {
|
|
|
12932
12932
|
});
|
|
12933
12933
|
}
|
|
12934
12934
|
findLeafletDrawHandler(o) {
|
|
12935
|
-
var s, c, d, p, g, m, y,
|
|
12935
|
+
var s, c, d, p, g, m, y, v, x, b;
|
|
12936
12936
|
const e = {
|
|
12937
12937
|
polygon: "polygon",
|
|
12938
12938
|
polyline: "polyline",
|
|
@@ -12948,7 +12948,7 @@ class fu {
|
|
|
12948
12948
|
if (i)
|
|
12949
12949
|
return (g = (p = (d = (c = (s = this.drawControl) == null ? void 0 : s._toolbars) == null ? void 0 : c.draw) == null ? void 0 : d._modes) == null ? void 0 : p[i]) == null ? void 0 : g.handler;
|
|
12950
12950
|
const a = r[o];
|
|
12951
|
-
return a ? (
|
|
12951
|
+
return a ? (b = (x = (v = (y = (m = this.drawControl) == null ? void 0 : m._toolbars) == null ? void 0 : y.edit) == null ? void 0 : v._modes) == null ? void 0 : x[a]) == null ? void 0 : b.handler : null;
|
|
12952
12952
|
}
|
|
12953
12953
|
disableActiveToolHandlers() {
|
|
12954
12954
|
var e;
|
|
@@ -13035,8 +13035,8 @@ class fu {
|
|
|
13035
13035
|
p.lng,
|
|
13036
13036
|
g.lat,
|
|
13037
13037
|
g.lng
|
|
13038
|
-
),
|
|
13039
|
-
this._result = this._result || {}, this._result.Distance =
|
|
13038
|
+
), v = m / 1e3, x = typeof ((d = (c = this.options) == null ? void 0 : c.lengthUnit) == null ? void 0 : d.factor) == "number" ? this.options.lengthUnit.factor : 1, b = qo(v * x);
|
|
13039
|
+
this._result = this._result || {}, this._result.Distance = b, this._result.Bearing = y, this._result.meters = m;
|
|
13040
13040
|
} catch (p) {
|
|
13041
13041
|
i == null || i.warn("ruler:precision-patch", p);
|
|
13042
13042
|
}
|
|
@@ -13169,16 +13169,16 @@ class fu {
|
|
|
13169
13169
|
const o = this.map, e = (d = (c = this.drawControl) == null ? void 0 : c._toolbars) == null ? void 0 : d.draw;
|
|
13170
13170
|
if (!e || !!!((g = (p = e._modes) == null ? void 0 : p.polygon) != null && g.handler)) return;
|
|
13171
13171
|
const i = 10, a = (m) => {
|
|
13172
|
-
var y,
|
|
13172
|
+
var y, v, x, b, w, E, T, M;
|
|
13173
13173
|
try {
|
|
13174
|
-
const S = (
|
|
13174
|
+
const S = (v = (y = e._modes) == null ? void 0 : y.polygon) == null ? void 0 : v.handler;
|
|
13175
13175
|
if (!S || !S._enabled) return;
|
|
13176
13176
|
const I = S._markers;
|
|
13177
13177
|
if (!Array.isArray(I) || I.length < 3) return;
|
|
13178
|
-
const O = (
|
|
13178
|
+
const O = (b = (x = I[0]) == null ? void 0 : x.getLatLng) == null ? void 0 : b.call(x);
|
|
13179
13179
|
if (!O) return;
|
|
13180
|
-
const
|
|
13181
|
-
Math.hypot(
|
|
13180
|
+
const D = o.latLngToContainerPoint(O), z = o.latLngToContainerPoint(m.latlng);
|
|
13181
|
+
Math.hypot(D.x - z.x, D.y - z.y) <= i && typeof S._finishShape == "function" && ((E = (w = m.originalEvent) == null ? void 0 : w.preventDefault) == null || E.call(w), (M = (T = m.originalEvent) == null ? void 0 : T.stopPropagation) == null || M.call(T), S._finishShape());
|
|
13182
13182
|
} catch (S) {
|
|
13183
13183
|
this._error("polygon-finish-patch", S);
|
|
13184
13184
|
}
|
|
@@ -13206,16 +13206,16 @@ class fu {
|
|
|
13206
13206
|
nm: 2
|
|
13207
13207
|
}, p = (e = (o = c.formattedNumber) == null ? void 0 : o.bind(c)) != null ? e : ((g, m) => Number(g).toFixed(m));
|
|
13208
13208
|
c.readableArea = (g, m, y) => {
|
|
13209
|
-
var
|
|
13210
|
-
const
|
|
13211
|
-
let
|
|
13209
|
+
var b;
|
|
13210
|
+
const v = (b = s.Util) != null && b.extend ? s.Util.extend({}, d, y || {}) : { ...d, ...y || {} };
|
|
13211
|
+
let x;
|
|
13212
13212
|
if (m) {
|
|
13213
|
-
let
|
|
13213
|
+
let w = ["ha", "m"];
|
|
13214
13214
|
const E = typeof m;
|
|
13215
|
-
E === "string" ?
|
|
13215
|
+
E === "string" ? w = [m] : E !== "boolean" && (w = Array.isArray(m) ? m : w), g >= 1e6 && w.indexOf("km") !== -1 ? x = `${p(1e-6 * g, v.km)} km²` : g >= 1e4 && w.indexOf("ha") !== -1 ? x = `${p(1e-4 * g, v.ha)} ha` : x = `${p(g, v.m)} m²`;
|
|
13216
13216
|
} else
|
|
13217
|
-
g = g / 0.836127, g >= 3097600 ?
|
|
13218
|
-
return
|
|
13217
|
+
g = g / 0.836127, g >= 3097600 ? x = `${p(g / 3097600, v.mi)} mi²` : g >= 4840 ? x = `${p(g / 4840, v.ac)} acres` : x = `${p(g, v.yd)} yd²`;
|
|
13218
|
+
return x;
|
|
13219
13219
|
};
|
|
13220
13220
|
} catch (s) {
|
|
13221
13221
|
this.logger.warn("leaflet-draw-patch:readableArea", s);
|
|
@@ -13224,14 +13224,14 @@ class fu {
|
|
|
13224
13224
|
const s = this.L, c = (r = s.Edit) == null ? void 0 : r.Circle, d = (i = s.Draw) == null ? void 0 : i.Event, p = s.GeometryUtil;
|
|
13225
13225
|
if (!((a = c == null ? void 0 : c.prototype) != null && a._resize) || !d || !p) return;
|
|
13226
13226
|
c.prototype._resize = function(m) {
|
|
13227
|
-
var
|
|
13228
|
-
const y = this._moveMarker.getLatLng(),
|
|
13229
|
-
this._shape.setRadius(
|
|
13227
|
+
var x, b, w;
|
|
13228
|
+
const y = this._moveMarker.getLatLng(), v = p.isVersion07x() ? y.distanceTo(m) : this._map.distance(y, m);
|
|
13229
|
+
this._shape.setRadius(v);
|
|
13230
13230
|
try {
|
|
13231
|
-
(
|
|
13231
|
+
(x = this._map) != null && x.editTooltip && ((w = (b = this._map) == null ? void 0 : b._editTooltip) != null && w.updateContent) && this._map._editTooltip.updateContent({
|
|
13232
13232
|
text: s.drawLocal.edit.handlers.edit.tooltip.subtext + "<br />" + s.drawLocal.edit.handlers.edit.tooltip.text,
|
|
13233
13233
|
subtext: s.drawLocal.draw.handlers.circle.radius + ": " + p.readableDistance(
|
|
13234
|
-
|
|
13234
|
+
v,
|
|
13235
13235
|
!0,
|
|
13236
13236
|
this.options.feet,
|
|
13237
13237
|
this.options.nautic
|
|
@@ -13340,43 +13340,43 @@ class fu {
|
|
|
13340
13340
|
const r = (i = o == null ? void 0 : o._poly) != null ? i : o == null ? void 0 : o._shape;
|
|
13341
13341
|
if (!r) return null;
|
|
13342
13342
|
if ((a = o == null ? void 0 : o._poly) != null && a.getLatLngs) {
|
|
13343
|
-
const y = o._poly.getLatLngs(),
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
]),
|
|
13347
|
-
if (
|
|
13348
|
-
if (
|
|
13349
|
-
const
|
|
13343
|
+
const y = o._poly.getLatLngs(), v = Array.isArray(y == null ? void 0 : y[0]) ? y[0] : y, x = (Array.isArray(v) ? v : []).map((w) => [
|
|
13344
|
+
w.lng,
|
|
13345
|
+
w.lat
|
|
13346
|
+
]), b = e != null ? e : o._currentLatLng;
|
|
13347
|
+
if (b && x.length && (((s = x.at(-1)) == null ? void 0 : s[0]) !== b.lng || ((c = x.at(-1)) == null ? void 0 : c[1]) !== b.lat) && x.push([b.lng, b.lat]), o.type === "polygon" || r instanceof this.L.Polygon) {
|
|
13348
|
+
if (x.length < 3) return null;
|
|
13349
|
+
const w = x[0][0] === ((d = x.at(-1)) == null ? void 0 : d[0]) && x[0][1] === ((p = x.at(-1)) == null ? void 0 : p[1]) ? x : [...x, x[0]];
|
|
13350
13350
|
return {
|
|
13351
13351
|
type: "Feature",
|
|
13352
13352
|
properties: {},
|
|
13353
|
-
geometry: { type: "Polygon", coordinates: [
|
|
13353
|
+
geometry: { type: "Polygon", coordinates: [w] }
|
|
13354
13354
|
};
|
|
13355
13355
|
}
|
|
13356
|
-
return
|
|
13356
|
+
return x.length < 2 ? null : {
|
|
13357
13357
|
type: "Feature",
|
|
13358
13358
|
properties: {},
|
|
13359
|
-
geometry: { type: "LineString", coordinates:
|
|
13359
|
+
geometry: { type: "LineString", coordinates: x }
|
|
13360
13360
|
};
|
|
13361
13361
|
}
|
|
13362
13362
|
if ((g = o == null ? void 0 : o._shape) != null && g.getLatLng && ((m = o == null ? void 0 : o._shape) != null && m.getRadius)) {
|
|
13363
|
-
const y = o._shape.getLatLng(),
|
|
13364
|
-
const
|
|
13363
|
+
const y = o._shape.getLatLng(), v = o._shape.getRadius(), x = 110574, b = x * Math.max(0.1, Math.cos(y.lat * Math.PI / 180)), w = Array.from({ length: 65 }, (E, T) => {
|
|
13364
|
+
const M = T / 64 * Math.PI * 2;
|
|
13365
13365
|
return [
|
|
13366
|
-
y.lng + Math.cos(
|
|
13367
|
-
y.lat + Math.sin(
|
|
13366
|
+
y.lng + Math.cos(M) * v / b,
|
|
13367
|
+
y.lat + Math.sin(M) * v / x
|
|
13368
13368
|
];
|
|
13369
13369
|
});
|
|
13370
13370
|
return {
|
|
13371
13371
|
type: "Feature",
|
|
13372
13372
|
properties: {},
|
|
13373
|
-
geometry: { type: "Polygon", coordinates: [
|
|
13373
|
+
geometry: { type: "Polygon", coordinates: [w] }
|
|
13374
13374
|
};
|
|
13375
13375
|
}
|
|
13376
13376
|
return typeof r.toGeoJSON == "function" ? r.toGeoJSON() : null;
|
|
13377
13377
|
}
|
|
13378
13378
|
renderMeasurement(o, e) {
|
|
13379
|
-
var p, g, m, y,
|
|
13379
|
+
var p, g, m, y, v;
|
|
13380
13380
|
if (!((p = this.measurementOverlayOptions) != null && p.enabled) || !o) return;
|
|
13381
13381
|
const r = Fa(o);
|
|
13382
13382
|
if (!r.ok) {
|
|
@@ -13409,10 +13409,10 @@ class fu {
|
|
|
13409
13409
|
whiteSpace: "pre-line"
|
|
13410
13410
|
}), this.container.appendChild(c), this.measurementOverlayElement = c), c.textContent = a.join(`
|
|
13411
13411
|
`);
|
|
13412
|
-
const d = (
|
|
13412
|
+
const d = (v = e != null ? e : this.lastMeasurementLatLng) != null ? v : (y = this.map) == null ? void 0 : y.getCenter();
|
|
13413
13413
|
if (d && this.map) {
|
|
13414
|
-
const
|
|
13415
|
-
c.style.left = `${
|
|
13414
|
+
const x = this.map.latLngToContainerPoint(d);
|
|
13415
|
+
c.style.left = `${x.x + 12}px`, c.style.top = `${x.y + 12}px`;
|
|
13416
13416
|
}
|
|
13417
13417
|
this.lastMeasurementFeature = o, this.lastMeasurementLatLng = e ? this.L.latLng(e) : this.lastMeasurementLatLng;
|
|
13418
13418
|
}
|
|
@@ -13434,20 +13434,20 @@ class fu {
|
|
|
13434
13434
|
const i = e._onMarkerDrag, a = e._onTouchMove;
|
|
13435
13435
|
i && ((c = o.off) == null || c.call(o, "drag", i, e));
|
|
13436
13436
|
const s = (p) => {
|
|
13437
|
-
var y,
|
|
13438
|
-
const g = (y = e._poly) == null ? void 0 : y._fid, m = this.findSnapResult((
|
|
13437
|
+
var y, v, x, b, w, E;
|
|
13438
|
+
const g = (y = e._poly) == null ? void 0 : y._fid, m = this.findSnapResult((v = o.getLatLng) == null ? void 0 : v.call(o), g);
|
|
13439
13439
|
this.showSnapFeedback(m), m && o.setLatLng(m.latlng), i == null || i.call(e, { ...p, target: o }), this.renderMeasurement(
|
|
13440
|
-
(
|
|
13440
|
+
(w = (b = (x = e._poly) == null ? void 0 : x.toGeoJSON) == null ? void 0 : b.call(x)) != null ? w : null,
|
|
13441
13441
|
(E = o.getLatLng) == null ? void 0 : E.call(o)
|
|
13442
13442
|
);
|
|
13443
13443
|
};
|
|
13444
13444
|
if (o.on("drag", s, e), a) {
|
|
13445
13445
|
(d = o.off) == null || d.call(o, "touchmove", a, e);
|
|
13446
13446
|
const p = (g) => {
|
|
13447
|
-
var
|
|
13448
|
-
const m = (
|
|
13449
|
-
this.showSnapFeedback(y), y ? (o.setLatLng(y.latlng), i == null || i.call(e, { ...g, target: o })) : (m && ((
|
|
13450
|
-
(
|
|
13447
|
+
var v, x, b, w, E, T, M, S;
|
|
13448
|
+
const m = (x = this.eventLatLng(g)) != null ? x : (v = o.getLatLng) == null ? void 0 : v.call(o), y = this.findSnapResult(m, (b = e._poly) == null ? void 0 : b._fid);
|
|
13449
|
+
this.showSnapFeedback(y), y ? (o.setLatLng(y.latlng), i == null || i.call(e, { ...g, target: o })) : (m && ((w = o.setLatLng) == null || w.call(o, m)), a ? a.call(e, { ...g, target: o }) : i == null || i.call(e, { ...g, target: o })), this.renderMeasurement(
|
|
13450
|
+
(M = (T = (E = e._poly) == null ? void 0 : E.toGeoJSON) == null ? void 0 : T.call(E)) != null ? M : null,
|
|
13451
13451
|
(S = o.getLatLng) == null ? void 0 : S.call(o)
|
|
13452
13452
|
);
|
|
13453
13453
|
};
|
|
@@ -13477,20 +13477,20 @@ class fu {
|
|
|
13477
13477
|
});
|
|
13478
13478
|
}
|
|
13479
13479
|
installInteractionIntegrations() {
|
|
13480
|
-
var y,
|
|
13480
|
+
var y, v, x, b, w, E, T;
|
|
13481
13481
|
if ((y = this.interactionCleanup) == null || y.call(this), this.interactionCleanup = null, this.hideLiveOverlays(), !this.map || !this.drawControl) return;
|
|
13482
|
-
const o = [], e = [], r = !!(((
|
|
13482
|
+
const o = [], e = [], r = !!(((v = this.snappingOptions) == null ? void 0 : v.enabled) !== !1 && this.snappingOptions);
|
|
13483
13483
|
let i = !0;
|
|
13484
|
-
const a = !!((
|
|
13485
|
-
var
|
|
13486
|
-
for (; e.length; ) (
|
|
13484
|
+
const a = !!((x = this.measurementOverlayOptions) != null && x.enabled), s = () => {
|
|
13485
|
+
var M;
|
|
13486
|
+
for (; e.length; ) (M = e.pop()) == null || M();
|
|
13487
13487
|
this.showSnapFeedback(null);
|
|
13488
13488
|
};
|
|
13489
13489
|
if (r) {
|
|
13490
|
-
const
|
|
13491
|
-
(T = (E = (
|
|
13490
|
+
const M = Object.values(
|
|
13491
|
+
(T = (E = (w = (b = this.drawControl) == null ? void 0 : b._toolbars) == null ? void 0 : w.draw) == null ? void 0 : E._modes) != null ? T : {}
|
|
13492
13492
|
);
|
|
13493
|
-
for (const S of
|
|
13493
|
+
for (const S of M) {
|
|
13494
13494
|
const I = S == null ? void 0 : S.handler;
|
|
13495
13495
|
if (I)
|
|
13496
13496
|
for (const O of [
|
|
@@ -13499,13 +13499,13 @@ class fu {
|
|
|
13499
13499
|
"_onMouseUp",
|
|
13500
13500
|
"_onTouch"
|
|
13501
13501
|
]) {
|
|
13502
|
-
const
|
|
13503
|
-
if (typeof
|
|
13504
|
-
const
|
|
13502
|
+
const D = I[O];
|
|
13503
|
+
if (typeof D != "function") continue;
|
|
13504
|
+
const z = (U) => {
|
|
13505
13505
|
var K, vt, at;
|
|
13506
13506
|
const Z = this.eventLatLng(U), R = this.findSnapResult(Z);
|
|
13507
13507
|
this.showSnapFeedback(R);
|
|
13508
|
-
const G = R ? { ...U, latlng: R.latlng } : U, W =
|
|
13508
|
+
const G = R ? { ...U, latlng: R.latlng } : U, W = D.call(I, G);
|
|
13509
13509
|
return R && (I._currentLatLng = R.latlng, (K = I._mouseMarker) == null || K.setLatLng(R.latlng), typeof I._updateGuide == "function" && I._updateGuide(
|
|
13510
13510
|
this.map.latLngToLayerPoint(R.latlng)
|
|
13511
13511
|
), (vt = I._updateTooltip) == null || vt.call(I, R.latlng)), this.renderMeasurement(
|
|
@@ -13513,48 +13513,48 @@ class fu {
|
|
|
13513
13513
|
(at = R == null ? void 0 : R.latlng) != null ? at : Z
|
|
13514
13514
|
), W;
|
|
13515
13515
|
};
|
|
13516
|
-
I[O] =
|
|
13517
|
-
I[O] ===
|
|
13516
|
+
I[O] = z, o.push(() => {
|
|
13517
|
+
I[O] === z && (I[O] = D);
|
|
13518
13518
|
});
|
|
13519
13519
|
}
|
|
13520
13520
|
}
|
|
13521
13521
|
}
|
|
13522
|
-
const c = (
|
|
13523
|
-
var
|
|
13522
|
+
const c = (M) => {
|
|
13523
|
+
var D, z, U, Z, R, G;
|
|
13524
13524
|
const S = Object.values(
|
|
13525
|
-
(Z = (U = (
|
|
13525
|
+
(Z = (U = (z = (D = this.drawControl) == null ? void 0 : D._toolbars) == null ? void 0 : z.draw) == null ? void 0 : U._modes) != null ? Z : {}
|
|
13526
13526
|
).map((W) => W == null ? void 0 : W.handler).find((W) => W == null ? void 0 : W._enabled);
|
|
13527
13527
|
if (!S) return;
|
|
13528
|
-
const I = this.eventLatLng(
|
|
13528
|
+
const I = this.eventLatLng(M), O = r ? this.findSnapResult(I) : null;
|
|
13529
13529
|
r && this.showSnapFeedback(O), this.renderMeasurement(
|
|
13530
13530
|
this.geometryFeatureForHandler(S, (R = O == null ? void 0 : O.latlng) != null ? R : I),
|
|
13531
13531
|
(G = O == null ? void 0 : O.latlng) != null ? G : I
|
|
13532
13532
|
);
|
|
13533
13533
|
};
|
|
13534
13534
|
this.map.on("mousemove touchmove", c), o.push(() => {
|
|
13535
|
-
var
|
|
13536
|
-
return (
|
|
13535
|
+
var M;
|
|
13536
|
+
return (M = this.map) == null ? void 0 : M.off("mousemove touchmove", c);
|
|
13537
13537
|
});
|
|
13538
13538
|
const d = () => {
|
|
13539
|
-
var
|
|
13539
|
+
var M, S, I, O;
|
|
13540
13540
|
if (a)
|
|
13541
|
-
for (const
|
|
13542
|
-
const
|
|
13541
|
+
for (const D of (I = (S = (M = this.drawnItems) == null ? void 0 : M.getLayers) == null ? void 0 : S.call(M)) != null ? I : []) {
|
|
13542
|
+
const z = D, U = () => {
|
|
13543
13543
|
var Z, R, G;
|
|
13544
13544
|
return this.renderMeasurement(
|
|
13545
|
-
(R = (Z =
|
|
13546
|
-
(G =
|
|
13545
|
+
(R = (Z = z.toGeoJSON) == null ? void 0 : Z.call(z)) != null ? R : null,
|
|
13546
|
+
(G = z.getLatLng) == null ? void 0 : G.call(z)
|
|
13547
13547
|
);
|
|
13548
13548
|
};
|
|
13549
|
-
(O =
|
|
13549
|
+
(O = z.on) == null || O.call(z, "editdrag drag", U), e.push(() => {
|
|
13550
13550
|
var Z;
|
|
13551
|
-
return (Z =
|
|
13551
|
+
return (Z = z.off) == null ? void 0 : Z.call(z, "editdrag drag", U);
|
|
13552
13552
|
});
|
|
13553
13553
|
}
|
|
13554
13554
|
r && queueMicrotask(() => {
|
|
13555
|
-
var
|
|
13555
|
+
var D, z, U, Z, R;
|
|
13556
13556
|
if (i)
|
|
13557
|
-
for (const G of (U = (
|
|
13557
|
+
for (const G of (U = (z = (D = this.drawnItems) == null ? void 0 : D.getLayers) == null ? void 0 : z.call(D)) != null ? U : []) {
|
|
13558
13558
|
const W = G.editing;
|
|
13559
13559
|
for (const K of (Z = W == null ? void 0 : W._verticesHandlers) != null ? Z : []) {
|
|
13560
13560
|
this.installEditHandlerSnap(K, e);
|
|
@@ -13563,12 +13563,12 @@ class fu {
|
|
|
13563
13563
|
}
|
|
13564
13564
|
}
|
|
13565
13565
|
});
|
|
13566
|
-
}, p = (
|
|
13567
|
-
var I, O,
|
|
13568
|
-
const S = (U = (O = (I =
|
|
13566
|
+
}, p = (M) => {
|
|
13567
|
+
var I, O, D, z, U, Z, R, G, W, K;
|
|
13568
|
+
const S = (U = (O = (I = M == null ? void 0 : M.poly) == null ? void 0 : I.toGeoJSON) == null ? void 0 : O.call(I)) != null ? U : (z = (D = M == null ? void 0 : M.layer) == null ? void 0 : D.toGeoJSON) == null ? void 0 : z.call(D);
|
|
13569
13569
|
this.renderMeasurement(
|
|
13570
13570
|
S,
|
|
13571
|
-
(K = (R = (Z =
|
|
13571
|
+
(K = (R = (Z = M == null ? void 0 : M.marker) == null ? void 0 : Z.getLatLng) == null ? void 0 : R.call(Z)) != null ? K : (W = (G = M == null ? void 0 : M.poly) == null ? void 0 : G.getCenter) == null ? void 0 : W.call(G)
|
|
13572
13572
|
);
|
|
13573
13573
|
}, g = () => {
|
|
13574
13574
|
s(), this.hideLiveOverlays();
|
|
@@ -13576,11 +13576,11 @@ class fu {
|
|
|
13576
13576
|
this.hideLiveOverlays();
|
|
13577
13577
|
};
|
|
13578
13578
|
this.map.on("draw:editstart", d), this.map.on("draw:editvertex", p), this.map.on("draw:editstop", g), this.map.on("draw:drawstop", m), o.push(() => {
|
|
13579
|
-
var
|
|
13580
|
-
i = !1, s(), (
|
|
13579
|
+
var M, S, I, O;
|
|
13580
|
+
i = !1, s(), (M = this.map) == null || M.off("draw:editstart", d), (S = this.map) == null || S.off("draw:editvertex", p), (I = this.map) == null || I.off("draw:editstop", g), (O = this.map) == null || O.off("draw:drawstop", m);
|
|
13581
13581
|
}), this.interactionCleanup = () => {
|
|
13582
|
-
var
|
|
13583
|
-
for (; o.length; ) (
|
|
13582
|
+
var M;
|
|
13583
|
+
for (; o.length; ) (M = o.pop()) == null || M();
|
|
13584
13584
|
s(), this.hideLiveOverlays();
|
|
13585
13585
|
};
|
|
13586
13586
|
}
|
|
@@ -13647,53 +13647,53 @@ class fu {
|
|
|
13647
13647
|
this.cakeSessionCommand = this.activeToolCommand, this.activeCakeSession = new Zh(
|
|
13648
13648
|
this.map,
|
|
13649
13649
|
d,
|
|
13650
|
-
(
|
|
13650
|
+
(b) => {
|
|
13651
13651
|
var O;
|
|
13652
13652
|
if (!this.drawnItems) return;
|
|
13653
|
-
const
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
...
|
|
13657
|
-
name: `${
|
|
13653
|
+
const w = this.activeCakeSession.snapshot();
|
|
13654
|
+
b.features.forEach((D, z) => {
|
|
13655
|
+
D.properties = {
|
|
13656
|
+
...D.properties,
|
|
13657
|
+
name: `${w.name} ${z === 0 ? "core" : `ring ${z}`}`
|
|
13658
13658
|
};
|
|
13659
13659
|
});
|
|
13660
|
-
const E = this.store.add(
|
|
13661
|
-
name:
|
|
13660
|
+
const E = this.store.add(b), T = this.layerRegistry.add(E, {
|
|
13661
|
+
name: w.name,
|
|
13662
13662
|
kind: "drawn",
|
|
13663
|
-
style:
|
|
13664
|
-
}),
|
|
13663
|
+
style: w.style
|
|
13664
|
+
}), M = this.L.geoJSON(b);
|
|
13665
13665
|
let S = 0;
|
|
13666
|
-
|
|
13666
|
+
M.eachLayer((D) => {
|
|
13667
13667
|
var U, Z, R;
|
|
13668
|
-
const
|
|
13669
|
-
|
|
13670
|
-
id:
|
|
13668
|
+
const z = (U = E[S]) != null ? U : E[E.length - 1];
|
|
13669
|
+
D._fid = z, this.featureLayers.set(z, D), this.drawnItems.addLayer(D), this.installVertexContextMenu(D), (R = (Z = this.options.callbacks) == null ? void 0 : Z.onCreated) == null || R.call(Z, {
|
|
13670
|
+
id: z,
|
|
13671
13671
|
layerType: "polygon",
|
|
13672
|
-
geoJSON:
|
|
13672
|
+
geoJSON: D.toGeoJSON()
|
|
13673
13673
|
}), S++;
|
|
13674
13674
|
}), this.applyLayerRegistry();
|
|
13675
13675
|
const I = ((O = this.activeToolCommand) == null ? void 0 : O.tool) === "layerCake" ? this.activeToolCommand : null;
|
|
13676
13676
|
this.emitCakeEvent("tool:layer-cake:saved", {
|
|
13677
13677
|
layerId: T,
|
|
13678
|
-
featureCollection:
|
|
13678
|
+
featureCollection: b,
|
|
13679
13679
|
source: I == null ? void 0 : I.source,
|
|
13680
13680
|
groupId: I == null ? void 0 : I.groupId,
|
|
13681
13681
|
commandId: I == null ? void 0 : I.commandId
|
|
13682
13682
|
}), this.activeCakeSession = null, this.cakeSessionCommand = null, I && (this.completeActiveTool(
|
|
13683
|
-
{ featureIds: E, geometry:
|
|
13683
|
+
{ featureIds: E, geometry: b },
|
|
13684
13684
|
!0
|
|
13685
13685
|
), this.clearActiveTool(I));
|
|
13686
13686
|
},
|
|
13687
13687
|
this.measurementSystem,
|
|
13688
13688
|
() => this.emitCakeEvent("tool:layer-cake:session-changed")
|
|
13689
13689
|
);
|
|
13690
|
-
const
|
|
13690
|
+
const x = ((i = this.activeToolCommand) == null ? void 0 : i.tool) === "layerCake" ? this.activeToolCommand : null;
|
|
13691
13691
|
this.emitCakeEvent("tool:layer-cake:session-started", {
|
|
13692
13692
|
center: d.getLatLng(),
|
|
13693
13693
|
radius: d.getRadius(),
|
|
13694
|
-
source:
|
|
13695
|
-
groupId:
|
|
13696
|
-
commandId:
|
|
13694
|
+
source: x == null ? void 0 : x.source,
|
|
13695
|
+
groupId: x == null ? void 0 : x.groupId,
|
|
13696
|
+
commandId: x == null ? void 0 : x.commandId
|
|
13697
13697
|
});
|
|
13698
13698
|
return;
|
|
13699
13699
|
}
|
|
@@ -13706,8 +13706,8 @@ class fu {
|
|
|
13706
13706
|
name: `${p} layer`,
|
|
13707
13707
|
kind: "drawn"
|
|
13708
13708
|
}), this.applyLayerRegistry(), (s = (a = this.options.callbacks) == null ? void 0 : a.onCreated) == null || s.call(a, { id: y, layerType: p, geoJSON: g });
|
|
13709
|
-
const
|
|
13710
|
-
|
|
13709
|
+
const v = du[p];
|
|
13710
|
+
v && this.emitToolEvent(v, {
|
|
13711
13711
|
id: y,
|
|
13712
13712
|
geoJSON: g
|
|
13713
13713
|
}), ((c = this.activeToolCommand) == null ? void 0 : c.tool) === p && this.completeActiveTool({ featureIds: [y], geometry: g }, !0);
|
|
@@ -13930,13 +13930,13 @@ class fu {
|
|
|
13930
13930
|
}
|
|
13931
13931
|
findNearestVertex(o, e, r) {
|
|
13932
13932
|
if (!this.map) return null;
|
|
13933
|
-
const i = (y) => this.map.latLngToContainerPoint(y), a = (y,
|
|
13933
|
+
const i = (y) => this.map.latLngToContainerPoint(y), a = (y, v) => Math.hypot(y.x - v.x, y.y - v.y), s = i(e);
|
|
13934
13934
|
let c = 1 / 0, d = -1, p = -1;
|
|
13935
13935
|
const g = o.getLatLngs();
|
|
13936
|
-
return (Array.isArray(g[0]) ? g : [g]).forEach((y,
|
|
13937
|
-
y.forEach((
|
|
13938
|
-
const
|
|
13939
|
-
E < c && (c = E, d =
|
|
13936
|
+
return (Array.isArray(g[0]) ? g : [g]).forEach((y, v) => {
|
|
13937
|
+
y.forEach((x, b) => {
|
|
13938
|
+
const w = i(x), E = a(w, s);
|
|
13939
|
+
E < c && (c = E, d = v, p = b);
|
|
13940
13940
|
});
|
|
13941
13941
|
}), d === -1 || c > r ? null : { pathIndex: d, vertexIndex: p };
|
|
13942
13942
|
}
|
|
@@ -13951,15 +13951,15 @@ class fu {
|
|
|
13951
13951
|
if (g.splice(r, 1), p.length === 1)
|
|
13952
13952
|
o.setLatLngs(g);
|
|
13953
13953
|
else {
|
|
13954
|
-
const
|
|
13955
|
-
o.setLatLngs(
|
|
13954
|
+
const x = p.map((b, w) => w === e ? g : b);
|
|
13955
|
+
o.setLatLngs(x);
|
|
13956
13956
|
}
|
|
13957
13957
|
(i = o.redraw) == null || i.call(o);
|
|
13958
|
-
const
|
|
13959
|
-
if (
|
|
13960
|
-
const
|
|
13961
|
-
this.store.update(
|
|
13962
|
-
ids: [
|
|
13958
|
+
const v = o._fid;
|
|
13959
|
+
if (v) {
|
|
13960
|
+
const x = o.toGeoJSON();
|
|
13961
|
+
this.store.update(v, x), (s = (a = this.options.callbacks) == null ? void 0 : a.onEdited) == null || s.call(a, {
|
|
13962
|
+
ids: [v],
|
|
13963
13963
|
geoJSON: this.store.toFeatureCollection()
|
|
13964
13964
|
});
|
|
13965
13965
|
}
|
|
@@ -13978,10 +13978,10 @@ class fu {
|
|
|
13978
13978
|
if (!a) return;
|
|
13979
13979
|
const s = a._modes || {};
|
|
13980
13980
|
let c = null;
|
|
13981
|
-
for (const
|
|
13982
|
-
const
|
|
13983
|
-
if (((r =
|
|
13984
|
-
c =
|
|
13981
|
+
for (const v in s) {
|
|
13982
|
+
const x = s[v];
|
|
13983
|
+
if (((r = x == null ? void 0 : x.handler) == null ? void 0 : r.type) === "move") {
|
|
13984
|
+
c = x.handler;
|
|
13985
13985
|
break;
|
|
13986
13986
|
}
|
|
13987
13987
|
}
|
|
@@ -13990,18 +13990,18 @@ class fu {
|
|
|
13990
13990
|
d.dataset.geokitMoveConfirmation = "", this.L.DomEvent.disableClickPropagation(d), this.L.DomEvent.disableScrollPropagation(d), d.style.position = "absolute";
|
|
13991
13991
|
const p = this.container.getBoundingClientRect();
|
|
13992
13992
|
let g = 60;
|
|
13993
|
-
this.container.querySelectorAll("[data-geokit-managed-toolbar]").forEach((
|
|
13994
|
-
var
|
|
13995
|
-
const
|
|
13996
|
-
|
|
13993
|
+
this.container.querySelectorAll("[data-geokit-managed-toolbar]").forEach((v) => {
|
|
13994
|
+
var b;
|
|
13995
|
+
const x = v.getBoundingClientRect();
|
|
13996
|
+
x.width && x.height && ((b = v.dataset.geokitToolbarPosition) != null && b.startsWith("bottom")) && (g = Math.max(g, p.bottom - x.top + 8));
|
|
13997
13997
|
}), d.style.bottom = `${g}px`, d.style.maxWidth = "calc(100% - 32px)", d.style.boxSizing = "border-box", d.style.left = "50%", d.style.transform = "translateX(-50%)", d.style.display = "flex", d.style.gap = "8px", d.style.background = "#fff", d.style.border = "2px solid #3388ff", d.style.borderRadius = "8px", d.style.padding = "12px 16px", d.style.boxShadow = "0 4px 12px rgba(0,0,0,0.2)", d.style.zIndex = "10000", d.style.fontSize = "14px", d.style.fontFamily = "system-ui, sans-serif";
|
|
13998
13998
|
const m = document.createElement("button");
|
|
13999
|
-
m.textContent = "✓ Save", m.style.minHeight = "44px", m.style.minWidth = "44px", m.style.whiteSpace = "nowrap", m.style.padding = "8px 16px", m.style.border = "none", m.style.background = "#28a745", m.style.color = "#fff", m.style.borderRadius = "4px", m.style.cursor = "pointer", m.style.fontWeight = "600", m.style.fontSize = "14px", m.addEventListener("click", (
|
|
14000
|
-
|
|
13999
|
+
m.textContent = "✓ Save", m.style.minHeight = "44px", m.style.minWidth = "44px", m.style.whiteSpace = "nowrap", m.style.padding = "8px 16px", m.style.border = "none", m.style.background = "#28a745", m.style.color = "#fff", m.style.borderRadius = "4px", m.style.cursor = "pointer", m.style.fontWeight = "600", m.style.fontSize = "14px", m.addEventListener("click", (v) => {
|
|
14000
|
+
v.stopPropagation(), v.preventDefault(), c != null && c.confirmMove && c.confirmMove();
|
|
14001
14001
|
});
|
|
14002
14002
|
const y = document.createElement("button");
|
|
14003
|
-
y.textContent = "✕ Cancel", y.style.minHeight = "44px", y.style.minWidth = "44px", y.style.whiteSpace = "nowrap", y.style.padding = "8px 16px", y.style.border = "1px solid #ccc", y.style.background = "#fff", y.style.color = "#333", y.style.borderRadius = "4px", y.style.cursor = "pointer", y.style.fontWeight = "600", y.style.fontSize = "14px", y.addEventListener("click", (
|
|
14004
|
-
|
|
14003
|
+
y.textContent = "✕ Cancel", y.style.minHeight = "44px", y.style.minWidth = "44px", y.style.whiteSpace = "nowrap", y.style.padding = "8px 16px", y.style.border = "1px solid #ccc", y.style.background = "#fff", y.style.color = "#333", y.style.borderRadius = "4px", y.style.cursor = "pointer", y.style.fontWeight = "600", y.style.fontSize = "14px", y.addEventListener("click", (v) => {
|
|
14004
|
+
v.stopPropagation(), v.preventDefault(), this.emitToolEvent("tool:move:cancelled", {
|
|
14005
14005
|
layerId: o == null ? void 0 : o._fid
|
|
14006
14006
|
}), c != null && c.cancelMove && c.cancelMove(), this.hideMoveConfirmationUI();
|
|
14007
14007
|
}), d.appendChild(m), d.appendChild(y), this.container.appendChild(d), this.moveConfirmationUI = d, this.logger.debug("showMoveConfirmationUI", {
|
|
@@ -14659,25 +14659,25 @@ class rn extends HTMLElement {
|
|
|
14659
14659
|
attribution: this._tileAttribution
|
|
14660
14660
|
}, m = ec(g);
|
|
14661
14661
|
if (!m.valid) {
|
|
14662
|
-
const
|
|
14662
|
+
const x = (r = m.error) != null && r.toLowerCase().includes("api key") ? "missing_api_key" : "tile_load_failed";
|
|
14663
14663
|
this._handleTileProviderError(
|
|
14664
|
-
|
|
14664
|
+
x,
|
|
14665
14665
|
(i = m.error) != null ? i : "Invalid tile provider configuration",
|
|
14666
14666
|
p
|
|
14667
14667
|
);
|
|
14668
14668
|
return;
|
|
14669
14669
|
}
|
|
14670
|
-
const y = jo(g),
|
|
14670
|
+
const y = jo(g), v = this._activeTileProvider;
|
|
14671
14671
|
e.setTileLayer(y, {
|
|
14672
|
-
onTileError: (
|
|
14672
|
+
onTileError: (x) => {
|
|
14673
14673
|
if (this._tileProvider !== p) return;
|
|
14674
|
-
const
|
|
14675
|
-
this._handleTileProviderError(
|
|
14674
|
+
const b = this._describeTileLayerError(x, p), w = p === "here" ? this._resolveHereTileLayerErrorCode(b) : "tile_load_failed";
|
|
14675
|
+
this._handleTileProviderError(w, b, p);
|
|
14676
14676
|
}
|
|
14677
14677
|
}), this._activeTileProvider = p, this._emitTileProviderChanged(
|
|
14678
14678
|
p,
|
|
14679
14679
|
this._tileStyle,
|
|
14680
|
-
|
|
14680
|
+
v
|
|
14681
14681
|
);
|
|
14682
14682
|
return;
|
|
14683
14683
|
}
|
|
@@ -15799,18 +15799,18 @@ function ku(l) {
|
|
|
15799
15799
|
const d = e.externalLeaflet != null ? e.externalLeaflet ? "external" : "bundled" : l;
|
|
15800
15800
|
wu(c, d), c.leafletInstance = e.leafletInstance, c.toolHooks = e.toolHooks, c.toolEventEmitter = e.toolEventEmitter, c.toolButtonConfig = e.toolButtonConfig, c.toolbarGroups = e.toolbarGroups, e.attributes && Lu(c, e.attributes);
|
|
15801
15801
|
const p = async () => {
|
|
15802
|
-
var y,
|
|
15802
|
+
var y, v, x;
|
|
15803
15803
|
try {
|
|
15804
|
-
const
|
|
15805
|
-
(y = e.onChangeText) == null || y.call(e,
|
|
15806
|
-
} catch (
|
|
15807
|
-
(
|
|
15804
|
+
const b = await c.getGeoJSON(), w = JSON.stringify(b);
|
|
15805
|
+
(y = e.onChangeText) == null || y.call(e, w), (v = e.onChangeGeoJSON) == null || v.call(e, b);
|
|
15806
|
+
} catch (b) {
|
|
15807
|
+
(x = e.onError) == null || x.call(e, Do(b));
|
|
15808
15808
|
}
|
|
15809
15809
|
}, g = () => {
|
|
15810
|
-
var y,
|
|
15811
|
-
(y = e.onReady) == null || y.call(e, c), (
|
|
15812
|
-
var
|
|
15813
|
-
return (
|
|
15810
|
+
var y, v;
|
|
15811
|
+
(y = e.onReady) == null || y.call(e, c), (v = e.initialGeoJSONText) != null && v.trim() ? c.loadGeoJSONFromText(e.initialGeoJSONText).then(() => p()).catch((x) => {
|
|
15812
|
+
var b;
|
|
15813
|
+
return (b = e.onError) == null ? void 0 : b.call(e, Do(x));
|
|
15814
15814
|
}) : p();
|
|
15815
15815
|
}, m = () => {
|
|
15816
15816
|
p();
|