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