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