map-boundary-editor 0.3.0 → 0.3.2
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/README.md +11 -8
- package/dist/map-boundary-editor.js +476 -394
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var Vo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function qo(
|
|
3
|
-
return
|
|
2
|
+
function qo(J) {
|
|
3
|
+
return J && J.__esModule && Object.prototype.hasOwnProperty.call(J, "default") ? J.default : J;
|
|
4
4
|
}
|
|
5
5
|
var $e = { exports: {} };
|
|
6
6
|
/* @preserve
|
|
7
7
|
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
8
8
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
9
9
|
*/
|
|
10
|
-
(function(
|
|
11
|
-
(function(
|
|
12
|
-
|
|
13
|
-
})(Vo, function(
|
|
14
|
-
var
|
|
10
|
+
(function(J, D) {
|
|
11
|
+
(function(f, W) {
|
|
12
|
+
W(D);
|
|
13
|
+
})(Vo, function(f) {
|
|
14
|
+
var W = "1.9.4";
|
|
15
15
|
function o(t) {
|
|
16
16
|
var e, i, n, s;
|
|
17
17
|
for (i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -38,7 +38,7 @@ var $e = { exports: {} };
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
var d = 0;
|
|
41
|
-
function
|
|
41
|
+
function p(t) {
|
|
42
42
|
return "_leaflet_id" in t || (t._leaflet_id = ++d), t._leaflet_id;
|
|
43
43
|
}
|
|
44
44
|
function g(t, e, i) {
|
|
@@ -56,7 +56,7 @@ var $e = { exports: {} };
|
|
|
56
56
|
function y() {
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function O(t, e) {
|
|
60
60
|
if (e === !1)
|
|
61
61
|
return t;
|
|
62
62
|
var i = Math.pow(10, e === void 0 ? 6 : e);
|
|
@@ -68,7 +68,7 @@ var $e = { exports: {} };
|
|
|
68
68
|
function yt(t) {
|
|
69
69
|
return pe(t).split(/\s+/);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function A(t, e) {
|
|
72
72
|
Object.prototype.hasOwnProperty.call(t, "options") || (t.options = t.options ? r(t.options) : {});
|
|
73
73
|
for (var i in e)
|
|
74
74
|
t.options[i] = e[i];
|
|
@@ -110,13 +110,13 @@ var $e = { exports: {} };
|
|
|
110
110
|
var ve = window.requestAnimationFrame || ge("RequestAnimationFrame") || ni, oi = window.cancelAnimationFrame || ge("CancelAnimationFrame") || ge("CancelRequestAnimationFrame") || function(t) {
|
|
111
111
|
window.clearTimeout(t);
|
|
112
112
|
};
|
|
113
|
-
function
|
|
113
|
+
function q(t, e, i) {
|
|
114
114
|
if (i && ve === ni)
|
|
115
115
|
t.call(e);
|
|
116
116
|
else
|
|
117
117
|
return ve.call(window, h(t, e));
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Q(t) {
|
|
120
120
|
t && oi.call(window, t);
|
|
121
121
|
}
|
|
122
122
|
var vn = {
|
|
@@ -127,14 +127,14 @@ var $e = { exports: {} };
|
|
|
127
127
|
get lastId() {
|
|
128
128
|
return d;
|
|
129
129
|
},
|
|
130
|
-
stamp:
|
|
130
|
+
stamp: p,
|
|
131
131
|
throttle: g,
|
|
132
132
|
wrapNum: m,
|
|
133
133
|
falseFn: y,
|
|
134
|
-
formatNum:
|
|
134
|
+
formatNum: O,
|
|
135
135
|
trim: pe,
|
|
136
136
|
splitWords: yt,
|
|
137
|
-
setOptions:
|
|
137
|
+
setOptions: A,
|
|
138
138
|
getParamString: ti,
|
|
139
139
|
template: ei,
|
|
140
140
|
isArray: it,
|
|
@@ -142,14 +142,14 @@ var $e = { exports: {} };
|
|
|
142
142
|
emptyImageUrl: Kt,
|
|
143
143
|
requestFn: ve,
|
|
144
144
|
cancelFn: oi,
|
|
145
|
-
requestAnimFrame:
|
|
146
|
-
cancelAnimFrame:
|
|
145
|
+
requestAnimFrame: q,
|
|
146
|
+
cancelAnimFrame: Q
|
|
147
147
|
};
|
|
148
148
|
function lt() {
|
|
149
149
|
}
|
|
150
150
|
lt.extend = function(t) {
|
|
151
151
|
var e = function() {
|
|
152
|
-
|
|
152
|
+
A(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
|
|
153
153
|
}, i = e.__super__ = this.prototype, n = r(i);
|
|
154
154
|
n.constructor = e, e.prototype = n;
|
|
155
155
|
for (var s in this)
|
|
@@ -179,7 +179,7 @@ var $e = { exports: {} };
|
|
|
179
179
|
t[e] === 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);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
var
|
|
182
|
+
var X = {
|
|
183
183
|
/* @method on(type: String, fn: Function, context?: Object): this
|
|
184
184
|
* Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).
|
|
185
185
|
*
|
|
@@ -327,12 +327,12 @@ var $e = { exports: {} };
|
|
|
327
327
|
// @method addEventParent(obj: Evented): this
|
|
328
328
|
// Adds an event parent - an `Evented` that will receive propagated events
|
|
329
329
|
addEventParent: function(t) {
|
|
330
|
-
return this._eventParents = this._eventParents || {}, this._eventParents[
|
|
330
|
+
return this._eventParents = this._eventParents || {}, this._eventParents[p(t)] = t, this;
|
|
331
331
|
},
|
|
332
332
|
// @method removeEventParent(obj: Evented): this
|
|
333
333
|
// Removes an event parent, so it will stop receiving propagated events
|
|
334
334
|
removeEventParent: function(t) {
|
|
335
|
-
return this._eventParents && delete this._eventParents[
|
|
335
|
+
return this._eventParents && delete this._eventParents[p(t)], this;
|
|
336
336
|
},
|
|
337
337
|
_propagateEvent: function(t) {
|
|
338
338
|
for (var e in this._eventParents)
|
|
@@ -342,8 +342,8 @@ var $e = { exports: {} };
|
|
|
342
342
|
}, t), !0);
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
|
-
|
|
346
|
-
var It = lt.extend(
|
|
345
|
+
X.addEventListener = X.on, X.removeEventListener = X.clearAllEventListeners = X.off, X.addOneTimeEventListener = X.once, X.fireEvent = X.fire, X.hasEventListeners = X.listens;
|
|
346
|
+
var It = lt.extend(X);
|
|
347
347
|
function P(t, e, i) {
|
|
348
348
|
this.x = i ? Math.round(t) : t, this.y = i ? Math.round(e) : e;
|
|
349
349
|
}
|
|
@@ -454,18 +454,18 @@ var $e = { exports: {} };
|
|
|
454
454
|
// @method toString(): String
|
|
455
455
|
// Returns a string representation of the point for debugging purposes.
|
|
456
456
|
toString: function() {
|
|
457
|
-
return "Point(" +
|
|
457
|
+
return "Point(" + O(this.x) + ", " + O(this.y) + ")";
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
function x(t, e, i) {
|
|
461
461
|
return t instanceof P ? t : it(t) ? new P(t[0], t[1]) : t == null ? t : typeof t == "object" && "x" in t && "y" in t ? new P(t.x, t.y) : new P(t, e, i);
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Z(t, e) {
|
|
464
464
|
if (t)
|
|
465
465
|
for (var i = e ? [t, e] : t, n = 0, s = i.length; n < s; n++)
|
|
466
466
|
this.extend(i[n]);
|
|
467
467
|
}
|
|
468
|
-
|
|
468
|
+
Z.prototype = {
|
|
469
469
|
// @method extend(point: Point): this
|
|
470
470
|
// Extends the bounds to contain the given point.
|
|
471
471
|
// @alternative
|
|
@@ -477,7 +477,7 @@ var $e = { exports: {} };
|
|
|
477
477
|
return this;
|
|
478
478
|
if (t instanceof P || typeof t[0] == "number" || "x" in t)
|
|
479
479
|
e = i = x(t);
|
|
480
|
-
else if (t =
|
|
480
|
+
else if (t = Y(t), e = t.min, i = t.max, !e || !i)
|
|
481
481
|
return this;
|
|
482
482
|
return !this.min && !this.max ? (this.min = e.clone(), this.max = i.clone()) : (this.min.x = Math.min(e.x, this.min.x), this.max.x = Math.max(i.x, this.max.x), this.min.y = Math.min(e.y, this.min.y), this.max.y = Math.max(i.y, this.max.y)), this;
|
|
483
483
|
},
|
|
@@ -522,13 +522,13 @@ var $e = { exports: {} };
|
|
|
522
522
|
// Returns `true` if the rectangle contains the given point.
|
|
523
523
|
contains: function(t) {
|
|
524
524
|
var e, i;
|
|
525
|
-
return typeof t[0] == "number" || t instanceof P ? t = x(t) : t =
|
|
525
|
+
return typeof t[0] == "number" || t instanceof P ? t = x(t) : t = Y(t), t instanceof Z ? (e = t.min, i = t.max) : e = i = t, e.x >= this.min.x && i.x <= this.max.x && e.y >= this.min.y && i.y <= this.max.y;
|
|
526
526
|
},
|
|
527
527
|
// @method intersects(otherBounds: Bounds): Boolean
|
|
528
528
|
// Returns `true` if the rectangle intersects the given bounds. Two bounds
|
|
529
529
|
// intersect if they have at least one point in common.
|
|
530
530
|
intersects: function(t) {
|
|
531
|
-
t =
|
|
531
|
+
t = Y(t);
|
|
532
532
|
var e = this.min, i = this.max, n = t.min, s = t.max, a = s.x >= e.x && n.x <= i.x, l = s.y >= e.y && n.y <= i.y;
|
|
533
533
|
return a && l;
|
|
534
534
|
},
|
|
@@ -536,7 +536,7 @@ var $e = { exports: {} };
|
|
|
536
536
|
// Returns `true` if the rectangle overlaps the given bounds. Two bounds
|
|
537
537
|
// overlap if their intersection is an area.
|
|
538
538
|
overlaps: function(t) {
|
|
539
|
-
t =
|
|
539
|
+
t = Y(t);
|
|
540
540
|
var e = this.min, i = this.max, n = t.min, s = t.max, a = s.x > e.x && n.x < i.x, l = s.y > e.y && n.y < i.y;
|
|
541
541
|
return a && l;
|
|
542
542
|
},
|
|
@@ -551,7 +551,7 @@ var $e = { exports: {} };
|
|
|
551
551
|
// Negative values will retract the bounds.
|
|
552
552
|
pad: function(t) {
|
|
553
553
|
var e = this.min, i = this.max, n = Math.abs(e.x - i.x) * t, s = Math.abs(e.y - i.y) * t;
|
|
554
|
-
return
|
|
554
|
+
return Y(
|
|
555
555
|
x(e.x - n, e.y - s),
|
|
556
556
|
x(i.x + n, i.y + s)
|
|
557
557
|
);
|
|
@@ -559,18 +559,18 @@ var $e = { exports: {} };
|
|
|
559
559
|
// @method equals(otherBounds: Bounds): Boolean
|
|
560
560
|
// Returns `true` if the rectangle is equivalent to the given bounds.
|
|
561
561
|
equals: function(t) {
|
|
562
|
-
return t ? (t =
|
|
562
|
+
return t ? (t = Y(t), this.min.equals(t.getTopLeft()) && this.max.equals(t.getBottomRight())) : !1;
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
|
-
function q(t, e) {
|
|
566
|
-
return !t || t instanceof A ? t : new A(t, e);
|
|
567
|
-
}
|
|
568
565
|
function Y(t, e) {
|
|
566
|
+
return !t || t instanceof Z ? t : new Z(t, e);
|
|
567
|
+
}
|
|
568
|
+
function j(t, e) {
|
|
569
569
|
if (t)
|
|
570
570
|
for (var i = e ? [t, e] : t, n = 0, s = i.length; n < s; n++)
|
|
571
571
|
this.extend(i[n]);
|
|
572
572
|
}
|
|
573
|
-
|
|
573
|
+
j.prototype = {
|
|
574
574
|
// @method extend(latlng: LatLng): this
|
|
575
575
|
// Extend the bounds to contain the given point
|
|
576
576
|
// @alternative
|
|
@@ -578,14 +578,14 @@ var $e = { exports: {} };
|
|
|
578
578
|
// Extend the bounds to contain the given bounds
|
|
579
579
|
extend: function(t) {
|
|
580
580
|
var e = this._southWest, i = this._northEast, n, s;
|
|
581
|
-
if (t instanceof
|
|
581
|
+
if (t instanceof z)
|
|
582
582
|
n = t, s = t;
|
|
583
|
-
else if (t instanceof
|
|
583
|
+
else if (t instanceof j) {
|
|
584
584
|
if (n = t._southWest, s = t._northEast, !n || !s)
|
|
585
585
|
return this;
|
|
586
586
|
} else
|
|
587
587
|
return t ? this.extend(E(t) || N(t)) : this;
|
|
588
|
-
return !e && !i ? (this._southWest = new
|
|
588
|
+
return !e && !i ? (this._southWest = new z(n.lat, n.lng), this._northEast = new z(s.lat, s.lng)) : (e.lat = Math.min(n.lat, e.lat), e.lng = Math.min(n.lng, e.lng), i.lat = Math.max(s.lat, i.lat), i.lng = Math.max(s.lng, i.lng)), this;
|
|
589
589
|
},
|
|
590
590
|
// @method pad(bufferRatio: Number): LatLngBounds
|
|
591
591
|
// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
|
|
@@ -593,15 +593,15 @@ var $e = { exports: {} };
|
|
|
593
593
|
// Negative values will retract the bounds.
|
|
594
594
|
pad: function(t) {
|
|
595
595
|
var e = this._southWest, i = this._northEast, n = Math.abs(e.lat - i.lat) * t, s = Math.abs(e.lng - i.lng) * t;
|
|
596
|
-
return new
|
|
597
|
-
new
|
|
598
|
-
new
|
|
596
|
+
return new j(
|
|
597
|
+
new z(e.lat - n, e.lng - s),
|
|
598
|
+
new z(i.lat + n, i.lng + s)
|
|
599
599
|
);
|
|
600
600
|
},
|
|
601
601
|
// @method getCenter(): LatLng
|
|
602
602
|
// Returns the center point of the bounds.
|
|
603
603
|
getCenter: function() {
|
|
604
|
-
return new
|
|
604
|
+
return new z(
|
|
605
605
|
(this._southWest.lat + this._northEast.lat) / 2,
|
|
606
606
|
(this._southWest.lng + this._northEast.lng) / 2
|
|
607
607
|
);
|
|
@@ -619,12 +619,12 @@ var $e = { exports: {} };
|
|
|
619
619
|
// @method getNorthWest(): LatLng
|
|
620
620
|
// Returns the north-west point of the bounds.
|
|
621
621
|
getNorthWest: function() {
|
|
622
|
-
return new
|
|
622
|
+
return new z(this.getNorth(), this.getWest());
|
|
623
623
|
},
|
|
624
624
|
// @method getSouthEast(): LatLng
|
|
625
625
|
// Returns the south-east point of the bounds.
|
|
626
626
|
getSouthEast: function() {
|
|
627
|
-
return new
|
|
627
|
+
return new z(this.getSouth(), this.getEast());
|
|
628
628
|
},
|
|
629
629
|
// @method getWest(): Number
|
|
630
630
|
// Returns the west longitude of the bounds
|
|
@@ -652,9 +652,9 @@ var $e = { exports: {} };
|
|
|
652
652
|
// @method contains (latlng: LatLng): Boolean
|
|
653
653
|
// Returns `true` if the rectangle contains the given point.
|
|
654
654
|
contains: function(t) {
|
|
655
|
-
typeof t[0] == "number" || t instanceof
|
|
655
|
+
typeof t[0] == "number" || t instanceof z || "lat" in t ? t = E(t) : t = N(t);
|
|
656
656
|
var e = this._southWest, i = this._northEast, n, s;
|
|
657
|
-
return t instanceof
|
|
657
|
+
return t instanceof j ? (n = t.getSouthWest(), s = t.getNorthEast()) : n = s = t, n.lat >= e.lat && s.lat <= i.lat && n.lng >= e.lng && s.lng <= i.lng;
|
|
658
658
|
},
|
|
659
659
|
// @method intersects(otherBounds: LatLngBounds): Boolean
|
|
660
660
|
// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
|
|
@@ -687,14 +687,14 @@ var $e = { exports: {} };
|
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
689
|
function N(t, e) {
|
|
690
|
-
return t instanceof
|
|
690
|
+
return t instanceof j ? t : new j(t, e);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function z(t, e, i) {
|
|
693
693
|
if (isNaN(t) || isNaN(e))
|
|
694
694
|
throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
|
|
695
695
|
this.lat = +t, this.lng = +e, i !== void 0 && (this.alt = +i);
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
z.prototype = {
|
|
698
698
|
// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean
|
|
699
699
|
// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.
|
|
700
700
|
equals: function(t, e) {
|
|
@@ -710,17 +710,17 @@ var $e = { exports: {} };
|
|
|
710
710
|
// @method toString(): String
|
|
711
711
|
// Returns a string representation of the point (for debugging purposes).
|
|
712
712
|
toString: function(t) {
|
|
713
|
-
return "LatLng(" +
|
|
713
|
+
return "LatLng(" + O(this.lat, t) + ", " + O(this.lng, t) + ")";
|
|
714
714
|
},
|
|
715
715
|
// @method distanceTo(otherLatLng: LatLng): Number
|
|
716
716
|
// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).
|
|
717
717
|
distanceTo: function(t) {
|
|
718
|
-
return
|
|
718
|
+
return mt.distance(this, E(t));
|
|
719
719
|
},
|
|
720
720
|
// @method wrap(): LatLng
|
|
721
721
|
// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.
|
|
722
722
|
wrap: function() {
|
|
723
|
-
return
|
|
723
|
+
return mt.wrapLatLng(this);
|
|
724
724
|
},
|
|
725
725
|
// @method toBounds(sizeInMeters: Number): LatLngBounds
|
|
726
726
|
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
|
|
@@ -732,11 +732,11 @@ var $e = { exports: {} };
|
|
|
732
732
|
);
|
|
733
733
|
},
|
|
734
734
|
clone: function() {
|
|
735
|
-
return new
|
|
735
|
+
return new z(this.lat, this.lng, this.alt);
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
function E(t, e, i) {
|
|
739
|
-
return t instanceof
|
|
739
|
+
return t instanceof z ? t : it(t) && typeof t[0] != "object" ? t.length === 3 ? new z(t[0], t[1], t[2]) : t.length === 2 ? new z(t[0], t[1]) : null : t == null ? t : typeof t == "object" && "lat" in t ? new z(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : e === void 0 ? null : new z(t, e, i);
|
|
740
740
|
}
|
|
741
741
|
var ut = {
|
|
742
742
|
// @method latLngToPoint(latlng: LatLng, zoom: Number): Point
|
|
@@ -783,7 +783,7 @@ var $e = { exports: {} };
|
|
|
783
783
|
if (this.infinite)
|
|
784
784
|
return null;
|
|
785
785
|
var e = this.projection.bounds, i = this.scale(t), n = this.transformation.transform(e.min, i), s = this.transformation.transform(e.max, i);
|
|
786
|
-
return new
|
|
786
|
+
return new Z(n, s);
|
|
787
787
|
},
|
|
788
788
|
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
|
|
789
789
|
// Returns the distance between two geographical coordinates.
|
|
@@ -807,7 +807,7 @@ var $e = { exports: {} };
|
|
|
807
807
|
// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.
|
|
808
808
|
wrapLatLng: function(t) {
|
|
809
809
|
var e = this.wrapLng ? m(t.lng, this.wrapLng, !0) : t.lng, i = this.wrapLat ? m(t.lat, this.wrapLat, !0) : t.lat, n = t.alt;
|
|
810
|
-
return new
|
|
810
|
+
return new z(i, e, n);
|
|
811
811
|
},
|
|
812
812
|
// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
|
|
813
813
|
// Returns a `LatLngBounds` with the same size as the given one, ensuring
|
|
@@ -817,10 +817,10 @@ var $e = { exports: {} };
|
|
|
817
817
|
var e = t.getCenter(), i = this.wrapLatLng(e), n = e.lat - i.lat, s = e.lng - i.lng;
|
|
818
818
|
if (n === 0 && s === 0)
|
|
819
819
|
return t;
|
|
820
|
-
var a = t.getSouthWest(), l = t.getNorthEast(), u = new
|
|
821
|
-
return new
|
|
820
|
+
var a = t.getSouthWest(), l = t.getNorthEast(), u = new z(a.lat - n, a.lng - s), c = new z(l.lat - n, l.lng - s);
|
|
821
|
+
return new j(u, c);
|
|
822
822
|
}
|
|
823
|
-
},
|
|
823
|
+
}, mt = o({}, ut, {
|
|
824
824
|
wrapLng: [-180, 180],
|
|
825
825
|
// Mean Earth Radius, as recommended for use by
|
|
826
826
|
// the International Union of Geodesy and Geophysics,
|
|
@@ -843,14 +843,14 @@ var $e = { exports: {} };
|
|
|
843
843
|
},
|
|
844
844
|
unproject: function(t) {
|
|
845
845
|
var e = 180 / Math.PI;
|
|
846
|
-
return new
|
|
846
|
+
return new z(
|
|
847
847
|
(2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * e,
|
|
848
848
|
t.x * e / this.R
|
|
849
849
|
);
|
|
850
850
|
},
|
|
851
851
|
bounds: function() {
|
|
852
852
|
var t = ri * Math.PI;
|
|
853
|
-
return new
|
|
853
|
+
return new Z([-t, -t], [t, t]);
|
|
854
854
|
}()
|
|
855
855
|
};
|
|
856
856
|
function Le(t, e, i, n) {
|
|
@@ -884,7 +884,7 @@ var $e = { exports: {} };
|
|
|
884
884
|
function At(t, e, i, n) {
|
|
885
885
|
return new Le(t, e, i, n);
|
|
886
886
|
}
|
|
887
|
-
var we = o({},
|
|
887
|
+
var we = o({}, mt, {
|
|
888
888
|
code: "EPSG:3857",
|
|
889
889
|
projection: ye,
|
|
890
890
|
transformation: function() {
|
|
@@ -1067,11 +1067,11 @@ var $e = { exports: {} };
|
|
|
1067
1067
|
}
|
|
1068
1068
|
return i === "auto" ? null : i;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function S(t, e, i) {
|
|
1071
1071
|
var n = document.createElement(t);
|
|
1072
1072
|
return n.className = e || "", i && i.appendChild(n), n;
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function B(t) {
|
|
1075
1075
|
var e = t.parentNode;
|
|
1076
1076
|
e && e.removeChild(t);
|
|
1077
1077
|
}
|
|
@@ -1111,7 +1111,7 @@ var $e = { exports: {} };
|
|
|
1111
1111
|
function $t(t) {
|
|
1112
1112
|
return t.correspondingElement && (t = t.correspondingElement), t.className.baseVal === void 0 ? t.className : t.className.baseVal;
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function $(t, e) {
|
|
1115
1115
|
"opacity" in t.style ? t.style.opacity = e : "filter" in t.style && Kn(t, e);
|
|
1116
1116
|
}
|
|
1117
1117
|
function Kn(t, e) {
|
|
@@ -1145,7 +1145,7 @@ var $e = { exports: {} };
|
|
|
1145
1145
|
Nt = function() {
|
|
1146
1146
|
T(window, "selectstart", F);
|
|
1147
1147
|
}, Ht = function() {
|
|
1148
|
-
|
|
1148
|
+
I(window, "selectstart", F);
|
|
1149
1149
|
};
|
|
1150
1150
|
else {
|
|
1151
1151
|
var Ut = te(
|
|
@@ -1164,7 +1164,7 @@ var $e = { exports: {} };
|
|
|
1164
1164
|
T(window, "dragstart", F);
|
|
1165
1165
|
}
|
|
1166
1166
|
function ze() {
|
|
1167
|
-
|
|
1167
|
+
I(window, "dragstart", F);
|
|
1168
1168
|
}
|
|
1169
1169
|
var ee, Ie;
|
|
1170
1170
|
function Ae(t) {
|
|
@@ -1173,7 +1173,7 @@ var $e = { exports: {} };
|
|
|
1173
1173
|
t.style && (ie(), ee = t, Ie = t.style.outlineStyle, t.style.outlineStyle = "none", T(window, "keydown", ie));
|
|
1174
1174
|
}
|
|
1175
1175
|
function ie() {
|
|
1176
|
-
ee && (ee.style.outlineStyle = Ie, ee = void 0, Ie = void 0,
|
|
1176
|
+
ee && (ee.style.outlineStyle = Ie, ee = void 0, Ie = void 0, I(window, "keydown", ie));
|
|
1177
1177
|
}
|
|
1178
1178
|
function Di(t) {
|
|
1179
1179
|
do
|
|
@@ -1196,8 +1196,8 @@ var $e = { exports: {} };
|
|
|
1196
1196
|
TRANSITION_END: Ei,
|
|
1197
1197
|
get: Ci,
|
|
1198
1198
|
getStyle: Rt,
|
|
1199
|
-
create:
|
|
1200
|
-
remove:
|
|
1199
|
+
create: S,
|
|
1200
|
+
remove: B,
|
|
1201
1201
|
empty: Qt,
|
|
1202
1202
|
toFront: Mt,
|
|
1203
1203
|
toBack: kt,
|
|
@@ -1206,7 +1206,7 @@ var $e = { exports: {} };
|
|
|
1206
1206
|
removeClass: R,
|
|
1207
1207
|
setClass: De,
|
|
1208
1208
|
getClass: $t,
|
|
1209
|
-
setOpacity:
|
|
1209
|
+
setOpacity: $,
|
|
1210
1210
|
testProp: te,
|
|
1211
1211
|
setTransform: Lt,
|
|
1212
1212
|
setPosition: H,
|
|
@@ -1236,7 +1236,7 @@ var $e = { exports: {} };
|
|
|
1236
1236
|
return this;
|
|
1237
1237
|
}
|
|
1238
1238
|
var rt = "_leaflet_events";
|
|
1239
|
-
function
|
|
1239
|
+
function I(t, e, i, n) {
|
|
1240
1240
|
if (arguments.length === 1)
|
|
1241
1241
|
Si(t), delete t[rt];
|
|
1242
1242
|
else if (e && typeof e == "object")
|
|
@@ -1263,7 +1263,7 @@ var $e = { exports: {} };
|
|
|
1263
1263
|
wheel: !("onwheel" in window) && "mousewheel"
|
|
1264
1264
|
};
|
|
1265
1265
|
function Re(t, e, i, n) {
|
|
1266
|
-
var s = e +
|
|
1266
|
+
var s = e + p(i) + (n ? "_" + p(n) : "");
|
|
1267
1267
|
if (t[rt] && t[rt][s])
|
|
1268
1268
|
return this;
|
|
1269
1269
|
var a = function(u) {
|
|
@@ -1274,7 +1274,7 @@ var $e = { exports: {} };
|
|
|
1274
1274
|
}, t.addEventListener(Be[e], a, !1)) : t.addEventListener(e, l, !1) : t.attachEvent("on" + e, a), t[rt] = t[rt] || {}, t[rt][s] = a;
|
|
1275
1275
|
}
|
|
1276
1276
|
function Ne(t, e, i, n, s) {
|
|
1277
|
-
s = s || e +
|
|
1277
|
+
s = s || e + p(i) + (n ? "_" + p(n) : "");
|
|
1278
1278
|
var a = t[rt] && t[rt][s];
|
|
1279
1279
|
if (!a)
|
|
1280
1280
|
return this;
|
|
@@ -1356,7 +1356,7 @@ var $e = { exports: {} };
|
|
|
1356
1356
|
var Qn = {
|
|
1357
1357
|
__proto__: null,
|
|
1358
1358
|
on: T,
|
|
1359
|
-
off:
|
|
1359
|
+
off: I,
|
|
1360
1360
|
stopPropagation: bt,
|
|
1361
1361
|
disableScrollPropagation: He,
|
|
1362
1362
|
disableClickPropagation: Gt,
|
|
@@ -1367,7 +1367,7 @@ var $e = { exports: {} };
|
|
|
1367
1367
|
getWheelDelta: Ii,
|
|
1368
1368
|
isExternalTarget: Ue,
|
|
1369
1369
|
addListener: T,
|
|
1370
|
-
removeListener:
|
|
1370
|
+
removeListener: I
|
|
1371
1371
|
}, Ai = It.extend({
|
|
1372
1372
|
// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
|
|
1373
1373
|
// Run an animation of a given element to a new position, optionally setting
|
|
@@ -1383,7 +1383,7 @@ var $e = { exports: {} };
|
|
|
1383
1383
|
this._inProgress && (this._step(!0), this._complete());
|
|
1384
1384
|
},
|
|
1385
1385
|
_animate: function() {
|
|
1386
|
-
this._animId =
|
|
1386
|
+
this._animId = q(this._animate, this), this._step();
|
|
1387
1387
|
},
|
|
1388
1388
|
_step: function(t) {
|
|
1389
1389
|
var e = +/* @__PURE__ */ new Date() - this._startTime, i = this._duration * 1e3;
|
|
@@ -1394,7 +1394,7 @@ var $e = { exports: {} };
|
|
|
1394
1394
|
e && i._round(), H(this._el, i), this.fire("step");
|
|
1395
1395
|
},
|
|
1396
1396
|
_complete: function() {
|
|
1397
|
-
|
|
1397
|
+
Q(this._animId), this._inProgress = !1, this.fire("end");
|
|
1398
1398
|
},
|
|
1399
1399
|
_easeOut: function(t) {
|
|
1400
1400
|
return 1 - Math.pow(1 - t, this._easeOutPower);
|
|
@@ -1477,7 +1477,7 @@ var $e = { exports: {} };
|
|
|
1477
1477
|
trackResize: !0
|
|
1478
1478
|
},
|
|
1479
1479
|
initialize: function(t, e) {
|
|
1480
|
-
e =
|
|
1480
|
+
e = A(this, e), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(t), this._initLayout(), this._onResize = h(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== void 0 && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== void 0 && this.setView(E(e.center), e.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = Bt && w.any3d && !w.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), T(this._proxy, Ei, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
|
|
1481
1481
|
},
|
|
1482
1482
|
// @section Methods for modifying map state
|
|
1483
1483
|
// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this
|
|
@@ -1583,29 +1583,29 @@ var $e = { exports: {} };
|
|
|
1583
1583
|
var fe = U ? -1 : 1, Uo = U ? c : u, Go = c * c - u * u + fe * b * b * _ * _, Fo = 2 * Uo * b * _, Qe = Go / Fo, mn = Math.sqrt(Qe * Qe + 1) - Qe, Wo = mn < 1e-9 ? -18 : Math.log(mn);
|
|
1584
1584
|
return Wo;
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function V(U) {
|
|
1587
1587
|
return (Math.exp(U) - Math.exp(-U)) / 2;
|
|
1588
1588
|
}
|
|
1589
1589
|
function G(U) {
|
|
1590
1590
|
return (Math.exp(U) + Math.exp(-U)) / 2;
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1593
|
-
return
|
|
1592
|
+
function et(U) {
|
|
1593
|
+
return V(U) / G(U);
|
|
1594
1594
|
}
|
|
1595
|
-
var
|
|
1595
|
+
var K = k(0);
|
|
1596
1596
|
function zt(U) {
|
|
1597
|
-
return u * (G(
|
|
1597
|
+
return u * (G(K) / G(K + v * U));
|
|
1598
1598
|
}
|
|
1599
1599
|
function Bo(U) {
|
|
1600
|
-
return u * (G(
|
|
1600
|
+
return u * (G(K) * et(K + v * U) - V(K)) / b;
|
|
1601
1601
|
}
|
|
1602
1602
|
function Ro(U) {
|
|
1603
1603
|
return 1 - Math.pow(1 - U, 1.5);
|
|
1604
1604
|
}
|
|
1605
|
-
var No = Date.now(), fn = (k(1) -
|
|
1605
|
+
var No = Date.now(), fn = (k(1) - K) / v, Ho = i.duration ? 1e3 * i.duration : 1e3 * fn * 0.8;
|
|
1606
1606
|
function pn() {
|
|
1607
1607
|
var U = (Date.now() - No) / Ho, fe = Ro(U) * fn;
|
|
1608
|
-
U <= 1 ? (this._flyToFrame =
|
|
1608
|
+
U <= 1 ? (this._flyToFrame = q(pn, this), this._move(
|
|
1609
1609
|
this.unproject(n.add(s.subtract(n).multiplyBy(Bo(fe) / _)), l),
|
|
1610
1610
|
this.getScaleZoom(u / zt(fe), l),
|
|
1611
1611
|
{ flyTo: !0 }
|
|
@@ -1651,7 +1651,7 @@ var $e = { exports: {} };
|
|
|
1651
1651
|
// the map will not be panned.
|
|
1652
1652
|
panInside: function(t, e) {
|
|
1653
1653
|
e = e || {};
|
|
1654
|
-
var i = x(e.paddingTopLeft || e.padding || [0, 0]), n = x(e.paddingBottomRight || e.padding || [0, 0]), s = this.project(this.getCenter()), a = this.project(t), l = this.getPixelBounds(), u =
|
|
1654
|
+
var i = x(e.paddingTopLeft || e.padding || [0, 0]), n = x(e.paddingBottomRight || e.padding || [0, 0]), s = this.project(this.getCenter()), a = this.project(t), l = this.getPixelBounds(), u = Y([l.min.add(i), l.max.subtract(n)]), c = u.getSize();
|
|
1655
1655
|
if (!u.contains(a)) {
|
|
1656
1656
|
this._enforcingBounds = !0;
|
|
1657
1657
|
var _ = a.subtract(u.getCenter()), v = u.extend(a).getSize().subtract(c);
|
|
@@ -1735,7 +1735,7 @@ var $e = { exports: {} };
|
|
|
1735
1735
|
},
|
|
1736
1736
|
_handleGeolocationResponse: function(t) {
|
|
1737
1737
|
if (this._container._leaflet_id) {
|
|
1738
|
-
var e = t.coords.latitude, i = t.coords.longitude, n = new
|
|
1738
|
+
var e = t.coords.latitude, i = t.coords.longitude, n = new z(e, i), s = n.toBounds(t.coords.accuracy * 2), a = this._locateOptions;
|
|
1739
1739
|
if (a.setView) {
|
|
1740
1740
|
var l = this.getBoundsZoom(s);
|
|
1741
1741
|
this.setView(n, a.maxZoom ? Math.min(l, a.maxZoom) : l);
|
|
@@ -1770,12 +1770,12 @@ var $e = { exports: {} };
|
|
|
1770
1770
|
} catch {
|
|
1771
1771
|
this._container._leaflet_id = void 0, this._containerId = void 0;
|
|
1772
1772
|
}
|
|
1773
|
-
this._locationWatchId !== void 0 && this.stopLocate(), this._stop(),
|
|
1773
|
+
this._locationWatchId !== void 0 && this.stopLocate(), this._stop(), B(this._mapPane), this._clearControlPos && this._clearControlPos(), this._resizeRequest && (Q(this._resizeRequest), this._resizeRequest = null), this._clearHandlers(), this._loaded && this.fire("unload");
|
|
1774
1774
|
var t;
|
|
1775
1775
|
for (t in this._layers)
|
|
1776
1776
|
this._layers[t].remove();
|
|
1777
1777
|
for (t in this._panes)
|
|
1778
|
-
|
|
1778
|
+
B(this._panes[t]);
|
|
1779
1779
|
return this._layers = [], this._panes = [], delete this._mapPane, delete this._renderer, this;
|
|
1780
1780
|
},
|
|
1781
1781
|
// @section Other Methods
|
|
@@ -1784,7 +1784,7 @@ var $e = { exports: {} };
|
|
|
1784
1784
|
// then returns it. The pane is created as a child of `container`, or
|
|
1785
1785
|
// as a child of the main map pane if not set.
|
|
1786
1786
|
createPane: function(t, e) {
|
|
1787
|
-
var i = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), n =
|
|
1787
|
+
var i = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), n = S("div", i, e || this._mapPane);
|
|
1788
1788
|
return t && (this._panes[t] = n), n;
|
|
1789
1789
|
},
|
|
1790
1790
|
// @section Methods for Getting Map State
|
|
@@ -1802,7 +1802,7 @@ var $e = { exports: {} };
|
|
|
1802
1802
|
// Returns the geographical bounds visible in the current map view
|
|
1803
1803
|
getBounds: function() {
|
|
1804
1804
|
var t = this.getPixelBounds(), e = this.unproject(t.getBottomLeft()), i = this.unproject(t.getTopRight());
|
|
1805
|
-
return new
|
|
1805
|
+
return new j(e, i);
|
|
1806
1806
|
},
|
|
1807
1807
|
// @method getMinZoom(): Number
|
|
1808
1808
|
// Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.
|
|
@@ -1821,8 +1821,8 @@ var $e = { exports: {} };
|
|
|
1821
1821
|
// the given bounds in its entirety.
|
|
1822
1822
|
getBoundsZoom: function(t, e, i) {
|
|
1823
1823
|
t = N(t), i = x(i || [0, 0]);
|
|
1824
|
-
var n = this.getZoom() || 0, s = this.getMinZoom(), a = this.getMaxZoom(), l = t.getNorthWest(), u = t.getSouthEast(), c = this.getSize().subtract(i), _ =
|
|
1825
|
-
return n = this.getScaleZoom(
|
|
1824
|
+
var n = this.getZoom() || 0, s = this.getMinZoom(), a = this.getMaxZoom(), l = t.getNorthWest(), u = t.getSouthEast(), c = this.getSize().subtract(i), _ = Y(this.project(u, n), this.project(l, n)).getSize(), v = w.any3d ? this.options.zoomSnap : 1, b = c.x / _.x, k = c.y / _.y, V = e ? Math.max(b, k) : Math.min(b, k);
|
|
1825
|
+
return n = this.getScaleZoom(V, n), v && (n = Math.round(n / (v / 100)) * (v / 100), n = e ? Math.ceil(n / v) * v : Math.floor(n / v) * v), Math.max(s, Math.min(a, n));
|
|
1826
1826
|
},
|
|
1827
1827
|
// @method getSize(): Point
|
|
1828
1828
|
// Returns the current size of the map container (in pixels).
|
|
@@ -1837,7 +1837,7 @@ var $e = { exports: {} };
|
|
|
1837
1837
|
// coordinates (sometimes useful in layer and overlay implementations).
|
|
1838
1838
|
getPixelBounds: function(t, e) {
|
|
1839
1839
|
var i = this._getTopLeftPoint(t, e);
|
|
1840
|
-
return new
|
|
1840
|
+
return new Z(i, i.add(this.getSize()));
|
|
1841
1841
|
},
|
|
1842
1842
|
// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to
|
|
1843
1843
|
// the map pane? "left point of the map layer" can be confusing, specially
|
|
@@ -1990,7 +1990,7 @@ var $e = { exports: {} };
|
|
|
1990
1990
|
if (e._leaflet_id)
|
|
1991
1991
|
throw new Error("Map container is already initialized.");
|
|
1992
1992
|
} else throw new Error("Map container not found.");
|
|
1993
|
-
T(e, "scroll", this._onScroll, this), this._containerId =
|
|
1993
|
+
T(e, "scroll", this._onScroll, this), this._containerId = p(e);
|
|
1994
1994
|
},
|
|
1995
1995
|
_initLayout: function() {
|
|
1996
1996
|
var t = this._container;
|
|
@@ -2023,7 +2023,7 @@ var $e = { exports: {} };
|
|
|
2023
2023
|
return t && this.fire("zoomend"), this.fire("moveend");
|
|
2024
2024
|
},
|
|
2025
2025
|
_stop: function() {
|
|
2026
|
-
return
|
|
2026
|
+
return Q(this._flyToFrame), this._panAnim && this._panAnim.stop(), this;
|
|
2027
2027
|
},
|
|
2028
2028
|
_rawPanBy: function(t) {
|
|
2029
2029
|
H(this._mapPane, this._getMapPanePos().subtract(t));
|
|
@@ -2041,12 +2041,12 @@ var $e = { exports: {} };
|
|
|
2041
2041
|
// DOM event handling
|
|
2042
2042
|
// @section Interaction events
|
|
2043
2043
|
_initEvents: function(t) {
|
|
2044
|
-
this._targets = {}, this._targets[
|
|
2045
|
-
var e = t ?
|
|
2044
|
+
this._targets = {}, this._targets[p(this._container)] = this;
|
|
2045
|
+
var e = t ? I : T;
|
|
2046
2046
|
e(this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup", this._handleDOMEvent, this), this.options.trackResize && e(window, "resize", this._onResize, this), w.any3d && this.options.transform3DLimit && (t ? this.off : this.on).call(this, "moveend", this._onMoveEnd);
|
|
2047
2047
|
},
|
|
2048
2048
|
_onResize: function() {
|
|
2049
|
-
|
|
2049
|
+
Q(this._resizeRequest), this._resizeRequest = q(
|
|
2050
2050
|
function() {
|
|
2051
2051
|
this.invalidateSize({ debounceMoveend: !0 });
|
|
2052
2052
|
},
|
|
@@ -2062,7 +2062,7 @@ var $e = { exports: {} };
|
|
|
2062
2062
|
},
|
|
2063
2063
|
_findEventTargets: function(t, e) {
|
|
2064
2064
|
for (var i = [], n, s = e === "mouseout" || e === "mouseover", a = t.target || t.srcElement, l = !1; a; ) {
|
|
2065
|
-
if (n = this._targets[
|
|
2065
|
+
if (n = this._targets[p(a)], n && (e === "click" || e === "preclick") && this._draggableMoved(n)) {
|
|
2066
2066
|
l = !0;
|
|
2067
2067
|
break;
|
|
2068
2068
|
}
|
|
@@ -2149,7 +2149,7 @@ var $e = { exports: {} };
|
|
|
2149
2149
|
},
|
|
2150
2150
|
_latLngBoundsToNewLayerBounds: function(t, e, i) {
|
|
2151
2151
|
var n = this._getNewPixelOrigin(i, e);
|
|
2152
|
-
return
|
|
2152
|
+
return Y([
|
|
2153
2153
|
this.project(t.getSouthWest(), e)._subtract(n),
|
|
2154
2154
|
this.project(t.getNorthWest(), e)._subtract(n),
|
|
2155
2155
|
this.project(t.getSouthEast(), e)._subtract(n),
|
|
@@ -2168,19 +2168,19 @@ var $e = { exports: {} };
|
|
|
2168
2168
|
_limitCenter: function(t, e, i) {
|
|
2169
2169
|
if (!i)
|
|
2170
2170
|
return t;
|
|
2171
|
-
var n = this.project(t, e), s = this.getSize().divideBy(2), a = new
|
|
2171
|
+
var n = this.project(t, e), s = this.getSize().divideBy(2), a = new Z(n.subtract(s), n.add(s)), l = this._getBoundsOffset(a, i, e);
|
|
2172
2172
|
return Math.abs(l.x) <= 1 && Math.abs(l.y) <= 1 ? t : this.unproject(n.add(l), e);
|
|
2173
2173
|
},
|
|
2174
2174
|
// adjust offset for view to get inside bounds
|
|
2175
2175
|
_limitOffset: function(t, e) {
|
|
2176
2176
|
if (!e)
|
|
2177
2177
|
return t;
|
|
2178
|
-
var i = this.getPixelBounds(), n = new
|
|
2178
|
+
var i = this.getPixelBounds(), n = new Z(i.min.add(t), i.max.add(t));
|
|
2179
2179
|
return t.add(this._getBoundsOffset(n, e));
|
|
2180
2180
|
},
|
|
2181
2181
|
// returns offset needed for pxBounds to get inside maxBounds at a specified zoom
|
|
2182
2182
|
_getBoundsOffset: function(t, e, i) {
|
|
2183
|
-
var n =
|
|
2183
|
+
var n = Y(
|
|
2184
2184
|
this.project(e.getNorthEast(), i),
|
|
2185
2185
|
this.project(e.getSouthWest(), i)
|
|
2186
2186
|
), s = n.min.subtract(t.min), a = n.max.subtract(t.max), l = this._rebound(s.x, -a.x), u = this._rebound(s.y, -a.y);
|
|
@@ -2204,14 +2204,14 @@ var $e = { exports: {} };
|
|
|
2204
2204
|
return (e && e.animate) !== !0 && !this.getSize().contains(i) ? !1 : (this.panBy(i, e), !0);
|
|
2205
2205
|
},
|
|
2206
2206
|
_createAnimProxy: function() {
|
|
2207
|
-
var t = this._proxy =
|
|
2207
|
+
var t = this._proxy = S("div", "leaflet-proxy leaflet-zoom-animated");
|
|
2208
2208
|
this._panes.mapPane.appendChild(t), this.on("zoomanim", function(e) {
|
|
2209
2209
|
var i = Ee, n = this._proxy.style[i];
|
|
2210
2210
|
Lt(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)), n === this._proxy.style[i] && this._animatingZoom && this._onZoomTransitionEnd();
|
|
2211
2211
|
}, this), this.on("load moveend", this._animMoveEnd, this), this._on("unload", this._destroyAnimProxy, this);
|
|
2212
2212
|
},
|
|
2213
2213
|
_destroyAnimProxy: function() {
|
|
2214
|
-
|
|
2214
|
+
B(this._proxy), this.off("load moveend", this._animMoveEnd, this), delete this._proxy;
|
|
2215
2215
|
},
|
|
2216
2216
|
_animMoveEnd: function() {
|
|
2217
2217
|
var t = this.getCenter(), e = this.getZoom();
|
|
@@ -2229,7 +2229,7 @@ var $e = { exports: {} };
|
|
|
2229
2229
|
if (i = i || {}, !this._zoomAnimated || i.animate === !1 || this._nothingToAnimate() || Math.abs(e - this._zoom) > this.options.zoomAnimationThreshold)
|
|
2230
2230
|
return !1;
|
|
2231
2231
|
var n = this.getZoomScale(e), s = this._getCenterOffset(t)._divideBy(1 - 1 / n);
|
|
2232
|
-
return i.animate !== !0 && !this.getSize().contains(s) ? !1 : (
|
|
2232
|
+
return i.animate !== !0 && !this.getSize().contains(s) ? !1 : (q(function() {
|
|
2233
2233
|
this._moveStart(!0, i.noMoveStart || !1)._animateZoom(t, e, !0);
|
|
2234
2234
|
}, this), !0);
|
|
2235
2235
|
},
|
|
@@ -2257,7 +2257,7 @@ var $e = { exports: {} };
|
|
|
2257
2257
|
position: "topright"
|
|
2258
2258
|
},
|
|
2259
2259
|
initialize: function(t) {
|
|
2260
|
-
|
|
2260
|
+
A(this, t);
|
|
2261
2261
|
},
|
|
2262
2262
|
/* @section
|
|
2263
2263
|
* Classes extending L.Control will inherit the following methods:
|
|
@@ -2289,7 +2289,7 @@ var $e = { exports: {} };
|
|
|
2289
2289
|
// @method remove: this
|
|
2290
2290
|
// Removes the control from the map it is currently active on.
|
|
2291
2291
|
remove: function() {
|
|
2292
|
-
return this._map ? (
|
|
2292
|
+
return this._map ? (B(this._container), this.onRemove && this.onRemove(this._map), this._map.off("unload", this.remove, this), this._map = null, this) : this;
|
|
2293
2293
|
},
|
|
2294
2294
|
_refocusOnMap: function(t) {
|
|
2295
2295
|
this._map && t && t.screenX > 0 && t.screenY > 0 && this._map.getContainer().focus();
|
|
@@ -2309,17 +2309,17 @@ var $e = { exports: {} };
|
|
|
2309
2309
|
return t.remove(), this;
|
|
2310
2310
|
},
|
|
2311
2311
|
_initControlPos: function() {
|
|
2312
|
-
var t = this._controlCorners = {}, e = "leaflet-", i = this._controlContainer =
|
|
2312
|
+
var t = this._controlCorners = {}, e = "leaflet-", i = this._controlContainer = S("div", e + "control-container", this._container);
|
|
2313
2313
|
function n(s, a) {
|
|
2314
2314
|
var l = e + s + " " + e + a;
|
|
2315
|
-
t[s + a] =
|
|
2315
|
+
t[s + a] = S("div", l, i);
|
|
2316
2316
|
}
|
|
2317
2317
|
n("top", "left"), n("top", "right"), n("bottom", "left"), n("bottom", "right");
|
|
2318
2318
|
},
|
|
2319
2319
|
_clearControlPos: function() {
|
|
2320
2320
|
for (var t in this._controlCorners)
|
|
2321
|
-
|
|
2322
|
-
|
|
2321
|
+
B(this._controlCorners[t]);
|
|
2322
|
+
B(this._controlContainer), delete this._controlCorners, delete this._controlContainer;
|
|
2323
2323
|
}
|
|
2324
2324
|
});
|
|
2325
2325
|
var Zi = nt.extend({
|
|
@@ -2351,7 +2351,7 @@ var $e = { exports: {} };
|
|
|
2351
2351
|
}
|
|
2352
2352
|
},
|
|
2353
2353
|
initialize: function(t, e, i) {
|
|
2354
|
-
|
|
2354
|
+
A(this, i), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
|
|
2355
2355
|
for (var n in t)
|
|
2356
2356
|
this._addLayer(t[n], n);
|
|
2357
2357
|
for (n in e)
|
|
@@ -2385,7 +2385,7 @@ var $e = { exports: {} };
|
|
|
2385
2385
|
// Remove the given layer from the control.
|
|
2386
2386
|
removeLayer: function(t) {
|
|
2387
2387
|
t.off("add remove", this._onLayerChange, this);
|
|
2388
|
-
var e = this._getLayer(
|
|
2388
|
+
var e = this._getLayer(p(t));
|
|
2389
2389
|
return e && this._layers.splice(this._layers.indexOf(e), 1), this._map ? this._update() : this;
|
|
2390
2390
|
},
|
|
2391
2391
|
// @method expand(): this
|
|
@@ -2401,14 +2401,14 @@ var $e = { exports: {} };
|
|
|
2401
2401
|
return R(this._container, "leaflet-control-layers-expanded"), this;
|
|
2402
2402
|
},
|
|
2403
2403
|
_initLayout: function() {
|
|
2404
|
-
var t = "leaflet-control-layers", e = this._container =
|
|
2404
|
+
var t = "leaflet-control-layers", e = this._container = S("div", t), i = this.options.collapsed;
|
|
2405
2405
|
e.setAttribute("aria-haspopup", !0), Gt(e), He(e);
|
|
2406
|
-
var n = this._section =
|
|
2406
|
+
var n = this._section = S("section", t + "-list");
|
|
2407
2407
|
i && (this._map.on("click", this.collapse, this), T(e, {
|
|
2408
2408
|
mouseenter: this._expandSafely,
|
|
2409
2409
|
mouseleave: this.collapse
|
|
2410
2410
|
}, this));
|
|
2411
|
-
var s = this._layersLink =
|
|
2411
|
+
var s = this._layersLink = S("a", t + "-toggle", e);
|
|
2412
2412
|
s.href = "#", s.title = "Layers", s.setAttribute("role", "button"), T(s, {
|
|
2413
2413
|
keydown: function(a) {
|
|
2414
2414
|
a.keyCode === 13 && this._expandSafely();
|
|
@@ -2417,11 +2417,11 @@ var $e = { exports: {} };
|
|
|
2417
2417
|
click: function(a) {
|
|
2418
2418
|
F(a), this._expandSafely();
|
|
2419
2419
|
}
|
|
2420
|
-
}, this), i || this.expand(), this._baseLayersList =
|
|
2420
|
+
}, this), i || this.expand(), this._baseLayersList = S("div", t + "-base", n), this._separator = S("div", t + "-separator", n), this._overlaysList = S("div", t + "-overlays", n), e.appendChild(n);
|
|
2421
2421
|
},
|
|
2422
2422
|
_getLayer: function(t) {
|
|
2423
2423
|
for (var e = 0; e < this._layers.length; e++)
|
|
2424
|
-
if (this._layers[e] &&
|
|
2424
|
+
if (this._layers[e] && p(this._layers[e].layer) === t)
|
|
2425
2425
|
return this._layers[e];
|
|
2426
2426
|
},
|
|
2427
2427
|
_addLayer: function(t, e, i) {
|
|
@@ -2444,7 +2444,7 @@ var $e = { exports: {} };
|
|
|
2444
2444
|
},
|
|
2445
2445
|
_onLayerChange: function(t) {
|
|
2446
2446
|
this._handlingClick || this._update();
|
|
2447
|
-
var e = this._getLayer(
|
|
2447
|
+
var e = this._getLayer(p(t.target)), i = e.overlay ? t.type === "add" ? "overlayadd" : "overlayremove" : t.type === "add" ? "baselayerchange" : null;
|
|
2448
2448
|
i && this._map.fire(i, e);
|
|
2449
2449
|
},
|
|
2450
2450
|
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)
|
|
@@ -2454,7 +2454,7 @@ var $e = { exports: {} };
|
|
|
2454
2454
|
},
|
|
2455
2455
|
_addItem: function(t) {
|
|
2456
2456
|
var e = document.createElement("label"), i = this._map.hasLayer(t.layer), n;
|
|
2457
|
-
t.overlay ? (n = document.createElement("input"), n.type = "checkbox", n.className = "leaflet-control-layers-selector", n.defaultChecked = i) : n = this._createRadioElement("leaflet-base-layers_" +
|
|
2457
|
+
t.overlay ? (n = document.createElement("input"), n.type = "checkbox", n.className = "leaflet-control-layers-selector", n.defaultChecked = i) : n = this._createRadioElement("leaflet-base-layers_" + p(this), i), this._layerControlInputs.push(n), n.layerId = p(t.layer), T(n, "click", this._onInputClick, this);
|
|
2458
2458
|
var s = document.createElement("span");
|
|
2459
2459
|
s.innerHTML = " " + t.name;
|
|
2460
2460
|
var a = document.createElement("span");
|
|
@@ -2487,7 +2487,7 @@ var $e = { exports: {} };
|
|
|
2487
2487
|
this._preventClick = !0, T(t, "click", F), this.expand();
|
|
2488
2488
|
var e = this;
|
|
2489
2489
|
setTimeout(function() {
|
|
2490
|
-
|
|
2490
|
+
I(t, "click", F), e._preventClick = !1;
|
|
2491
2491
|
});
|
|
2492
2492
|
}
|
|
2493
2493
|
}), to = function(t, e, i) {
|
|
@@ -2511,7 +2511,7 @@ var $e = { exports: {} };
|
|
|
2511
2511
|
zoomOutTitle: "Zoom out"
|
|
2512
2512
|
},
|
|
2513
2513
|
onAdd: function(t) {
|
|
2514
|
-
var e = "leaflet-control-zoom", i =
|
|
2514
|
+
var e = "leaflet-control-zoom", i = S("div", e + " leaflet-bar"), n = this.options;
|
|
2515
2515
|
return this._zoomInButton = this._createButton(
|
|
2516
2516
|
n.zoomInText,
|
|
2517
2517
|
n.zoomInTitle,
|
|
@@ -2542,7 +2542,7 @@ var $e = { exports: {} };
|
|
|
2542
2542
|
!this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
|
|
2543
2543
|
},
|
|
2544
2544
|
_createButton: function(t, e, i, n, s) {
|
|
2545
|
-
var a =
|
|
2545
|
+
var a = S("a", i, n);
|
|
2546
2546
|
return a.innerHTML = t, a.href = "#", a.title = e, a.setAttribute("role", "button"), a.setAttribute("aria-label", e), Gt(a), T(a, "click", xt), T(a, "click", s, this), T(a, "click", this._refocusOnMap, this), a;
|
|
2547
2547
|
},
|
|
2548
2548
|
_updateDisabled: function() {
|
|
@@ -2575,14 +2575,14 @@ var $e = { exports: {} };
|
|
|
2575
2575
|
// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
|
|
2576
2576
|
},
|
|
2577
2577
|
onAdd: function(t) {
|
|
2578
|
-
var e = "leaflet-control-scale", i =
|
|
2578
|
+
var e = "leaflet-control-scale", i = S("div", e), n = this.options;
|
|
2579
2579
|
return this._addScales(n, e + "-line", i), t.on(n.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), i;
|
|
2580
2580
|
},
|
|
2581
2581
|
onRemove: function(t) {
|
|
2582
2582
|
t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this);
|
|
2583
2583
|
},
|
|
2584
2584
|
_addScales: function(t, e, i) {
|
|
2585
|
-
t.metric && (this._mScale =
|
|
2585
|
+
t.metric && (this._mScale = S("div", e, i)), t.imperial && (this._iScale = S("div", e, i));
|
|
2586
2586
|
},
|
|
2587
2587
|
_update: function() {
|
|
2588
2588
|
var t = this._map, e = t.getSize().y / 2, i = t.distance(
|
|
@@ -2621,10 +2621,10 @@ var $e = { exports: {} };
|
|
|
2621
2621
|
prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (w.inlineSvg ? no + " " : "") + "Leaflet</a>"
|
|
2622
2622
|
},
|
|
2623
2623
|
initialize: function(t) {
|
|
2624
|
-
|
|
2624
|
+
A(this, t), this._attributions = {};
|
|
2625
2625
|
},
|
|
2626
2626
|
onAdd: function(t) {
|
|
2627
|
-
t.attributionControl = this, this._container =
|
|
2627
|
+
t.attributionControl = this, this._container = S("div", "leaflet-control-attribution"), Gt(this._container);
|
|
2628
2628
|
for (var e in t._layers)
|
|
2629
2629
|
t._layers[e].getAttribution && this.addAttribution(t._layers[e].getAttribution());
|
|
2630
2630
|
return this._update(), t.on("layeradd", this._addAttribution, this), this._container;
|
|
@@ -2700,7 +2700,7 @@ var $e = { exports: {} };
|
|
|
2700
2700
|
at.addTo = function(t, e) {
|
|
2701
2701
|
return t.addHandler(e, this), this;
|
|
2702
2702
|
};
|
|
2703
|
-
var so = { Events:
|
|
2703
|
+
var so = { Events: X }, Ri = w.touch ? "touchstart mousedown" : "mousedown", gt = It.extend({
|
|
2704
2704
|
options: {
|
|
2705
2705
|
// @section
|
|
2706
2706
|
// @aka Draggable options
|
|
@@ -2712,7 +2712,7 @@ var $e = { exports: {} };
|
|
|
2712
2712
|
// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
|
|
2713
2713
|
// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
|
|
2714
2714
|
initialize: function(t, e, i, n) {
|
|
2715
|
-
|
|
2715
|
+
A(this, n), this._element = t, this._dragStartTarget = e || t, this._preventOutline = i;
|
|
2716
2716
|
},
|
|
2717
2717
|
// @method enable()
|
|
2718
2718
|
// Enables the dragging ability
|
|
@@ -2722,15 +2722,15 @@ var $e = { exports: {} };
|
|
|
2722
2722
|
// @method disable()
|
|
2723
2723
|
// Disables the dragging ability
|
|
2724
2724
|
disable: function() {
|
|
2725
|
-
this._enabled && (
|
|
2725
|
+
this._enabled && (gt._dragging === this && this.finishDrag(!0), I(this._dragStartTarget, Ri, this._onDown, this), this._enabled = !1, this._moved = !1);
|
|
2726
2726
|
},
|
|
2727
2727
|
_onDown: function(t) {
|
|
2728
2728
|
if (this._enabled && (this._moved = !1, !Ce(this._element, "leaflet-zoom-anim"))) {
|
|
2729
2729
|
if (t.touches && t.touches.length !== 1) {
|
|
2730
|
-
|
|
2730
|
+
gt._dragging === this && this.finishDrag();
|
|
2731
2731
|
return;
|
|
2732
2732
|
}
|
|
2733
|
-
if (!(
|
|
2733
|
+
if (!(gt._dragging || t.shiftKey || t.which !== 1 && t.button !== 1 && !t.touches) && (gt._dragging = this, this._preventOutline && Ae(this._element), Oe(), Nt(), !this._moving)) {
|
|
2734
2734
|
this.fire("down");
|
|
2735
2735
|
var e = t.touches ? t.touches[0] : t, i = Di(this._element);
|
|
2736
2736
|
this._startPoint = new P(e.clientX, e.clientY), this._startPos = wt(this._element), this._parentScale = Ze(i);
|
|
@@ -2757,9 +2757,9 @@ var $e = { exports: {} };
|
|
|
2757
2757
|
this._enabled && this.finishDrag();
|
|
2758
2758
|
},
|
|
2759
2759
|
finishDrag: function(t) {
|
|
2760
|
-
R(document.body, "leaflet-dragging"), this._lastTarget && (R(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null),
|
|
2760
|
+
R(document.body, "leaflet-dragging"), this._lastTarget && (R(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null), I(document, "mousemove touchmove", this._onMove, this), I(document, "mouseup touchend touchcancel", this._onUp, this), ze(), Ht();
|
|
2761
2761
|
var e = this._moved && this._moving;
|
|
2762
|
-
this._moving = !1,
|
|
2762
|
+
this._moving = !1, gt._dragging = !1, e && this.fire("dragend", {
|
|
2763
2763
|
noInertia: t,
|
|
2764
2764
|
distance: this._newPos.distanceTo(this._startPos)
|
|
2765
2765
|
});
|
|
@@ -2780,17 +2780,17 @@ var $e = { exports: {} };
|
|
|
2780
2780
|
var i, n, s, a, l, u, c, _, v;
|
|
2781
2781
|
if (!t || t.length === 0)
|
|
2782
2782
|
throw new Error("latlngs not passed");
|
|
2783
|
-
|
|
2784
|
-
var b = E([0, 0]), k = N(t),
|
|
2785
|
-
|
|
2786
|
-
var G = t.length,
|
|
2783
|
+
tt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
|
|
2784
|
+
var b = E([0, 0]), k = N(t), V = k.getNorthWest().distanceTo(k.getSouthWest()) * k.getNorthEast().distanceTo(k.getNorthWest());
|
|
2785
|
+
V < 1700 && (b = We(t));
|
|
2786
|
+
var G = t.length, et = [];
|
|
2787
2787
|
for (i = 0; i < G; i++) {
|
|
2788
|
-
var
|
|
2789
|
-
|
|
2788
|
+
var K = E(t[i]);
|
|
2789
|
+
et.push(e.project(E([K.lat - b.lat, K.lng - b.lng])));
|
|
2790
2790
|
}
|
|
2791
2791
|
for (u = c = _ = 0, i = 0, n = G - 1; i < G; n = i++)
|
|
2792
|
-
s =
|
|
2793
|
-
u === 0 ? v =
|
|
2792
|
+
s = et[i], a = et[n], l = s.y * a.x - a.y * s.x, c += (s.x + a.x) * l, _ += (s.y + a.y) * l, u += l * 3;
|
|
2793
|
+
u === 0 ? v = et[0] : v = [c / u, _ / u];
|
|
2794
2794
|
var zt = e.unproject(x(v));
|
|
2795
2795
|
return E([zt.lat + b.lat, zt.lng + b.lng]);
|
|
2796
2796
|
}
|
|
@@ -2865,30 +2865,30 @@ var $e = { exports: {} };
|
|
|
2865
2865
|
var s = e.x, a = e.y, l = i.x - s, u = i.y - a, c = l * l + u * u, _;
|
|
2866
2866
|
return c > 0 && (_ = ((t.x - s) * l + (t.y - a) * u) / c, _ > 1 ? (s = i.x, a = i.y) : _ > 0 && (s += l * _, a += u * _)), l = t.x - s, u = t.y - a, n ? l * l + u * u : new P(s, a);
|
|
2867
2867
|
}
|
|
2868
|
-
function
|
|
2868
|
+
function tt(t) {
|
|
2869
2869
|
return !it(t[0]) || typeof t[0][0] != "object" && typeof t[0][0] < "u";
|
|
2870
2870
|
}
|
|
2871
2871
|
function Vi(t) {
|
|
2872
|
-
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),
|
|
2872
|
+
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), tt(t);
|
|
2873
2873
|
}
|
|
2874
2874
|
function qi(t, e) {
|
|
2875
2875
|
var i, n, s, a, l, u, c, _;
|
|
2876
2876
|
if (!t || t.length === 0)
|
|
2877
2877
|
throw new Error("latlngs not passed");
|
|
2878
|
-
|
|
2878
|
+
tt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
|
|
2879
2879
|
var v = E([0, 0]), b = N(t), k = b.getNorthWest().distanceTo(b.getSouthWest()) * b.getNorthEast().distanceTo(b.getNorthWest());
|
|
2880
2880
|
k < 1700 && (v = We(t));
|
|
2881
|
-
var
|
|
2882
|
-
for (i = 0; i <
|
|
2883
|
-
var
|
|
2884
|
-
G.push(e.project(E([
|
|
2881
|
+
var V = t.length, G = [];
|
|
2882
|
+
for (i = 0; i < V; i++) {
|
|
2883
|
+
var et = E(t[i]);
|
|
2884
|
+
G.push(e.project(E([et.lat - v.lat, et.lng - v.lng])));
|
|
2885
2885
|
}
|
|
2886
|
-
for (i = 0, n = 0; i <
|
|
2886
|
+
for (i = 0, n = 0; i < V - 1; i++)
|
|
2887
2887
|
n += G[i].distanceTo(G[i + 1]) / 2;
|
|
2888
2888
|
if (n === 0)
|
|
2889
2889
|
_ = G[0];
|
|
2890
2890
|
else
|
|
2891
|
-
for (i = 0, a = 0; i <
|
|
2891
|
+
for (i = 0, a = 0; i < V - 1; i++)
|
|
2892
2892
|
if (l = G[i], u = G[i + 1], s = l.distanceTo(u), a += s, a > n) {
|
|
2893
2893
|
c = (a - n) / s, _ = [
|
|
2894
2894
|
u.x - c * (u.x - l.x),
|
|
@@ -2896,8 +2896,8 @@ var $e = { exports: {} };
|
|
|
2896
2896
|
];
|
|
2897
2897
|
break;
|
|
2898
2898
|
}
|
|
2899
|
-
var
|
|
2900
|
-
return E([
|
|
2899
|
+
var K = e.unproject(x(_));
|
|
2900
|
+
return E([K.lat + v.lat, K.lng + v.lng]);
|
|
2901
2901
|
}
|
|
2902
2902
|
var co = {
|
|
2903
2903
|
__proto__: null,
|
|
@@ -2908,7 +2908,7 @@ var $e = { exports: {} };
|
|
|
2908
2908
|
_getEdgeIntersection: ne,
|
|
2909
2909
|
_getBitCode: Pt,
|
|
2910
2910
|
_sqClosestPointOnSegment: Wt,
|
|
2911
|
-
isFlat:
|
|
2911
|
+
isFlat: tt,
|
|
2912
2912
|
_flat: Vi,
|
|
2913
2913
|
polylineCenter: qi
|
|
2914
2914
|
}, qe = {
|
|
@@ -2916,13 +2916,13 @@ var $e = { exports: {} };
|
|
|
2916
2916
|
return new P(t.lng, t.lat);
|
|
2917
2917
|
},
|
|
2918
2918
|
unproject: function(t) {
|
|
2919
|
-
return new
|
|
2919
|
+
return new z(t.y, t.x);
|
|
2920
2920
|
},
|
|
2921
|
-
bounds: new
|
|
2921
|
+
bounds: new Z([-180, -90], [180, 90])
|
|
2922
2922
|
}, Ye = {
|
|
2923
2923
|
R: 6378137,
|
|
2924
2924
|
R_MINOR: 6356752314245179e-9,
|
|
2925
|
-
bounds: new
|
|
2925
|
+
bounds: new Z([-2003750834279e-5, -1549657073972e-5], [2003750834279e-5, 1876465623138e-5]),
|
|
2926
2926
|
project: function(t) {
|
|
2927
2927
|
var e = Math.PI / 180, i = this.R, n = t.lat * e, s = this.R_MINOR / i, a = Math.sqrt(1 - s * s), l = a * Math.sin(n), u = Math.tan(Math.PI / 4 - n / 2) / Math.pow((1 - l) / (1 + l), a / 2);
|
|
2928
2928
|
return n = -i * Math.log(Math.max(u, 1e-10)), new P(t.lng * e * i, n);
|
|
@@ -2930,21 +2930,21 @@ var $e = { exports: {} };
|
|
|
2930
2930
|
unproject: function(t) {
|
|
2931
2931
|
for (var e = 180 / Math.PI, i = this.R, n = this.R_MINOR / i, s = Math.sqrt(1 - n * n), a = Math.exp(-t.y / i), l = Math.PI / 2 - 2 * Math.atan(a), u = 0, c = 0.1, _; u < 15 && Math.abs(c) > 1e-7; u++)
|
|
2932
2932
|
_ = s * Math.sin(l), _ = Math.pow((1 - _) / (1 + _), s / 2), c = Math.PI / 2 - 2 * Math.atan(a * _) - l, l += c;
|
|
2933
|
-
return new
|
|
2933
|
+
return new z(l * e, t.x * e / i);
|
|
2934
2934
|
}
|
|
2935
2935
|
}, _o = {
|
|
2936
2936
|
__proto__: null,
|
|
2937
2937
|
LonLat: qe,
|
|
2938
2938
|
Mercator: Ye,
|
|
2939
2939
|
SphericalMercator: ye
|
|
2940
|
-
}, fo = o({},
|
|
2940
|
+
}, fo = o({}, mt, {
|
|
2941
2941
|
code: "EPSG:3395",
|
|
2942
2942
|
projection: Ye,
|
|
2943
2943
|
transformation: function() {
|
|
2944
2944
|
var t = 0.5 / (Math.PI * Ye.R);
|
|
2945
2945
|
return At(t, 0.5, -t, 0.5);
|
|
2946
2946
|
}()
|
|
2947
|
-
}), Yi = o({},
|
|
2947
|
+
}), Yi = o({}, mt, {
|
|
2948
2948
|
code: "EPSG:4326",
|
|
2949
2949
|
projection: qe,
|
|
2950
2950
|
transformation: At(1 / 180, 1, -1 / 180, 0.5)
|
|
@@ -2963,7 +2963,7 @@ var $e = { exports: {} };
|
|
|
2963
2963
|
},
|
|
2964
2964
|
infinite: !0
|
|
2965
2965
|
});
|
|
2966
|
-
ut.Earth =
|
|
2966
|
+
ut.Earth = mt, ut.EPSG3395 = fo, ut.EPSG3857 = we, ut.EPSG900913 = Ln, ut.EPSG4326 = Yi, ut.Simple = po;
|
|
2967
2967
|
var ot = It.extend({
|
|
2968
2968
|
// Classes extending `L.Layer` will inherit the following options:
|
|
2969
2969
|
options: {
|
|
@@ -3004,10 +3004,10 @@ var $e = { exports: {} };
|
|
|
3004
3004
|
return this._map.getPane(t ? this.options[t] || t : this.options.pane);
|
|
3005
3005
|
},
|
|
3006
3006
|
addInteractiveTarget: function(t) {
|
|
3007
|
-
return this._map._targets[
|
|
3007
|
+
return this._map._targets[p(t)] = this, this;
|
|
3008
3008
|
},
|
|
3009
3009
|
removeInteractiveTarget: function(t) {
|
|
3010
|
-
return delete this._map._targets[
|
|
3010
|
+
return delete this._map._targets[p(t)], this;
|
|
3011
3011
|
},
|
|
3012
3012
|
// @method getAttribution: String
|
|
3013
3013
|
// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).
|
|
@@ -3033,19 +3033,19 @@ var $e = { exports: {} };
|
|
|
3033
3033
|
addLayer: function(t) {
|
|
3034
3034
|
if (!t._layerAdd)
|
|
3035
3035
|
throw new Error("The provided object is not a Layer.");
|
|
3036
|
-
var e =
|
|
3036
|
+
var e = p(t);
|
|
3037
3037
|
return this._layers[e] ? this : (this._layers[e] = t, t._mapToAdd = this, t.beforeAdd && t.beforeAdd(this), this.whenReady(t._layerAdd, t), this);
|
|
3038
3038
|
},
|
|
3039
3039
|
// @method removeLayer(layer: Layer): this
|
|
3040
3040
|
// Removes the given layer from the map.
|
|
3041
3041
|
removeLayer: function(t) {
|
|
3042
|
-
var e =
|
|
3042
|
+
var e = p(t);
|
|
3043
3043
|
return this._layers[e] ? (this._loaded && t.onRemove(this), delete this._layers[e], this._loaded && (this.fire("layerremove", { layer: t }), t.fire("remove")), t._map = t._mapToAdd = null, this) : this;
|
|
3044
3044
|
},
|
|
3045
3045
|
// @method hasLayer(layer: Layer): Boolean
|
|
3046
3046
|
// Returns `true` if the given layer is currently added to the map
|
|
3047
3047
|
hasLayer: function(t) {
|
|
3048
|
-
return
|
|
3048
|
+
return p(t) in this._layers;
|
|
3049
3049
|
},
|
|
3050
3050
|
/* @method eachLayer(fn: Function, context?: Object): this
|
|
3051
3051
|
* Iterates over the layers of the map, optionally specifying context of the iterator function.
|
|
@@ -3066,10 +3066,10 @@ var $e = { exports: {} };
|
|
|
3066
3066
|
this.addLayer(t[e]);
|
|
3067
3067
|
},
|
|
3068
3068
|
_addZoomLimit: function(t) {
|
|
3069
|
-
(!isNaN(t.options.maxZoom) || !isNaN(t.options.minZoom)) && (this._zoomBoundLayers[
|
|
3069
|
+
(!isNaN(t.options.maxZoom) || !isNaN(t.options.minZoom)) && (this._zoomBoundLayers[p(t)] = t, this._updateZoomLevels());
|
|
3070
3070
|
},
|
|
3071
3071
|
_removeZoomLimit: function(t) {
|
|
3072
|
-
var e =
|
|
3072
|
+
var e = p(t);
|
|
3073
3073
|
this._zoomBoundLayers[e] && (delete this._zoomBoundLayers[e], this._updateZoomLevels());
|
|
3074
3074
|
},
|
|
3075
3075
|
_updateZoomLevels: function() {
|
|
@@ -3083,7 +3083,7 @@ var $e = { exports: {} };
|
|
|
3083
3083
|
});
|
|
3084
3084
|
var Et = ot.extend({
|
|
3085
3085
|
initialize: function(t, e) {
|
|
3086
|
-
|
|
3086
|
+
A(this, e), this._layers = {};
|
|
3087
3087
|
var i, n;
|
|
3088
3088
|
if (t)
|
|
3089
3089
|
for (i = 0, n = t.length; i < n; i++)
|
|
@@ -3165,7 +3165,7 @@ var $e = { exports: {} };
|
|
|
3165
3165
|
// @method getLayerId(layer: Layer): Number
|
|
3166
3166
|
// Returns the internal ID for a layer
|
|
3167
3167
|
getLayerId: function(t) {
|
|
3168
|
-
return
|
|
3168
|
+
return p(t);
|
|
3169
3169
|
}
|
|
3170
3170
|
}), mo = function(t, e) {
|
|
3171
3171
|
return new Et(t, e);
|
|
@@ -3194,7 +3194,7 @@ var $e = { exports: {} };
|
|
|
3194
3194
|
// @method getBounds(): LatLngBounds
|
|
3195
3195
|
// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
|
|
3196
3196
|
getBounds: function() {
|
|
3197
|
-
var t = new
|
|
3197
|
+
var t = new j();
|
|
3198
3198
|
for (var e in this._layers) {
|
|
3199
3199
|
var i = this._layers[e];
|
|
3200
3200
|
t.extend(i.getBounds ? i.getBounds() : i.getLatLng());
|
|
@@ -3253,7 +3253,7 @@ var $e = { exports: {} };
|
|
|
3253
3253
|
crossOrigin: !1
|
|
3254
3254
|
},
|
|
3255
3255
|
initialize: function(t) {
|
|
3256
|
-
|
|
3256
|
+
A(this, t);
|
|
3257
3257
|
},
|
|
3258
3258
|
// @method createIcon(oldIcon?: HTMLElement): HTMLElement
|
|
3259
3259
|
// Called internally when the icon has to be shown, returns a `<img>` HTML element
|
|
@@ -3314,7 +3314,7 @@ var $e = { exports: {} };
|
|
|
3314
3314
|
return t = e(t, /^url\((['"])?(.+)\1\)$/, 2), t && e(t, /^(.*)marker-icon\.png$/, 1);
|
|
3315
3315
|
},
|
|
3316
3316
|
_detectIconPath: function() {
|
|
3317
|
-
var t =
|
|
3317
|
+
var t = S("div", "leaflet-default-icon-path", document.body), e = Rt(t, "background-image") || Rt(t, "backgroundImage");
|
|
3318
3318
|
if (document.body.removeChild(t), e = this._stripUrl(e), e)
|
|
3319
3319
|
return e;
|
|
3320
3320
|
var i = document.querySelector('link[href$="leaflet.css"]');
|
|
@@ -3326,7 +3326,7 @@ var $e = { exports: {} };
|
|
|
3326
3326
|
},
|
|
3327
3327
|
addHooks: function() {
|
|
3328
3328
|
var t = this._marker._icon;
|
|
3329
|
-
this._draggable || (this._draggable = new
|
|
3329
|
+
this._draggable || (this._draggable = new gt(t, t, !0)), this._draggable.on({
|
|
3330
3330
|
dragstart: this._onDragStart,
|
|
3331
3331
|
predrag: this._onPreDrag,
|
|
3332
3332
|
drag: this._onDrag,
|
|
@@ -3345,7 +3345,7 @@ var $e = { exports: {} };
|
|
|
3345
3345
|
return this._draggable && this._draggable._moved;
|
|
3346
3346
|
},
|
|
3347
3347
|
_adjustPan: function(t) {
|
|
3348
|
-
var e = this._marker, i = e._map, n = this._marker.options.autoPanSpeed, s = this._marker.options.autoPanPadding, a = wt(e._icon), l = i.getPixelBounds(), u = i.getPixelOrigin(), c =
|
|
3348
|
+
var e = this._marker, i = e._map, n = this._marker.options.autoPanSpeed, s = this._marker.options.autoPanPadding, a = wt(e._icon), l = i.getPixelBounds(), u = i.getPixelOrigin(), c = Y(
|
|
3349
3349
|
l.min._subtract(u).add(s),
|
|
3350
3350
|
l.max._subtract(u).subtract(s)
|
|
3351
3351
|
);
|
|
@@ -3354,21 +3354,21 @@ var $e = { exports: {} };
|
|
|
3354
3354
|
(Math.max(c.max.x, a.x) - c.max.x) / (l.max.x - c.max.x) - (Math.min(c.min.x, a.x) - c.min.x) / (l.min.x - c.min.x),
|
|
3355
3355
|
(Math.max(c.max.y, a.y) - c.max.y) / (l.max.y - c.max.y) - (Math.min(c.min.y, a.y) - c.min.y) / (l.min.y - c.min.y)
|
|
3356
3356
|
).multiplyBy(n);
|
|
3357
|
-
i.panBy(_, { animate: !1 }), this._draggable._newPos._add(_), this._draggable._startPos._add(_), H(e._icon, this._draggable._newPos), this._onDrag(t), this._panRequest =
|
|
3357
|
+
i.panBy(_, { animate: !1 }), this._draggable._newPos._add(_), this._draggable._startPos._add(_), H(e._icon, this._draggable._newPos), this._onDrag(t), this._panRequest = q(this._adjustPan.bind(this, t));
|
|
3358
3358
|
}
|
|
3359
3359
|
},
|
|
3360
3360
|
_onDragStart: function() {
|
|
3361
3361
|
this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup && this._marker.closePopup(), this._marker.fire("movestart").fire("dragstart");
|
|
3362
3362
|
},
|
|
3363
3363
|
_onPreDrag: function(t) {
|
|
3364
|
-
this._marker.options.autoPan && (
|
|
3364
|
+
this._marker.options.autoPan && (Q(this._panRequest), this._panRequest = q(this._adjustPan.bind(this, t)));
|
|
3365
3365
|
},
|
|
3366
3366
|
_onDrag: function(t) {
|
|
3367
3367
|
var e = this._marker, i = e._shadow, n = wt(e._icon), s = e._map.layerPointToLatLng(n);
|
|
3368
3368
|
i && H(i, n), e._latlng = s, t.latlng = s, t.oldLatLng = this._oldLatLng, e.fire("move", t).fire("drag", t);
|
|
3369
3369
|
},
|
|
3370
3370
|
_onDragEnd: function(t) {
|
|
3371
|
-
|
|
3371
|
+
Q(this._panRequest), delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", t);
|
|
3372
3372
|
}
|
|
3373
3373
|
}), oe = ot.extend({
|
|
3374
3374
|
// @section
|
|
@@ -3439,7 +3439,7 @@ var $e = { exports: {} };
|
|
|
3439
3439
|
* In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
|
|
3440
3440
|
*/
|
|
3441
3441
|
initialize: function(t, e) {
|
|
3442
|
-
|
|
3442
|
+
A(this, e), this._latlng = E(t);
|
|
3443
3443
|
},
|
|
3444
3444
|
onAdd: function(t) {
|
|
3445
3445
|
this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update();
|
|
@@ -3502,10 +3502,10 @@ var $e = { exports: {} };
|
|
|
3502
3502
|
this.options.riseOnHover && this.off({
|
|
3503
3503
|
mouseover: this._bringToFront,
|
|
3504
3504
|
mouseout: this._resetZIndex
|
|
3505
|
-
}), this.options.autoPanOnFocus &&
|
|
3505
|
+
}), this.options.autoPanOnFocus && I(this._icon, "focus", this._panOnFocus, this), B(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null;
|
|
3506
3506
|
},
|
|
3507
3507
|
_removeShadow: function() {
|
|
3508
|
-
this._shadow &&
|
|
3508
|
+
this._shadow && B(this._shadow), this._shadow = null;
|
|
3509
3509
|
},
|
|
3510
3510
|
_setPos: function(t) {
|
|
3511
3511
|
this._icon && H(this._icon, t), this._shadow && H(this._shadow, t), this._zIndex = t.y + this.options.zIndexOffset, this._resetZIndex();
|
|
@@ -3530,7 +3530,7 @@ var $e = { exports: {} };
|
|
|
3530
3530
|
},
|
|
3531
3531
|
_updateOpacity: function() {
|
|
3532
3532
|
var t = this.options.opacity;
|
|
3533
|
-
this._icon &&
|
|
3533
|
+
this._icon && $(this._icon, t), this._shadow && $(this._shadow, t);
|
|
3534
3534
|
},
|
|
3535
3535
|
_bringToFront: function() {
|
|
3536
3536
|
this._updateZIndex(this.options.riseOffset);
|
|
@@ -3558,7 +3558,7 @@ var $e = { exports: {} };
|
|
|
3558
3558
|
function yo(t, e) {
|
|
3559
3559
|
return new oe(t, e);
|
|
3560
3560
|
}
|
|
3561
|
-
var
|
|
3561
|
+
var vt = ot.extend({
|
|
3562
3562
|
// @section
|
|
3563
3563
|
// @aka Path options
|
|
3564
3564
|
options: {
|
|
@@ -3623,7 +3623,7 @@ var $e = { exports: {} };
|
|
|
3623
3623
|
// @method setStyle(style: Path options): this
|
|
3624
3624
|
// Changes the appearance of a Path based on the options in the `Path options` object.
|
|
3625
3625
|
setStyle: function(t) {
|
|
3626
|
-
return
|
|
3626
|
+
return A(this, t), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && t && Object.prototype.hasOwnProperty.call(t, "weight") && this._updateBounds()), this;
|
|
3627
3627
|
},
|
|
3628
3628
|
// @method bringToFront(): this
|
|
3629
3629
|
// Brings the layer to the top of all path layers.
|
|
@@ -3644,7 +3644,7 @@ var $e = { exports: {} };
|
|
|
3644
3644
|
_clickTolerance: function() {
|
|
3645
3645
|
return (this.options.stroke ? this.options.weight / 2 : 0) + (this._renderer.options.tolerance || 0);
|
|
3646
3646
|
}
|
|
3647
|
-
}), se =
|
|
3647
|
+
}), se = vt.extend({
|
|
3648
3648
|
// @section
|
|
3649
3649
|
// @aka CircleMarker options
|
|
3650
3650
|
options: {
|
|
@@ -3654,7 +3654,7 @@ var $e = { exports: {} };
|
|
|
3654
3654
|
radius: 10
|
|
3655
3655
|
},
|
|
3656
3656
|
initialize: function(t, e) {
|
|
3657
|
-
|
|
3657
|
+
A(this, e), this._latlng = E(t), this._radius = this.options.radius;
|
|
3658
3658
|
},
|
|
3659
3659
|
// @method setLatLng(latLng: LatLng): this
|
|
3660
3660
|
// Sets the position of a circle marker to a new location.
|
|
@@ -3679,14 +3679,14 @@ var $e = { exports: {} };
|
|
|
3679
3679
|
},
|
|
3680
3680
|
setStyle: function(t) {
|
|
3681
3681
|
var e = t && t.radius || this._radius;
|
|
3682
|
-
return
|
|
3682
|
+
return vt.prototype.setStyle.call(this, t), this.setRadius(e), this;
|
|
3683
3683
|
},
|
|
3684
3684
|
_project: function() {
|
|
3685
3685
|
this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds();
|
|
3686
3686
|
},
|
|
3687
3687
|
_updateBounds: function() {
|
|
3688
3688
|
var t = this._radius, e = this._radiusY || t, i = this._clickTolerance(), n = [t + i, e + i];
|
|
3689
|
-
this._pxBounds = new
|
|
3689
|
+
this._pxBounds = new Z(this._point.subtract(n), this._point.add(n));
|
|
3690
3690
|
},
|
|
3691
3691
|
_update: function() {
|
|
3692
3692
|
this._map && this._updatePath();
|
|
@@ -3707,7 +3707,7 @@ var $e = { exports: {} };
|
|
|
3707
3707
|
}
|
|
3708
3708
|
var je = se.extend({
|
|
3709
3709
|
initialize: function(t, e, i) {
|
|
3710
|
-
if (typeof e == "number" && (e = o({}, i, { radius: e })),
|
|
3710
|
+
if (typeof e == "number" && (e = o({}, i, { radius: e })), A(this, e), this._latlng = E(t), isNaN(this.options.radius))
|
|
3711
3711
|
throw new Error("Circle radius cannot be NaN");
|
|
3712
3712
|
this._mRadius = this.options.radius;
|
|
3713
3713
|
},
|
|
@@ -3725,16 +3725,16 @@ var $e = { exports: {} };
|
|
|
3725
3725
|
// Returns the `LatLngBounds` of the path.
|
|
3726
3726
|
getBounds: function() {
|
|
3727
3727
|
var t = [this._radius, this._radiusY || this._radius];
|
|
3728
|
-
return new
|
|
3728
|
+
return new j(
|
|
3729
3729
|
this._map.layerPointToLatLng(this._point.subtract(t)),
|
|
3730
3730
|
this._map.layerPointToLatLng(this._point.add(t))
|
|
3731
3731
|
);
|
|
3732
3732
|
},
|
|
3733
|
-
setStyle:
|
|
3733
|
+
setStyle: vt.prototype.setStyle,
|
|
3734
3734
|
_project: function() {
|
|
3735
3735
|
var t = this._latlng.lng, e = this._latlng.lat, i = this._map, n = i.options.crs;
|
|
3736
|
-
if (n.distance ===
|
|
3737
|
-
var s = Math.PI / 180, a = this._mRadius /
|
|
3736
|
+
if (n.distance === mt.distance) {
|
|
3737
|
+
var s = Math.PI / 180, a = this._mRadius / mt.R / s, l = i.project([e + a, t]), u = i.project([e - a, t]), c = l.add(u).divideBy(2), _ = i.unproject(c).lat, v = Math.acos((Math.cos(a * s) - Math.sin(e * s) * Math.sin(_ * s)) / (Math.cos(e * s) * Math.cos(_ * s))) / s;
|
|
3738
3738
|
(isNaN(v) || v === 0) && (v = a / Math.cos(Math.PI / 180 * e)), this._point = c.subtract(i.getPixelOrigin()), this._radius = isNaN(v) ? 0 : c.x - i.project([_, t - v]).x, this._radiusY = c.y - l.y;
|
|
3739
3739
|
} else {
|
|
3740
3740
|
var b = n.unproject(n.project(this._latlng).subtract([this._mRadius, 0]));
|
|
@@ -3746,7 +3746,7 @@ var $e = { exports: {} };
|
|
|
3746
3746
|
function wo(t, e, i) {
|
|
3747
3747
|
return new je(t, e, i);
|
|
3748
3748
|
}
|
|
3749
|
-
var dt =
|
|
3749
|
+
var dt = vt.extend({
|
|
3750
3750
|
// @section
|
|
3751
3751
|
// @aka Polyline options
|
|
3752
3752
|
options: {
|
|
@@ -3759,7 +3759,7 @@ var $e = { exports: {} };
|
|
|
3759
3759
|
noClip: !1
|
|
3760
3760
|
},
|
|
3761
3761
|
initialize: function(t, e) {
|
|
3762
|
-
|
|
3762
|
+
A(this, e), this._setLatLngs(t);
|
|
3763
3763
|
},
|
|
3764
3764
|
// @method getLatLngs(): LatLng[]
|
|
3765
3765
|
// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
|
|
@@ -3807,31 +3807,31 @@ var $e = { exports: {} };
|
|
|
3807
3807
|
return e = e || this._defaultShape(), t = E(t), e.push(t), this._bounds.extend(t), this.redraw();
|
|
3808
3808
|
},
|
|
3809
3809
|
_setLatLngs: function(t) {
|
|
3810
|
-
this._bounds = new
|
|
3810
|
+
this._bounds = new j(), this._latlngs = this._convertLatLngs(t);
|
|
3811
3811
|
},
|
|
3812
3812
|
_defaultShape: function() {
|
|
3813
|
-
return
|
|
3813
|
+
return tt(this._latlngs) ? this._latlngs : this._latlngs[0];
|
|
3814
3814
|
},
|
|
3815
3815
|
// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
|
|
3816
3816
|
_convertLatLngs: function(t) {
|
|
3817
|
-
for (var e = [], i =
|
|
3817
|
+
for (var e = [], i = tt(t), n = 0, s = t.length; n < s; n++)
|
|
3818
3818
|
i ? (e[n] = E(t[n]), this._bounds.extend(e[n])) : e[n] = this._convertLatLngs(t[n]);
|
|
3819
3819
|
return e;
|
|
3820
3820
|
},
|
|
3821
3821
|
_project: function() {
|
|
3822
|
-
var t = new
|
|
3822
|
+
var t = new Z();
|
|
3823
3823
|
this._rings = [], this._projectLatlngs(this._latlngs, this._rings, t), this._bounds.isValid() && t.isValid() && (this._rawPxBounds = t, this._updateBounds());
|
|
3824
3824
|
},
|
|
3825
3825
|
_updateBounds: function() {
|
|
3826
3826
|
var t = this._clickTolerance(), e = new P(t, t);
|
|
3827
|
-
this._rawPxBounds && (this._pxBounds = new
|
|
3827
|
+
this._rawPxBounds && (this._pxBounds = new Z([
|
|
3828
3828
|
this._rawPxBounds.min.subtract(e),
|
|
3829
3829
|
this._rawPxBounds.max.add(e)
|
|
3830
3830
|
]));
|
|
3831
3831
|
},
|
|
3832
3832
|
// recursively turns latlngs into a set of rings with projected coordinates
|
|
3833
3833
|
_projectLatlngs: function(t, e, i) {
|
|
3834
|
-
var n = t[0] instanceof
|
|
3834
|
+
var n = t[0] instanceof z, s = t.length, a, l;
|
|
3835
3835
|
if (n) {
|
|
3836
3836
|
for (l = [], a = 0; a < s; a++)
|
|
3837
3837
|
l[a] = this._map.latLngToLayerPoint(t[a]), i.extend(l[a]);
|
|
@@ -3897,17 +3897,17 @@ var $e = { exports: {} };
|
|
|
3897
3897
|
},
|
|
3898
3898
|
_convertLatLngs: function(t) {
|
|
3899
3899
|
var e = dt.prototype._convertLatLngs.call(this, t), i = e.length;
|
|
3900
|
-
return i >= 2 && e[0] instanceof
|
|
3900
|
+
return i >= 2 && e[0] instanceof z && e[0].equals(e[i - 1]) && e.pop(), e;
|
|
3901
3901
|
},
|
|
3902
3902
|
_setLatLngs: function(t) {
|
|
3903
|
-
dt.prototype._setLatLngs.call(this, t),
|
|
3903
|
+
dt.prototype._setLatLngs.call(this, t), tt(this._latlngs) && (this._latlngs = [this._latlngs]);
|
|
3904
3904
|
},
|
|
3905
3905
|
_defaultShape: function() {
|
|
3906
|
-
return
|
|
3906
|
+
return tt(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
|
|
3907
3907
|
},
|
|
3908
3908
|
_clipPoints: function() {
|
|
3909
3909
|
var t = this._renderer._bounds, e = this.options.weight, i = new P(e, e);
|
|
3910
|
-
if (t = new
|
|
3910
|
+
if (t = new Z(t.min.subtract(i), t.max.add(i)), this._parts = [], !(!this._pxBounds || !this._pxBounds.intersects(t))) {
|
|
3911
3911
|
if (this.options.noClip) {
|
|
3912
3912
|
this._parts = this._rings;
|
|
3913
3913
|
return;
|
|
@@ -3984,7 +3984,7 @@ var $e = { exports: {} };
|
|
|
3984
3984
|
* Whether default Markers for "Point" type Features inherit from group options.
|
|
3985
3985
|
*/
|
|
3986
3986
|
initialize: function(t, e) {
|
|
3987
|
-
|
|
3987
|
+
A(this, e), this._layers = {}, t && this.addData(t);
|
|
3988
3988
|
},
|
|
3989
3989
|
// @method addData( <GeoJSON> data ): this
|
|
3990
3990
|
// Adds a GeoJSON object to the layer.
|
|
@@ -4059,7 +4059,7 @@ var $e = { exports: {} };
|
|
|
4059
4059
|
return t ? t(e, i) : new oe(i, n && n.markersInheritOptions && n);
|
|
4060
4060
|
}
|
|
4061
4061
|
function Ke(t) {
|
|
4062
|
-
return new
|
|
4062
|
+
return new z(t[1], t[0], t[2]);
|
|
4063
4063
|
}
|
|
4064
4064
|
function ae(t, e, i) {
|
|
4065
4065
|
for (var n = [], s = 0, a = t.length, l; s < a; s++)
|
|
@@ -4067,11 +4067,11 @@ var $e = { exports: {} };
|
|
|
4067
4067
|
return n;
|
|
4068
4068
|
}
|
|
4069
4069
|
function Xe(t, e) {
|
|
4070
|
-
return t = E(t), t.alt !== void 0 ? [
|
|
4070
|
+
return t = E(t), t.alt !== void 0 ? [O(t.lng, e), O(t.lat, e), O(t.alt, e)] : [O(t.lng, e), O(t.lat, e)];
|
|
4071
4071
|
}
|
|
4072
4072
|
function he(t, e, i, n) {
|
|
4073
4073
|
for (var s = [], a = 0, l = t.length; a < l; a++)
|
|
4074
|
-
s.push(e ? he(t[a],
|
|
4074
|
+
s.push(e ? he(t[a], tt(t[a]) ? 0 : e - 1, i, n) : Xe(t[a], n));
|
|
4075
4075
|
return !e && i && s.length > 0 && s.push(s[0].slice()), s;
|
|
4076
4076
|
}
|
|
4077
4077
|
function St(t, e) {
|
|
@@ -4094,7 +4094,7 @@ var $e = { exports: {} };
|
|
|
4094
4094
|
};
|
|
4095
4095
|
oe.include(Je), je.include(Je), se.include(Je), dt.include({
|
|
4096
4096
|
toGeoJSON: function(t) {
|
|
4097
|
-
var e =
|
|
4097
|
+
var e = !tt(this._latlngs), i = he(this._latlngs, e ? 1 : 0, !1, t);
|
|
4098
4098
|
return St(this, {
|
|
4099
4099
|
type: (e ? "Multi" : "") + "LineString",
|
|
4100
4100
|
coordinates: i
|
|
@@ -4102,7 +4102,7 @@ var $e = { exports: {} };
|
|
|
4102
4102
|
}
|
|
4103
4103
|
}), Dt.include({
|
|
4104
4104
|
toGeoJSON: function(t) {
|
|
4105
|
-
var e =
|
|
4105
|
+
var e = !tt(this._latlngs), i = e && !tt(this._latlngs[0]), n = he(this._latlngs, i ? 2 : e ? 1 : 0, !0, t);
|
|
4106
4106
|
return e || (n = [n]), St(this, {
|
|
4107
4107
|
type: (i ? "Multi" : "") + "Polygon",
|
|
4108
4108
|
coordinates: n
|
|
@@ -4177,13 +4177,13 @@ var $e = { exports: {} };
|
|
|
4177
4177
|
className: ""
|
|
4178
4178
|
},
|
|
4179
4179
|
initialize: function(t, e, i) {
|
|
4180
|
-
this._url = t, this._bounds = N(e),
|
|
4180
|
+
this._url = t, this._bounds = N(e), A(this, i);
|
|
4181
4181
|
},
|
|
4182
4182
|
onAdd: function() {
|
|
4183
4183
|
this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (M(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset();
|
|
4184
4184
|
},
|
|
4185
4185
|
onRemove: function() {
|
|
4186
|
-
|
|
4186
|
+
B(this._image), this.options.interactive && this.removeInteractiveTarget(this._image);
|
|
4187
4187
|
},
|
|
4188
4188
|
// @method setOpacity(opacity: Number): this
|
|
4189
4189
|
// Sets the opacity of the overlay.
|
|
@@ -4237,7 +4237,7 @@ var $e = { exports: {} };
|
|
|
4237
4237
|
return this._image;
|
|
4238
4238
|
},
|
|
4239
4239
|
_initImage: function() {
|
|
4240
|
-
var t = this._url.tagName === "IMG", e = this._image = t ? this._url :
|
|
4240
|
+
var t = this._url.tagName === "IMG", e = this._image = t ? this._url : S("img");
|
|
4241
4241
|
if (M(e, "leaflet-image-layer"), this._zoomAnimated && M(e, "leaflet-zoom-animated"), this.options.className && M(e, this.options.className), e.onselectstart = y, e.onmousemove = y, e.onload = h(this.fire, this, "load"), e.onerror = h(this._overlayOnError, this, "error"), (this.options.crossOrigin || this.options.crossOrigin === "") && (e.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), this.options.zIndex && this._updateZIndex(), t) {
|
|
4242
4242
|
this._url = e.src;
|
|
4243
4243
|
return;
|
|
@@ -4249,14 +4249,14 @@ var $e = { exports: {} };
|
|
|
4249
4249
|
Lt(this._image, i, e);
|
|
4250
4250
|
},
|
|
4251
4251
|
_reset: function() {
|
|
4252
|
-
var t = this._image, e = new
|
|
4252
|
+
var t = this._image, e = new Z(
|
|
4253
4253
|
this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
|
|
4254
4254
|
this._map.latLngToLayerPoint(this._bounds.getSouthEast())
|
|
4255
4255
|
), i = e.getSize();
|
|
4256
4256
|
H(t, e.min), t.style.width = i.x + "px", t.style.height = i.y + "px";
|
|
4257
4257
|
},
|
|
4258
4258
|
_updateOpacity: function() {
|
|
4259
|
-
|
|
4259
|
+
$(this._image, this.options.opacity);
|
|
4260
4260
|
},
|
|
4261
4261
|
_updateZIndex: function() {
|
|
4262
4262
|
this._image && this.options.zIndex !== void 0 && this.options.zIndex !== null && (this._image.style.zIndex = this.options.zIndex);
|
|
@@ -4296,7 +4296,7 @@ var $e = { exports: {} };
|
|
|
4296
4296
|
playsInline: !0
|
|
4297
4297
|
},
|
|
4298
4298
|
_initImage: function() {
|
|
4299
|
-
var t = this._url.tagName === "VIDEO", e = this._image = t ? this._url :
|
|
4299
|
+
var t = this._url.tagName === "VIDEO", e = this._image = t ? this._url : S("video");
|
|
4300
4300
|
if (M(e, "leaflet-image-layer"), this._zoomAnimated && M(e, "leaflet-zoom-animated"), this.options.className && M(e, this.options.className), e.onselectstart = y, e.onmousemove = y, e.onloadeddata = h(this.fire, this, "load"), t) {
|
|
4301
4301
|
for (var i = e.getElementsByTagName("source"), n = [], s = 0; s < i.length; s++)
|
|
4302
4302
|
n.push(i[s].src);
|
|
@@ -4305,7 +4305,7 @@ var $e = { exports: {} };
|
|
|
4305
4305
|
}
|
|
4306
4306
|
it(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(e.style, "objectFit") && (e.style.objectFit = "fill"), e.autoplay = !!this.options.autoplay, e.loop = !!this.options.loop, e.muted = !!this.options.muted, e.playsInline = !!this.options.playsInline;
|
|
4307
4307
|
for (var a = 0; a < this._url.length; a++) {
|
|
4308
|
-
var l =
|
|
4308
|
+
var l = S("source");
|
|
4309
4309
|
l.src = this._url[a], e.appendChild(l);
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
@@ -4350,7 +4350,7 @@ var $e = { exports: {} };
|
|
|
4350
4350
|
content: ""
|
|
4351
4351
|
},
|
|
4352
4352
|
initialize: function(t, e) {
|
|
4353
|
-
t && (t instanceof
|
|
4353
|
+
t && (t instanceof z || it(t)) ? (this._latlng = E(t), A(this, e)) : (A(this, t), this._source = e), this.options.content && (this._content = this.options.content);
|
|
4354
4354
|
},
|
|
4355
4355
|
// @method openOn(map: Map): this
|
|
4356
4356
|
// Adds the overlay to the map.
|
|
@@ -4373,10 +4373,10 @@ var $e = { exports: {} };
|
|
|
4373
4373
|
return this._map ? this.close() : (arguments.length ? this._source = t : t = this._source, this._prepareOpen(), this.openOn(t._map)), this;
|
|
4374
4374
|
},
|
|
4375
4375
|
onAdd: function(t) {
|
|
4376
|
-
this._zoomAnimated = t._zoomAnimated, this._container || this._initLayout(), t._fadeAnimated &&
|
|
4376
|
+
this._zoomAnimated = t._zoomAnimated, this._container || this._initLayout(), t._fadeAnimated && $(this._container, 0), clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), this.update(), t._fadeAnimated && $(this._container, 1), this.bringToFront(), this.options.interactive && (M(this._container, "leaflet-interactive"), this.addInteractiveTarget(this._container));
|
|
4377
4377
|
},
|
|
4378
4378
|
onRemove: function(t) {
|
|
4379
|
-
t._fadeAnimated ? (
|
|
4379
|
+
t._fadeAnimated ? ($(this._container, 0), this._removeTimeout = setTimeout(h(B, void 0, this._container), 200)) : B(this._container), this.options.interactive && (R(this._container, "leaflet-interactive"), this.removeInteractiveTarget(this._container));
|
|
4380
4380
|
},
|
|
4381
4381
|
// @namespace DivOverlay
|
|
4382
4382
|
// @method getLatLng: LatLng
|
|
@@ -4493,7 +4493,7 @@ var $e = { exports: {} };
|
|
|
4493
4493
|
}), ot.include({
|
|
4494
4494
|
_initOverlay: function(t, e, i, n) {
|
|
4495
4495
|
var s = i;
|
|
4496
|
-
return s instanceof t ? (
|
|
4496
|
+
return s instanceof t ? (A(s, n), s._source = this) : (s = e && !n ? e : new t(n, this), s.setContent(i)), s;
|
|
4497
4497
|
}
|
|
4498
4498
|
});
|
|
4499
4499
|
var ce = ht.extend({
|
|
@@ -4563,22 +4563,22 @@ var $e = { exports: {} };
|
|
|
4563
4563
|
return t = arguments.length ? t : this._source._map, !t.hasLayer(this) && t._popup && t._popup.options.autoClose && t.removeLayer(t._popup), t._popup = this, ht.prototype.openOn.call(this, t);
|
|
4564
4564
|
},
|
|
4565
4565
|
onAdd: function(t) {
|
|
4566
|
-
ht.prototype.onAdd.call(this, t), t.fire("popupopen", { popup: this }), this._source && (this._source.fire("popupopen", { popup: this }, !0), this._source instanceof
|
|
4566
|
+
ht.prototype.onAdd.call(this, t), t.fire("popupopen", { popup: this }), this._source && (this._source.fire("popupopen", { popup: this }, !0), this._source instanceof vt || this._source.on("preclick", bt));
|
|
4567
4567
|
},
|
|
4568
4568
|
onRemove: function(t) {
|
|
4569
|
-
ht.prototype.onRemove.call(this, t), t.fire("popupclose", { popup: this }), this._source && (this._source.fire("popupclose", { popup: this }, !0), this._source instanceof
|
|
4569
|
+
ht.prototype.onRemove.call(this, t), t.fire("popupclose", { popup: this }), this._source && (this._source.fire("popupclose", { popup: this }, !0), this._source instanceof vt || this._source.off("preclick", bt));
|
|
4570
4570
|
},
|
|
4571
4571
|
getEvents: function() {
|
|
4572
4572
|
var t = ht.prototype.getEvents.call(this);
|
|
4573
4573
|
return (this.options.closeOnClick !== void 0 ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this.close), this.options.keepInView && (t.moveend = this._adjustPan), t;
|
|
4574
4574
|
},
|
|
4575
4575
|
_initLayout: function() {
|
|
4576
|
-
var t = "leaflet-popup", e = this._container =
|
|
4576
|
+
var t = "leaflet-popup", e = this._container = S(
|
|
4577
4577
|
"div",
|
|
4578
4578
|
t + " " + (this.options.className || "") + " leaflet-zoom-animated"
|
|
4579
|
-
), i = this._wrapper =
|
|
4580
|
-
if (this._contentNode =
|
|
4581
|
-
var n = this._closeButton =
|
|
4579
|
+
), i = this._wrapper = S("div", t + "-content-wrapper", e);
|
|
4580
|
+
if (this._contentNode = S("div", t + "-content", i), Gt(e), He(this._contentNode), T(e, "contextmenu", bt), this._tipContainer = S("div", t + "-tip-container", e), this._tip = S("div", t + "-tip", this._tipContainer), this.options.closeButton) {
|
|
4581
|
+
var n = this._closeButton = S("a", t + "-close-button", e);
|
|
4582
4582
|
n.setAttribute("role", "button"), n.setAttribute("aria-label", "Close popup"), n.href = "#close", n.innerHTML = '<span aria-hidden="true">×</span>', T(n, "click", function(s) {
|
|
4583
4583
|
F(s), this.close();
|
|
4584
4584
|
}, this);
|
|
@@ -4687,7 +4687,7 @@ var $e = { exports: {} };
|
|
|
4687
4687
|
if (!(!this._popup || !this._map)) {
|
|
4688
4688
|
xt(t);
|
|
4689
4689
|
var e = t.layer || t.target;
|
|
4690
|
-
if (this._popup._source === e && !(e instanceof
|
|
4690
|
+
if (this._popup._source === e && !(e instanceof vt)) {
|
|
4691
4691
|
this._map.hasLayer(this._popup) ? this.closePopup() : this.openPopup(t.latlng);
|
|
4692
4692
|
return;
|
|
4693
4693
|
}
|
|
@@ -4739,7 +4739,7 @@ var $e = { exports: {} };
|
|
|
4739
4739
|
},
|
|
4740
4740
|
_initLayout: function() {
|
|
4741
4741
|
var t = "leaflet-tooltip", e = t + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
|
|
4742
|
-
this._contentNode = this._container =
|
|
4742
|
+
this._contentNode = this._container = S("div", e), this._container.setAttribute("role", "tooltip"), this._container.setAttribute("id", "leaflet-tooltip-" + p(this));
|
|
4743
4743
|
},
|
|
4744
4744
|
_updateLayout: function() {
|
|
4745
4745
|
},
|
|
@@ -4754,7 +4754,7 @@ var $e = { exports: {} };
|
|
|
4754
4754
|
this._setPosition(t);
|
|
4755
4755
|
},
|
|
4756
4756
|
setOpacity: function(t) {
|
|
4757
|
-
this.options.opacity = t, this._container &&
|
|
4757
|
+
this.options.opacity = t, this._container && $(this._container, t);
|
|
4758
4758
|
},
|
|
4759
4759
|
_animateZoom: function(t) {
|
|
4760
4760
|
var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
|
|
@@ -4959,7 +4959,7 @@ var $e = { exports: {} };
|
|
|
4959
4959
|
keepBuffer: 2
|
|
4960
4960
|
},
|
|
4961
4961
|
initialize: function(t) {
|
|
4962
|
-
|
|
4962
|
+
A(this, t);
|
|
4963
4963
|
},
|
|
4964
4964
|
onAdd: function() {
|
|
4965
4965
|
this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView();
|
|
@@ -4968,7 +4968,7 @@ var $e = { exports: {} };
|
|
|
4968
4968
|
t._addZoomLimit(this);
|
|
4969
4969
|
},
|
|
4970
4970
|
onRemove: function(t) {
|
|
4971
|
-
this._removeAllTiles(),
|
|
4971
|
+
this._removeAllTiles(), B(this._container), t._removeZoomLimit(this), this._container = null, this._tileZoom = void 0;
|
|
4972
4972
|
},
|
|
4973
4973
|
// @method bringToFront: this
|
|
4974
4974
|
// Brings the tile layer to the top of all tile layers.
|
|
@@ -5045,29 +5045,29 @@ var $e = { exports: {} };
|
|
|
5045
5045
|
},
|
|
5046
5046
|
_updateOpacity: function() {
|
|
5047
5047
|
if (this._map && !w.ielt9) {
|
|
5048
|
-
|
|
5048
|
+
$(this._container, this.options.opacity);
|
|
5049
5049
|
var t = +/* @__PURE__ */ new Date(), e = !1, i = !1;
|
|
5050
5050
|
for (var n in this._tiles) {
|
|
5051
5051
|
var s = this._tiles[n];
|
|
5052
5052
|
if (!(!s.current || !s.loaded)) {
|
|
5053
5053
|
var a = Math.min(1, (t - s.loaded) / 200);
|
|
5054
|
-
|
|
5054
|
+
$(s.el, a), a < 1 ? e = !0 : (s.active ? i = !0 : this._onOpaqueTile(s), s.active = !0);
|
|
5055
5055
|
}
|
|
5056
5056
|
}
|
|
5057
|
-
i && !this._noPrune && this._pruneTiles(), e && (
|
|
5057
|
+
i && !this._noPrune && this._pruneTiles(), e && (Q(this._fadeFrame), this._fadeFrame = q(this._updateOpacity, this));
|
|
5058
5058
|
}
|
|
5059
5059
|
},
|
|
5060
5060
|
_onOpaqueTile: y,
|
|
5061
5061
|
_initContainer: function() {
|
|
5062
|
-
this._container || (this._container =
|
|
5062
|
+
this._container || (this._container = S("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container));
|
|
5063
5063
|
},
|
|
5064
5064
|
_updateLevels: function() {
|
|
5065
5065
|
var t = this._tileZoom, e = this.options.maxZoom;
|
|
5066
5066
|
if (t !== void 0) {
|
|
5067
5067
|
for (var i in this._levels)
|
|
5068
|
-
i = Number(i), this._levels[i].el.children.length || i === t ? (this._levels[i].el.style.zIndex = e - Math.abs(t - i), this._onUpdateLevel(i)) : (
|
|
5068
|
+
i = Number(i), this._levels[i].el.children.length || i === t ? (this._levels[i].el.style.zIndex = e - Math.abs(t - i), this._onUpdateLevel(i)) : (B(this._levels[i].el), this._removeTilesAtZoom(i), this._onRemoveLevel(i), delete this._levels[i]);
|
|
5069
5069
|
var n = this._levels[t], s = this._map;
|
|
5070
|
-
return n || (n = this._levels[t] = {}, n.el =
|
|
5070
|
+
return n || (n = this._levels[t] = {}, n.el = S("div", "leaflet-tile-container leaflet-zoom-animated", this._container), n.el.style.zIndex = e, n.origin = s.project(s.unproject(s.getPixelOrigin()), t).round(), n.zoom = t, this._setZoomTransform(n, s.getCenter(), s.getZoom()), y(n.el.offsetWidth), this._onCreateLevel(n)), this._level = n, n;
|
|
5071
5071
|
}
|
|
5072
5072
|
},
|
|
5073
5073
|
_onUpdateLevel: y,
|
|
@@ -5101,7 +5101,7 @@ var $e = { exports: {} };
|
|
|
5101
5101
|
},
|
|
5102
5102
|
_invalidateAll: function() {
|
|
5103
5103
|
for (var t in this._levels)
|
|
5104
|
-
|
|
5104
|
+
B(this._levels[t].el), this._onRemoveLevel(Number(t)), delete this._levels[t];
|
|
5105
5105
|
this._removeAllTiles(), this._tileZoom = void 0;
|
|
5106
5106
|
},
|
|
5107
5107
|
_retainParent: function(t, e, i, n) {
|
|
@@ -5163,7 +5163,7 @@ var $e = { exports: {} };
|
|
|
5163
5163
|
},
|
|
5164
5164
|
_getTiledPixelBounds: function(t) {
|
|
5165
5165
|
var e = this._map, i = e._animatingZoom ? Math.max(e._animateToZoom, e.getZoom()) : e.getZoom(), n = e.getZoomScale(i, this._tileZoom), s = e.project(t, this._tileZoom).floor(), a = e.getSize().divideBy(n * 2);
|
|
5166
|
-
return new
|
|
5166
|
+
return new Z(s.subtract(a), s.add(a));
|
|
5167
5167
|
},
|
|
5168
5168
|
// Private method to load tiles in the grid's active zoom level according to map bounds
|
|
5169
5169
|
_update: function(t) {
|
|
@@ -5171,7 +5171,7 @@ var $e = { exports: {} };
|
|
|
5171
5171
|
if (e) {
|
|
5172
5172
|
var i = this._clampZoom(e.getZoom());
|
|
5173
5173
|
if (t === void 0 && (t = e.getCenter()), this._tileZoom !== void 0) {
|
|
5174
|
-
var n = this._getTiledPixelBounds(t), s = this._pxBoundsToTileRange(n), a = s.getCenter(), l = [], u = this.options.keepBuffer, c = new
|
|
5174
|
+
var n = this._getTiledPixelBounds(t), s = this._pxBoundsToTileRange(n), a = s.getCenter(), l = [], u = this.options.keepBuffer, c = new Z(
|
|
5175
5175
|
s.getBottomLeft().subtract([u, -u]),
|
|
5176
5176
|
s.getTopRight().add([u, -u])
|
|
5177
5177
|
);
|
|
@@ -5187,20 +5187,20 @@ var $e = { exports: {} };
|
|
|
5187
5187
|
}
|
|
5188
5188
|
for (var b = s.min.y; b <= s.max.y; b++)
|
|
5189
5189
|
for (var k = s.min.x; k <= s.max.x; k++) {
|
|
5190
|
-
var
|
|
5191
|
-
if (
|
|
5192
|
-
var G = this._tiles[this._tileCoordsToKey(
|
|
5193
|
-
G ? G.current = !0 : l.push(
|
|
5190
|
+
var V = new P(k, b);
|
|
5191
|
+
if (V.z = this._tileZoom, !!this._isValidTile(V)) {
|
|
5192
|
+
var G = this._tiles[this._tileCoordsToKey(V)];
|
|
5193
|
+
G ? G.current = !0 : l.push(V);
|
|
5194
5194
|
}
|
|
5195
5195
|
}
|
|
5196
|
-
if (l.sort(function(
|
|
5197
|
-
return
|
|
5196
|
+
if (l.sort(function(K, zt) {
|
|
5197
|
+
return K.distanceTo(a) - zt.distanceTo(a);
|
|
5198
5198
|
}), l.length !== 0) {
|
|
5199
5199
|
this._loading || (this._loading = !0, this.fire("loading"));
|
|
5200
|
-
var
|
|
5200
|
+
var et = document.createDocumentFragment();
|
|
5201
5201
|
for (k = 0; k < l.length; k++)
|
|
5202
|
-
this._addTile(l[k],
|
|
5203
|
-
this._level.el.appendChild(
|
|
5202
|
+
this._addTile(l[k], et);
|
|
5203
|
+
this._level.el.appendChild(et);
|
|
5204
5204
|
}
|
|
5205
5205
|
}
|
|
5206
5206
|
}
|
|
@@ -5226,7 +5226,7 @@ var $e = { exports: {} };
|
|
|
5226
5226
|
},
|
|
5227
5227
|
// converts tile coordinates to its geographical bounds
|
|
5228
5228
|
_tileCoordsToBounds: function(t) {
|
|
5229
|
-
var e = this._tileCoordsToNwSe(t), i = new
|
|
5229
|
+
var e = this._tileCoordsToNwSe(t), i = new j(e[0], e[1]);
|
|
5230
5230
|
return this.options.noWrap || (i = this._map.wrapLatLngBounds(i)), i;
|
|
5231
5231
|
},
|
|
5232
5232
|
// converts tile coordinates to key for the tile cache
|
|
@@ -5240,7 +5240,7 @@ var $e = { exports: {} };
|
|
|
5240
5240
|
},
|
|
5241
5241
|
_removeTile: function(t) {
|
|
5242
5242
|
var e = this._tiles[t];
|
|
5243
|
-
e && (
|
|
5243
|
+
e && (B(e.el), delete this._tiles[t], this.fire("tileunload", {
|
|
5244
5244
|
tile: e.el,
|
|
5245
5245
|
coords: this._keyToTileCoords(t)
|
|
5246
5246
|
}));
|
|
@@ -5248,11 +5248,11 @@ var $e = { exports: {} };
|
|
|
5248
5248
|
_initTile: function(t) {
|
|
5249
5249
|
M(t, "leaflet-tile");
|
|
5250
5250
|
var e = this.getTileSize();
|
|
5251
|
-
t.style.width = e.x + "px", t.style.height = e.y + "px", t.onselectstart = y, t.onmousemove = y, w.ielt9 && this.options.opacity < 1 &&
|
|
5251
|
+
t.style.width = e.x + "px", t.style.height = e.y + "px", t.onselectstart = y, t.onmousemove = y, w.ielt9 && this.options.opacity < 1 && $(t, this.options.opacity);
|
|
5252
5252
|
},
|
|
5253
5253
|
_addTile: function(t, e) {
|
|
5254
5254
|
var i = this._getTilePos(t), n = this._tileCoordsToKey(t), s = this.createTile(this._wrapCoords(t), h(this._tileReady, this, t));
|
|
5255
|
-
this._initTile(s), this.createTile.length < 2 &&
|
|
5255
|
+
this._initTile(s), this.createTile.length < 2 && q(h(this._tileReady, this, t, null, s)), H(s, i), this._tiles[n] = {
|
|
5256
5256
|
el: s,
|
|
5257
5257
|
coords: t,
|
|
5258
5258
|
current: !0
|
|
@@ -5268,10 +5268,10 @@ var $e = { exports: {} };
|
|
|
5268
5268
|
coords: t
|
|
5269
5269
|
});
|
|
5270
5270
|
var n = this._tileCoordsToKey(t);
|
|
5271
|
-
i = this._tiles[n], i && (i.loaded = +/* @__PURE__ */ new Date(), this._map._fadeAnimated ? (
|
|
5271
|
+
i = this._tiles[n], i && (i.loaded = +/* @__PURE__ */ new Date(), this._map._fadeAnimated ? ($(i.el, 0), Q(this._fadeFrame), this._fadeFrame = q(this._updateOpacity, this)) : (i.active = !0, this._pruneTiles()), e || (M(i.el, "leaflet-tile-loaded"), this.fire("tileload", {
|
|
5272
5272
|
tile: i.el,
|
|
5273
5273
|
coords: t
|
|
5274
|
-
})), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), w.ielt9 || !this._map._fadeAnimated ?
|
|
5274
|
+
})), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), w.ielt9 || !this._map._fadeAnimated ? q(this._pruneTiles, this) : setTimeout(h(this._pruneTiles, this), 250)));
|
|
5275
5275
|
},
|
|
5276
5276
|
_getTilePos: function(t) {
|
|
5277
5277
|
return t.scaleBy(this.getTileSize()).subtract(this._level.origin);
|
|
@@ -5285,7 +5285,7 @@ var $e = { exports: {} };
|
|
|
5285
5285
|
},
|
|
5286
5286
|
_pxBoundsToTileRange: function(t) {
|
|
5287
5287
|
var e = this.getTileSize();
|
|
5288
|
-
return new
|
|
5288
|
+
return new Z(
|
|
5289
5289
|
t.min.unscaleBy(e).floor(),
|
|
5290
5290
|
t.max.unscaleBy(e).ceil().subtract([1, 1])
|
|
5291
5291
|
);
|
|
@@ -5342,7 +5342,7 @@ var $e = { exports: {} };
|
|
|
5342
5342
|
referrerPolicy: !1
|
|
5343
5343
|
},
|
|
5344
5344
|
initialize: function(t, e) {
|
|
5345
|
-
this._url = t, e =
|
|
5345
|
+
this._url = t, e = A(this, e), e.detectRetina && w.retina && e.maxZoom > 0 ? (e.tileSize = Math.floor(e.tileSize / 2), e.zoomReverse ? (e.zoomOffset--, e.minZoom = Math.min(e.maxZoom, e.minZoom + 1)) : (e.zoomOffset++, e.maxZoom = Math.max(e.minZoom, e.maxZoom - 1)), e.minZoom = Math.max(0, e.minZoom)) : e.zoomReverse ? e.minZoom = Math.min(e.maxZoom, e.minZoom) : e.maxZoom = Math.max(e.minZoom, e.maxZoom), typeof e.subdomains == "string" && (e.subdomains = e.subdomains.split("")), this.on("tileunload", this._onTileRemove);
|
|
5346
5346
|
},
|
|
5347
5347
|
// @method setUrl(url: String, noRedraw?: Boolean): this
|
|
5348
5348
|
// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).
|
|
@@ -5404,7 +5404,7 @@ var $e = { exports: {} };
|
|
|
5404
5404
|
if (this._tiles[t].coords.z !== this._tileZoom && (e = this._tiles[t].el, e.onload = y, e.onerror = y, !e.complete)) {
|
|
5405
5405
|
e.src = Kt;
|
|
5406
5406
|
var i = this._tiles[t].coords;
|
|
5407
|
-
|
|
5407
|
+
B(e), delete this._tiles[t], this.fire("tileabort", {
|
|
5408
5408
|
tile: e,
|
|
5409
5409
|
coords: i
|
|
5410
5410
|
});
|
|
@@ -5462,7 +5462,7 @@ var $e = { exports: {} };
|
|
|
5462
5462
|
var i = o({}, this.defaultWmsParams);
|
|
5463
5463
|
for (var n in e)
|
|
5464
5464
|
n in this.options || (i[n] = e[n]);
|
|
5465
|
-
e =
|
|
5465
|
+
e = A(this, e);
|
|
5466
5466
|
var s = e.detectRetina && w.retina ? 2 : 1, a = this.getTileSize();
|
|
5467
5467
|
i.width = a.x * s, i.height = a.y * s, this.wmsParams = i;
|
|
5468
5468
|
},
|
|
@@ -5472,7 +5472,7 @@ var $e = { exports: {} };
|
|
|
5472
5472
|
this.wmsParams[e] = this._crs.code, Ot.prototype.onAdd.call(this, t);
|
|
5473
5473
|
},
|
|
5474
5474
|
getTileUrl: function(t) {
|
|
5475
|
-
var e = this._tileCoordsToNwSe(t), i = this._crs, n =
|
|
5475
|
+
var e = this._tileCoordsToNwSe(t), i = this._crs, n = Y(i.project(e[0]), i.project(e[1])), s = n.min, a = n.max, l = (this._wmsVersion >= 1.3 && this._crs === Yi ? [s.y, s.x, a.y, a.x] : [s.x, s.y, a.x, a.y]).join(","), u = Ot.prototype.getTileUrl.call(this, t);
|
|
5476
5476
|
return u + ti(this.wmsParams, u, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + l;
|
|
5477
5477
|
},
|
|
5478
5478
|
// @method setParams(params: Object, noRedraw?: Boolean): this
|
|
@@ -5495,7 +5495,7 @@ var $e = { exports: {} };
|
|
|
5495
5495
|
padding: 0.1
|
|
5496
5496
|
},
|
|
5497
5497
|
initialize: function(t) {
|
|
5498
|
-
|
|
5498
|
+
A(this, t), p(this), this._layers = this._layers || {};
|
|
5499
5499
|
},
|
|
5500
5500
|
onAdd: function() {
|
|
5501
5501
|
this._container || (this._initContainer(), M(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this);
|
|
@@ -5537,7 +5537,7 @@ var $e = { exports: {} };
|
|
|
5537
5537
|
},
|
|
5538
5538
|
_update: function() {
|
|
5539
5539
|
var t = this.options.padding, e = this._map.getSize(), i = this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();
|
|
5540
|
-
this._bounds = new
|
|
5540
|
+
this._bounds = new Z(i, i.add(e.multiplyBy(1 + t * 2)).round()), this._center = this._map.getCenter(), this._zoom = this._map.getZoom();
|
|
5541
5541
|
}
|
|
5542
5542
|
}), nn = ft.extend({
|
|
5543
5543
|
// @section
|
|
@@ -5562,7 +5562,7 @@ var $e = { exports: {} };
|
|
|
5562
5562
|
T(t, "mousemove", this._onMouseMove, this), T(t, "click dblclick mousedown mouseup contextmenu", this._onClick, this), T(t, "mouseout", this._handleMouseOut, this), t._leaflet_disable_events = !0, this._ctx = t.getContext("2d");
|
|
5563
5563
|
},
|
|
5564
5564
|
_destroyContainer: function() {
|
|
5565
|
-
|
|
5565
|
+
Q(this._redrawRequest), delete this._ctx, B(this._container), I(this._container), delete this._container;
|
|
5566
5566
|
},
|
|
5567
5567
|
_updatePaths: function() {
|
|
5568
5568
|
if (!this._postponeUpdatePaths) {
|
|
@@ -5584,7 +5584,7 @@ var $e = { exports: {} };
|
|
|
5584
5584
|
ft.prototype._reset.call(this), this._postponeUpdatePaths && (this._postponeUpdatePaths = !1, this._updatePaths());
|
|
5585
5585
|
},
|
|
5586
5586
|
_initPath: function(t) {
|
|
5587
|
-
this._updateDashArray(t), this._layers[
|
|
5587
|
+
this._updateDashArray(t), this._layers[p(t)] = t;
|
|
5588
5588
|
var e = t._order = {
|
|
5589
5589
|
layer: t,
|
|
5590
5590
|
prev: this._drawLast,
|
|
@@ -5597,7 +5597,7 @@ var $e = { exports: {} };
|
|
|
5597
5597
|
},
|
|
5598
5598
|
_removePath: function(t) {
|
|
5599
5599
|
var e = t._order, i = e.next, n = e.prev;
|
|
5600
|
-
i ? i.prev = n : this._drawLast = n, n ? n.next = i : this._drawFirst = i, delete t._order, delete this._layers[
|
|
5600
|
+
i ? i.prev = n : this._drawLast = n, n ? n.next = i : this._drawFirst = i, delete t._order, delete this._layers[p(t)], this._requestRedraw(t);
|
|
5601
5601
|
},
|
|
5602
5602
|
_updatePath: function(t) {
|
|
5603
5603
|
this._extendRedrawBounds(t), t._project(), t._update(), this._requestRedraw(t);
|
|
@@ -5618,12 +5618,12 @@ var $e = { exports: {} };
|
|
|
5618
5618
|
t.options._dashArray = t.options.dashArray;
|
|
5619
5619
|
},
|
|
5620
5620
|
_requestRedraw: function(t) {
|
|
5621
|
-
this._map && (this._extendRedrawBounds(t), this._redrawRequest = this._redrawRequest ||
|
|
5621
|
+
this._map && (this._extendRedrawBounds(t), this._redrawRequest = this._redrawRequest || q(this._redraw, this));
|
|
5622
5622
|
},
|
|
5623
5623
|
_extendRedrawBounds: function(t) {
|
|
5624
5624
|
if (t._pxBounds) {
|
|
5625
5625
|
var e = (t.options.weight || 0) + 1;
|
|
5626
|
-
this._redrawBounds = this._redrawBounds || new
|
|
5626
|
+
this._redrawBounds = this._redrawBounds || new Z(), this._redrawBounds.extend(t._pxBounds.min.subtract([e, e])), this._redrawBounds.extend(t._pxBounds.max.add([e, e]));
|
|
5627
5627
|
}
|
|
5628
5628
|
},
|
|
5629
5629
|
_redraw: function() {
|
|
@@ -5738,14 +5738,14 @@ var $e = { exports: {} };
|
|
|
5738
5738
|
};
|
|
5739
5739
|
}(), zo = {
|
|
5740
5740
|
_initContainer: function() {
|
|
5741
|
-
this._container =
|
|
5741
|
+
this._container = S("div", "leaflet-vml-container");
|
|
5742
5742
|
},
|
|
5743
5743
|
_update: function() {
|
|
5744
5744
|
this._map._animatingZoom || (ft.prototype._update.call(this), this.fire("update"));
|
|
5745
5745
|
},
|
|
5746
5746
|
_initPath: function(t) {
|
|
5747
5747
|
var e = t._container = Yt("shape");
|
|
5748
|
-
M(e, "leaflet-vml-shape " + (this.options.className || "")), e.coordsize = "1 1", t._path = Yt("path"), e.appendChild(t._path), this._updateStyle(t), this._layers[
|
|
5748
|
+
M(e, "leaflet-vml-shape " + (this.options.className || "")), e.coordsize = "1 1", t._path = Yt("path"), e.appendChild(t._path), this._updateStyle(t), this._layers[p(t)] = t;
|
|
5749
5749
|
},
|
|
5750
5750
|
_addPath: function(t) {
|
|
5751
5751
|
var e = t._container;
|
|
@@ -5753,7 +5753,7 @@ var $e = { exports: {} };
|
|
|
5753
5753
|
},
|
|
5754
5754
|
_removePath: function(t) {
|
|
5755
5755
|
var e = t._container;
|
|
5756
|
-
|
|
5756
|
+
B(e), t.removeInteractiveTarget(e), delete this._layers[p(t)];
|
|
5757
5757
|
},
|
|
5758
5758
|
_updateStyle: function(t) {
|
|
5759
5759
|
var e = t._stroke, i = t._fill, n = t.options, s = t._container;
|
|
@@ -5777,7 +5777,7 @@ var $e = { exports: {} };
|
|
|
5777
5777
|
this._container = _e("svg"), this._container.setAttribute("pointer-events", "none"), this._rootGroup = _e("g"), this._container.appendChild(this._rootGroup);
|
|
5778
5778
|
},
|
|
5779
5779
|
_destroyContainer: function() {
|
|
5780
|
-
|
|
5780
|
+
B(this._container), I(this._container), delete this._container, delete this._rootGroup, delete this._svgSize;
|
|
5781
5781
|
},
|
|
5782
5782
|
_update: function() {
|
|
5783
5783
|
if (!(this._map._animatingZoom && this._bounds)) {
|
|
@@ -5789,13 +5789,13 @@ var $e = { exports: {} };
|
|
|
5789
5789
|
// methods below are called by vector layers implementations
|
|
5790
5790
|
_initPath: function(t) {
|
|
5791
5791
|
var e = t._path = _e("path");
|
|
5792
|
-
t.options.className && M(e, t.options.className), t.options.interactive && M(e, "leaflet-interactive"), this._updateStyle(t), this._layers[
|
|
5792
|
+
t.options.className && M(e, t.options.className), t.options.interactive && M(e, "leaflet-interactive"), this._updateStyle(t), this._layers[p(t)] = t;
|
|
5793
5793
|
},
|
|
5794
5794
|
_addPath: function(t) {
|
|
5795
5795
|
this._rootGroup || this._initContainer(), this._rootGroup.appendChild(t._path), t.addInteractiveTarget(t._path);
|
|
5796
5796
|
},
|
|
5797
5797
|
_removePath: function(t) {
|
|
5798
|
-
|
|
5798
|
+
B(t._path), t.removeInteractiveTarget(t._path), delete this._layers[p(t)];
|
|
5799
5799
|
},
|
|
5800
5800
|
_updatePath: function(t) {
|
|
5801
5801
|
t._project(), t._update();
|
|
@@ -5880,13 +5880,13 @@ var $e = { exports: {} };
|
|
|
5880
5880
|
T(this._container, "mousedown", this._onMouseDown, this);
|
|
5881
5881
|
},
|
|
5882
5882
|
removeHooks: function() {
|
|
5883
|
-
|
|
5883
|
+
I(this._container, "mousedown", this._onMouseDown, this);
|
|
5884
5884
|
},
|
|
5885
5885
|
moved: function() {
|
|
5886
5886
|
return this._moved;
|
|
5887
5887
|
},
|
|
5888
5888
|
_destroy: function() {
|
|
5889
|
-
|
|
5889
|
+
B(this._pane), delete this._pane;
|
|
5890
5890
|
},
|
|
5891
5891
|
_resetState: function() {
|
|
5892
5892
|
this._resetStateTimeout = 0, this._moved = !1;
|
|
@@ -5905,12 +5905,12 @@ var $e = { exports: {} };
|
|
|
5905
5905
|
}, this);
|
|
5906
5906
|
},
|
|
5907
5907
|
_onMouseMove: function(t) {
|
|
5908
|
-
this._moved || (this._moved = !0, this._box =
|
|
5909
|
-
var e = new
|
|
5908
|
+
this._moved || (this._moved = !0, this._box = S("div", "leaflet-zoom-box", this._container), M(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
|
|
5909
|
+
var e = new Z(this._point, this._startPoint), i = e.getSize();
|
|
5910
5910
|
H(this._box, e.min), this._box.style.width = i.x + "px", this._box.style.height = i.y + "px";
|
|
5911
5911
|
},
|
|
5912
5912
|
_finish: function() {
|
|
5913
|
-
this._moved && (
|
|
5913
|
+
this._moved && (B(this._box), R(this._container, "leaflet-crosshair")), Ht(), ze(), I(document, {
|
|
5914
5914
|
contextmenu: xt,
|
|
5915
5915
|
mousemove: this._onMouseMove,
|
|
5916
5916
|
mouseup: this._onMouseUp,
|
|
@@ -5920,7 +5920,7 @@ var $e = { exports: {} };
|
|
|
5920
5920
|
_onMouseUp: function(t) {
|
|
5921
5921
|
if (!(t.which !== 1 && t.button !== 1) && (this._finish(), !!this._moved)) {
|
|
5922
5922
|
this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(h(this._resetState, this), 0);
|
|
5923
|
-
var e = new
|
|
5923
|
+
var e = new j(
|
|
5924
5924
|
this._map.containerPointToLatLng(this._startPoint),
|
|
5925
5925
|
this._map.containerPointToLatLng(this._point)
|
|
5926
5926
|
);
|
|
@@ -5990,7 +5990,7 @@ var $e = { exports: {} };
|
|
|
5990
5990
|
addHooks: function() {
|
|
5991
5991
|
if (!this._draggable) {
|
|
5992
5992
|
var t = this._map;
|
|
5993
|
-
this._draggable = new
|
|
5993
|
+
this._draggable = new gt(t._mapPane, t._container), this._draggable.on({
|
|
5994
5994
|
dragstart: this._onDragStart,
|
|
5995
5995
|
drag: this._onDrag,
|
|
5996
5996
|
dragend: this._onDragEnd
|
|
@@ -6011,7 +6011,7 @@ var $e = { exports: {} };
|
|
|
6011
6011
|
var t = this._map;
|
|
6012
6012
|
if (t._stop(), this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
|
|
6013
6013
|
var e = N(this._map.options.maxBounds);
|
|
6014
|
-
this._offsetLimit =
|
|
6014
|
+
this._offsetLimit = Y(
|
|
6015
6015
|
this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),
|
|
6016
6016
|
this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())
|
|
6017
6017
|
), this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity));
|
|
@@ -6054,7 +6054,7 @@ var $e = { exports: {} };
|
|
|
6054
6054
|
else {
|
|
6055
6055
|
this._prunePositions(+/* @__PURE__ */ new Date());
|
|
6056
6056
|
var s = this._lastPos.subtract(this._positions[0]), a = (this._lastTime - this._times[0]) / 1e3, l = i.easeLinearity, u = s.multiplyBy(l / a), c = u.distanceTo([0, 0]), _ = Math.min(i.inertiaMaxSpeed, c), v = u.multiplyBy(_ / c), b = _ / (i.inertiaDeceleration * l), k = v.multiplyBy(-b / 2).round();
|
|
6057
|
-
!k.x && !k.y ? e.fire("moveend") : (k = e._limitOffset(k, e.options.maxBounds),
|
|
6057
|
+
!k.x && !k.y ? e.fire("moveend") : (k = e._limitOffset(k, e.options.maxBounds), q(function() {
|
|
6058
6058
|
e.panBy(k, {
|
|
6059
6059
|
duration: b,
|
|
6060
6060
|
easeLinearity: l,
|
|
@@ -6098,7 +6098,7 @@ var $e = { exports: {} };
|
|
|
6098
6098
|
}, this);
|
|
6099
6099
|
},
|
|
6100
6100
|
removeHooks: function() {
|
|
6101
|
-
this._removeHooks(),
|
|
6101
|
+
this._removeHooks(), I(this._map._container, {
|
|
6102
6102
|
focus: this._onFocus,
|
|
6103
6103
|
blur: this._onBlur,
|
|
6104
6104
|
mousedown: this._onMouseDown
|
|
@@ -6141,7 +6141,7 @@ var $e = { exports: {} };
|
|
|
6141
6141
|
T(document, "keydown", this._onKeyDown, this);
|
|
6142
6142
|
},
|
|
6143
6143
|
_removeHooks: function() {
|
|
6144
|
-
|
|
6144
|
+
I(document, "keydown", this._onKeyDown, this);
|
|
6145
6145
|
},
|
|
6146
6146
|
_onKeyDown: function(t) {
|
|
6147
6147
|
if (!(t.altKey || t.ctrlKey || t.metaKey)) {
|
|
@@ -6184,7 +6184,7 @@ var $e = { exports: {} };
|
|
|
6184
6184
|
T(this._map._container, "wheel", this._onWheelScroll, this), this._delta = 0;
|
|
6185
6185
|
},
|
|
6186
6186
|
removeHooks: function() {
|
|
6187
|
-
|
|
6187
|
+
I(this._map._container, "wheel", this._onWheelScroll, this);
|
|
6188
6188
|
},
|
|
6189
6189
|
_onWheelScroll: function(t) {
|
|
6190
6190
|
var e = Ii(t), i = this._map.options.wheelDebounceTime;
|
|
@@ -6216,7 +6216,7 @@ var $e = { exports: {} };
|
|
|
6216
6216
|
T(this._map._container, "touchstart", this._onDown, this);
|
|
6217
6217
|
},
|
|
6218
6218
|
removeHooks: function() {
|
|
6219
|
-
|
|
6219
|
+
I(this._map._container, "touchstart", this._onDown, this);
|
|
6220
6220
|
},
|
|
6221
6221
|
_onDown: function(t) {
|
|
6222
6222
|
if (clearTimeout(this._holdTimeout), t.touches.length === 1) {
|
|
@@ -6227,10 +6227,10 @@ var $e = { exports: {} };
|
|
|
6227
6227
|
}
|
|
6228
6228
|
},
|
|
6229
6229
|
_cancelClickPrevent: function t() {
|
|
6230
|
-
|
|
6230
|
+
I(document, "touchend", F), I(document, "touchend touchcancel", t);
|
|
6231
6231
|
},
|
|
6232
6232
|
_cancel: function() {
|
|
6233
|
-
clearTimeout(this._holdTimeout),
|
|
6233
|
+
clearTimeout(this._holdTimeout), I(document, "touchend touchcancel contextmenu", this._cancel, this), I(document, "touchmove", this._onMove, this);
|
|
6234
6234
|
},
|
|
6235
6235
|
_onMove: function(t) {
|
|
6236
6236
|
var e = t.touches[0];
|
|
@@ -6273,7 +6273,7 @@ var $e = { exports: {} };
|
|
|
6273
6273
|
M(this._map._container, "leaflet-touch-zoom"), T(this._map._container, "touchstart", this._onTouchStart, this);
|
|
6274
6274
|
},
|
|
6275
6275
|
removeHooks: function() {
|
|
6276
|
-
R(this._map._container, "leaflet-touch-zoom"),
|
|
6276
|
+
R(this._map._container, "leaflet-touch-zoom"), I(this._map._container, "touchstart", this._onTouchStart, this);
|
|
6277
6277
|
},
|
|
6278
6278
|
_onTouchStart: function(t) {
|
|
6279
6279
|
var e = this._map;
|
|
@@ -6294,9 +6294,9 @@ var $e = { exports: {} };
|
|
|
6294
6294
|
return;
|
|
6295
6295
|
this._center = e.unproject(e.project(this._pinchStartLatLng, this._zoom).subtract(a), this._zoom);
|
|
6296
6296
|
}
|
|
6297
|
-
this._moved || (e._moveStart(!0, !1), this._moved = !0),
|
|
6297
|
+
this._moved || (e._moveStart(!0, !1), this._moved = !0), Q(this._animRequest);
|
|
6298
6298
|
var l = h(e._move, e, this._center, this._zoom, { pinch: !0, round: !1 }, void 0);
|
|
6299
|
-
this._animRequest =
|
|
6299
|
+
this._animRequest = q(l, this, !0), F(t);
|
|
6300
6300
|
}
|
|
6301
6301
|
},
|
|
6302
6302
|
_onTouchEnd: function() {
|
|
@@ -6304,20 +6304,20 @@ var $e = { exports: {} };
|
|
|
6304
6304
|
this._zooming = !1;
|
|
6305
6305
|
return;
|
|
6306
6306
|
}
|
|
6307
|
-
this._zooming = !1,
|
|
6307
|
+
this._zooming = !1, Q(this._animRequest), I(document, "touchmove", this._onTouchMove, this), I(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));
|
|
6308
6308
|
}
|
|
6309
6309
|
});
|
|
6310
|
-
C.addInitHook("addHandler", "touchZoom", _n), C.BoxZoom = an, C.DoubleClickZoom = hn, C.Drag = ln, C.Keyboard = un, C.ScrollWheelZoom = cn, C.TapHold = dn, C.TouchZoom = _n,
|
|
6310
|
+
C.addInitHook("addHandler", "touchZoom", _n), C.BoxZoom = an, C.DoubleClickZoom = hn, C.Drag = ln, C.Keyboard = un, C.ScrollWheelZoom = cn, C.TapHold = dn, C.TouchZoom = _n, f.Bounds = Z, f.Browser = w, f.CRS = ut, f.Canvas = nn, f.Circle = je, f.CircleMarker = se, f.Class = lt, f.Control = nt, f.DivIcon = $i, f.DivOverlay = ht, f.DomEvent = Qn, f.DomUtil = Xn, f.Draggable = gt, f.Evented = It, f.FeatureGroup = ct, f.GeoJSON = _t, f.GridLayer = qt, f.Handler = at, f.Icon = Ct, f.ImageOverlay = ue, f.LatLng = z, f.LatLngBounds = j, f.Layer = ot, f.LayerGroup = Et, f.LineUtil = co, f.Map = C, f.Marker = oe, f.Mixin = so, f.Path = vt, f.Point = P, f.PolyUtil = ro, f.Polygon = Dt, f.Polyline = dt, f.Popup = ce, f.PosAnimation = Ai, f.Projection = _o, f.Rectangle = rn, f.Renderer = ft, f.SVG = jt, f.SVGOverlay = Qi, f.TileLayer = Ot, f.Tooltip = de, f.Transformation = Le, f.Util = vn, f.VideoOverlay = Ji, f.bind = h, f.bounds = Y, f.canvas = on, f.circle = wo, f.circleMarker = Lo, f.control = Ft, f.divIcon = Do, f.extend = o, f.featureGroup = go, f.geoJSON = Xi, f.geoJson = Po, f.gridLayer = So, f.icon = vo, f.imageOverlay = To, f.latLng = E, f.latLngBounds = N, f.layerGroup = mo, f.map = $n, f.marker = yo, f.point = x, f.polygon = xo, f.polyline = bo, f.popup = Eo, f.rectangle = Io, f.setOptions = A, f.stamp = p, f.svg = sn, f.svgOverlay = ko, f.tileLayer = tn, f.tooltip = Co, f.transformation = At, f.version = W, f.videoOverlay = Mo;
|
|
6311
6311
|
var Zo = window.L;
|
|
6312
|
-
|
|
6312
|
+
f.noConflict = function() {
|
|
6313
6313
|
return window.L = Zo, this;
|
|
6314
|
-
}, window.L =
|
|
6314
|
+
}, window.L = f;
|
|
6315
6315
|
});
|
|
6316
6316
|
})($e, $e.exports);
|
|
6317
6317
|
var Yo = $e.exports;
|
|
6318
|
-
const
|
|
6319
|
-
(function(
|
|
6320
|
-
function
|
|
6318
|
+
const pt = /* @__PURE__ */ qo(Yo);
|
|
6319
|
+
(function(J, D, f) {
|
|
6320
|
+
function W(o, r) {
|
|
6321
6321
|
for (; (o = o.parentElement) && !o.classList.contains(r); ) ;
|
|
6322
6322
|
return o;
|
|
6323
6323
|
}
|
|
@@ -6382,8 +6382,8 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6382
6382
|
this._endPoint.call(this, h, d, o), this._clickHandled = null;
|
|
6383
6383
|
}, _endPoint: function(o, r, h) {
|
|
6384
6384
|
if (this._mouseDownOrigin) {
|
|
6385
|
-
var d = L.point(o, r).distanceTo(this._mouseDownOrigin),
|
|
6386
|
-
this.options.maxPoints > 1 && this.options.maxPoints == this._markers.length + 1 ? (this.addVertex(h.latlng), this._finishShape()) :
|
|
6385
|
+
var d = L.point(o, r).distanceTo(this._mouseDownOrigin), p = this._calculateFinishDistance(h.latlng);
|
|
6386
|
+
this.options.maxPoints > 1 && this.options.maxPoints == this._markers.length + 1 ? (this.addVertex(h.latlng), this._finishShape()) : p < 10 && L.Browser.touch ? this._finishShape() : Math.abs(d) < 9 * (J.devicePixelRatio || 1) && this.addVertex(h.latlng), this._enableNewMarkers();
|
|
6387
6387
|
}
|
|
6388
6388
|
this._mouseDownOrigin = null;
|
|
6389
6389
|
}, _onTouch: function(o) {
|
|
@@ -6400,7 +6400,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6400
6400
|
if (this.type !== L.Draw.Polygon.TYPE) return 1 / 0;
|
|
6401
6401
|
h = this._markers[0];
|
|
6402
6402
|
}
|
|
6403
|
-
var d = this._map.latLngToContainerPoint(h.getLatLng()),
|
|
6403
|
+
var d = this._map.latLngToContainerPoint(h.getLatLng()), p = new L.Marker(o, { icon: this.options.icon, zIndexOffset: 2 * this.options.zIndexOffset }), g = this._map.latLngToContainerPoint(p.getLatLng());
|
|
6404
6404
|
r = d.distanceTo(g);
|
|
6405
6405
|
} else r = 1 / 0;
|
|
6406
6406
|
return r;
|
|
@@ -6417,8 +6417,8 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6417
6417
|
var r = this._getTooltipText();
|
|
6418
6418
|
o && this._tooltip.updatePosition(o), this._errorShown || this._tooltip.updateContent(r);
|
|
6419
6419
|
}, _drawGuide: function(o, r) {
|
|
6420
|
-
var h, d,
|
|
6421
|
-
for (this._guidesContainer || (this._guidesContainer = L.DomUtil.create("div", "leaflet-draw-guides", this._overlayPane));
|
|
6420
|
+
var h, d, p, g = Math.floor(Math.sqrt(Math.pow(r.x - o.x, 2) + Math.pow(r.y - o.y, 2))), m = this.options.guidelineDistance, y = this.options.maxGuideLineLength, O = g > y ? g - y : m;
|
|
6421
|
+
for (this._guidesContainer || (this._guidesContainer = L.DomUtil.create("div", "leaflet-draw-guides", this._overlayPane)); O < g; O += this.options.guidelineDistance) h = O / g, d = { x: Math.floor(o.x * (1 - h) + h * r.x), y: Math.floor(o.y * (1 - h) + h * r.y) }, p = L.DomUtil.create("div", "leaflet-draw-guide-dash", this._guidesContainer), p.style.backgroundColor = this._errorShown ? this.options.drawError.color : this.options.shapeOptions.color, L.DomUtil.setPosition(p, d);
|
|
6422
6422
|
}, _updateGuideColor: function(o) {
|
|
6423
6423
|
if (this._guidesContainer) for (var r = 0, h = this._guidesContainer.childNodes.length; r < h; r++) this._guidesContainer.childNodes[r].style.backgroundColor = o;
|
|
6424
6424
|
}, _clearGuides: function() {
|
|
@@ -6427,8 +6427,8 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6427
6427
|
var o, r, h = this.options.showLength;
|
|
6428
6428
|
return this._markers.length === 0 ? o = { text: L.drawLocal.draw.handlers.polyline.tooltip.start } : (r = h ? this._getMeasurementString() : "", o = this._markers.length === 1 ? { text: L.drawLocal.draw.handlers.polyline.tooltip.cont, subtext: r } : { text: L.drawLocal.draw.handlers.polyline.tooltip.end, subtext: r }), o;
|
|
6429
6429
|
}, _updateRunningMeasure: function(o, r) {
|
|
6430
|
-
var h, d,
|
|
6431
|
-
this._markers.length === 1 ? this._measurementRunningTotal = 0 : (h =
|
|
6430
|
+
var h, d, p = this._markers.length;
|
|
6431
|
+
this._markers.length === 1 ? this._measurementRunningTotal = 0 : (h = p - (r ? 2 : 1), d = L.GeometryUtil.isVersion07x() ? o.distanceTo(this._markers[h].getLatLng()) * (this.options.factor || 1) : this._map.distance(o, this._markers[h].getLatLng()) * (this.options.factor || 1), this._measurementRunningTotal += d * (r ? 1 : -1));
|
|
6432
6432
|
}, _getMeasurementString: function() {
|
|
6433
6433
|
var o, r = this._currentLatLng, h = this._markers[this._markers.length - 1].getLatLng();
|
|
6434
6434
|
return o = L.GeometryUtil.isVersion07x() ? h && r && r.distanceTo ? this._measurementRunningTotal + r.distanceTo(h) * (this.options.factor || 1) : this._measurementRunningTotal || 0 : h && r ? this._measurementRunningTotal + this._map.distance(r, h) * (this.options.factor || 1) : this._measurementRunningTotal || 0, L.GeometryUtil.readableDistance(o, this.options.metric, this.options.feet, this.options.nautic, this.options.precision);
|
|
@@ -6471,13 +6471,13 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6471
6471
|
} }), L.SimpleShape = {}, L.Draw.SimpleShape = L.Draw.Feature.extend({ options: { repeatMode: !1 }, initialize: function(o, r) {
|
|
6472
6472
|
this._endLabelText = L.drawLocal.draw.handlers.simpleshape.tooltip.end, L.Draw.Feature.prototype.initialize.call(this, o, r);
|
|
6473
6473
|
}, addHooks: function() {
|
|
6474
|
-
L.Draw.Feature.prototype.addHooks.call(this), this._map && (this._mapDraggable = this._map.dragging.enabled(), this._mapDraggable && this._map.dragging.disable(), this._container.style.cursor = "crosshair", this._tooltip.updateContent({ text: this._initialLabelText }), this._map.on("mousedown", this._onMouseDown, this).on("mousemove", this._onMouseMove, this).on("touchstart", this._onMouseDown, this).on("touchmove", this._onMouseMove, this),
|
|
6474
|
+
L.Draw.Feature.prototype.addHooks.call(this), this._map && (this._mapDraggable = this._map.dragging.enabled(), this._mapDraggable && this._map.dragging.disable(), this._container.style.cursor = "crosshair", this._tooltip.updateContent({ text: this._initialLabelText }), this._map.on("mousedown", this._onMouseDown, this).on("mousemove", this._onMouseMove, this).on("touchstart", this._onMouseDown, this).on("touchmove", this._onMouseMove, this), D.addEventListener("touchstart", L.DomEvent.preventDefault, { passive: !1 }));
|
|
6475
6475
|
}, removeHooks: function() {
|
|
6476
|
-
L.Draw.Feature.prototype.removeHooks.call(this), this._map && (this._mapDraggable && this._map.dragging.enable(), this._container.style.cursor = "", this._map.off("mousedown", this._onMouseDown, this).off("mousemove", this._onMouseMove, this).off("touchstart", this._onMouseDown, this).off("touchmove", this._onMouseMove, this), L.DomEvent.off(
|
|
6476
|
+
L.Draw.Feature.prototype.removeHooks.call(this), this._map && (this._mapDraggable && this._map.dragging.enable(), this._container.style.cursor = "", this._map.off("mousedown", this._onMouseDown, this).off("mousemove", this._onMouseMove, this).off("touchstart", this._onMouseDown, this).off("touchmove", this._onMouseMove, this), L.DomEvent.off(D, "mouseup", this._onMouseUp, this), L.DomEvent.off(D, "touchend", this._onMouseUp, this), D.removeEventListener("touchstart", L.DomEvent.preventDefault), this._shape && (this._map.removeLayer(this._shape), delete this._shape)), this._isDrawing = !1;
|
|
6477
6477
|
}, _getTooltipText: function() {
|
|
6478
6478
|
return { text: this._endLabelText };
|
|
6479
6479
|
}, _onMouseDown: function(o) {
|
|
6480
|
-
this._isDrawing = !0, this._startLatLng = o.latlng, L.DomEvent.on(
|
|
6480
|
+
this._isDrawing = !0, this._startLatLng = o.latlng, L.DomEvent.on(D, "mouseup", this._onMouseUp, this).on(D, "touchend", this._onMouseUp, this).preventDefault(o.originalEvent);
|
|
6481
6481
|
}, _onMouseMove: function(o) {
|
|
6482
6482
|
var r = o.latlng;
|
|
6483
6483
|
this._tooltip.updatePosition(r), this._isDrawing && (this._tooltip.updateContent(this._getTooltipText()), this._drawShape(r));
|
|
@@ -6489,15 +6489,15 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6489
6489
|
this._enabled && (this._isCurrentlyTwoClickDrawing = !1, L.Draw.SimpleShape.prototype.disable.call(this));
|
|
6490
6490
|
}, _onMouseUp: function(o) {
|
|
6491
6491
|
if (!this._shape && !this._isCurrentlyTwoClickDrawing) return void (this._isCurrentlyTwoClickDrawing = !0);
|
|
6492
|
-
this._isCurrentlyTwoClickDrawing && !
|
|
6492
|
+
this._isCurrentlyTwoClickDrawing && !W(o.target, "leaflet-pane") || L.Draw.SimpleShape.prototype._onMouseUp.call(this);
|
|
6493
6493
|
}, _drawShape: function(o) {
|
|
6494
6494
|
this._shape ? this._shape.setBounds(new L.LatLngBounds(this._startLatLng, o)) : (this._shape = new L.Rectangle(new L.LatLngBounds(this._startLatLng, o), this.options.shapeOptions), this._map.addLayer(this._shape));
|
|
6495
6495
|
}, _fireCreatedEvent: function() {
|
|
6496
6496
|
var o = new L.Rectangle(this._shape.getBounds(), this.options.shapeOptions);
|
|
6497
6497
|
L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this, o);
|
|
6498
6498
|
}, _getTooltipText: function() {
|
|
6499
|
-
var o, r, h, d = L.Draw.SimpleShape.prototype._getTooltipText.call(this),
|
|
6500
|
-
return
|
|
6499
|
+
var o, r, h, d = L.Draw.SimpleShape.prototype._getTooltipText.call(this), p = this._shape, g = this.options.showArea;
|
|
6500
|
+
return p && (o = this._shape._defaultShape ? this._shape._defaultShape() : this._shape.getLatLngs(), r = L.GeometryUtil.geodesicArea(o), h = g ? L.GeometryUtil.readableArea(r, this.options.metric) : ""), { text: d.text, subtext: h };
|
|
6501
6501
|
} }), L.Draw.Marker = L.Draw.Feature.extend({ statics: { TYPE: "marker" }, options: { icon: new L.Icon.Default(), repeatMode: !1, zIndexOffset: 2e3 }, initialize: function(o, r) {
|
|
6502
6502
|
this.type = L.Draw.Marker.TYPE, this._initialLabelText = L.drawLocal.draw.handlers.marker.tooltip.start, L.Draw.Feature.prototype.initialize.call(this, o, r);
|
|
6503
6503
|
}, addHooks: function() {
|
|
@@ -6533,11 +6533,11 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6533
6533
|
var o = new L.Circle(this._startLatLng, this._shape.getRadius(), this.options.shapeOptions);
|
|
6534
6534
|
L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this, o);
|
|
6535
6535
|
}, _onMouseMove: function(o) {
|
|
6536
|
-
var r, h = o.latlng, d = this.options.showRadius,
|
|
6536
|
+
var r, h = o.latlng, d = this.options.showRadius, p = this.options.metric;
|
|
6537
6537
|
if (this._tooltip.updatePosition(h), this._isDrawing) {
|
|
6538
6538
|
this._drawShape(h), r = this._shape.getRadius().toFixed(1);
|
|
6539
6539
|
var g = "";
|
|
6540
|
-
d && (g = L.drawLocal.draw.handlers.circle.radius + ": " + L.GeometryUtil.readableDistance(r,
|
|
6540
|
+
d && (g = L.drawLocal.draw.handlers.circle.radius + ": " + L.GeometryUtil.readableDistance(r, p, this.options.feet, this.options.nautic)), this._tooltip.updateContent({ text: this._endLabelText, subtext: g });
|
|
6541
6541
|
}
|
|
6542
6542
|
} }), L.Edit = L.Edit || {}, L.Edit.Marker = L.Handler.extend({ initialize: function(o, r) {
|
|
6543
6543
|
this._marker = o, L.setOptions(this, r);
|
|
@@ -6603,8 +6603,8 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6603
6603
|
this._markerGroup.clearLayers(), this._initMarkers();
|
|
6604
6604
|
}, _initMarkers: function() {
|
|
6605
6605
|
this._markerGroup || (this._markerGroup = new L.LayerGroup()), this._markers = [];
|
|
6606
|
-
var o, r, h, d,
|
|
6607
|
-
for (o = 0, h =
|
|
6606
|
+
var o, r, h, d, p = this._defaultShape();
|
|
6607
|
+
for (o = 0, h = p.length; o < h; o++) d = this._createMarker(p[o], o), d.on("click", this._onMarkerClick, this), d.on("contextmenu", this._onContextMenu, this), this._markers.push(d);
|
|
6608
6608
|
var g, m;
|
|
6609
6609
|
for (o = 0, r = h - 1; o < h; r = o++) (o !== 0 || L.Polygon && this._poly instanceof L.Polygon) && (g = this._markers[r], m = this._markers[o], this._createMiddleMarker(g, m), this._updatePrevNext(g, m));
|
|
6610
6610
|
}, _createMarker: function(o, r) {
|
|
@@ -6623,12 +6623,12 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6623
6623
|
}, _onMarkerDrag: function(o) {
|
|
6624
6624
|
var r = o.target, h = this._poly, d = L.LatLngUtil.cloneLatLng(r._origLatLng);
|
|
6625
6625
|
if (L.extend(r._origLatLng, r._latlng), h.options.poly) {
|
|
6626
|
-
var
|
|
6626
|
+
var p = h._map._editTooltip;
|
|
6627
6627
|
if (!h.options.poly.allowIntersection && h.intersects()) {
|
|
6628
6628
|
L.extend(r._origLatLng, d), r.setLatLng(d);
|
|
6629
6629
|
var g = h.options.color;
|
|
6630
|
-
h.setStyle({ color: this.options.drawError.color }),
|
|
6631
|
-
h.setStyle({ color: g }),
|
|
6630
|
+
h.setStyle({ color: this.options.drawError.color }), p && p.updateContent({ text: L.drawLocal.draw.handlers.polyline.error }), setTimeout(function() {
|
|
6631
|
+
h.setStyle({ color: g }), p && p.updateContent({ text: L.drawLocal.edit.handlers.edit.tooltip.text, subtext: L.drawLocal.edit.handlers.edit.tooltip.subtext });
|
|
6632
6632
|
}, 1e3);
|
|
6633
6633
|
}
|
|
6634
6634
|
}
|
|
@@ -6649,21 +6649,21 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6649
6649
|
h._index > o && (h._index += r);
|
|
6650
6650
|
});
|
|
6651
6651
|
}, _createMiddleMarker: function(o, r) {
|
|
6652
|
-
var h, d,
|
|
6652
|
+
var h, d, p, g = this._getMiddleLatLng(o, r), m = this._createMarker(g);
|
|
6653
6653
|
m.setOpacity(0.6), o._middleRight = r._middleLeft = m, d = function() {
|
|
6654
6654
|
m.off("touchmove", d, this);
|
|
6655
6655
|
var y = r._index;
|
|
6656
6656
|
m._index = y, m.off("click", h, this).on("click", this._onMarkerClick, this), g.lat = m.getLatLng().lat, g.lng = m.getLatLng().lng, this._spliceLatLngs(y, 0, g), this._markers.splice(y, 0, m), m.setOpacity(1), this._updateIndexes(y, 1), r._index++, this._updatePrevNext(o, m), this._updatePrevNext(m, r), this._poly.fire("editstart");
|
|
6657
|
-
},
|
|
6658
|
-
m.off("dragstart", d, this), m.off("dragend",
|
|
6657
|
+
}, p = function() {
|
|
6658
|
+
m.off("dragstart", d, this), m.off("dragend", p, this), m.off("touchmove", d, this), this._createMiddleMarker(o, m), this._createMiddleMarker(m, r);
|
|
6659
6659
|
}, h = function() {
|
|
6660
|
-
d.call(this),
|
|
6661
|
-
}, m.on("click", h, this).on("dragstart", d, this).on("dragend",
|
|
6660
|
+
d.call(this), p.call(this), this._fireEdit();
|
|
6661
|
+
}, m.on("click", h, this).on("dragstart", d, this).on("dragend", p, this).on("touchmove", d, this), this._markerGroup.addLayer(m);
|
|
6662
6662
|
}, _updatePrevNext: function(o, r) {
|
|
6663
6663
|
o && (o._next = r), r && (r._prev = o);
|
|
6664
6664
|
}, _getMiddleLatLng: function(o, r) {
|
|
6665
|
-
var h = this._poly._map, d = h.project(o.getLatLng()),
|
|
6666
|
-
return h.unproject(d._add(
|
|
6665
|
+
var h = this._poly._map, d = h.project(o.getLatLng()), p = h.project(r.getLatLng());
|
|
6666
|
+
return h.unproject(d._add(p)._divideBy(2));
|
|
6667
6667
|
} }), L.Polyline.addInitHook(function() {
|
|
6668
6668
|
this.editing || (L.Edit.Poly && (this.editing = new L.Edit.Poly(this), this.options.editable && this.editing.enable()), this.on("add", function() {
|
|
6669
6669
|
this.editing && this.editing.enabled() && this.editing.addHooks();
|
|
@@ -6736,7 +6736,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6736
6736
|
var r, h, d = o.target;
|
|
6737
6737
|
d === this._moveMarker && (r = this._shape.getBounds(), h = r.getCenter(), d.setLatLng(h)), this._toggleCornerMarkers(1), this._repositionCornerMarkers(), L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this, o);
|
|
6738
6738
|
}, _move: function(o) {
|
|
6739
|
-
for (var r, h = this._shape._defaultShape ? this._shape._defaultShape() : this._shape.getLatLngs(), d = this._shape.getBounds(),
|
|
6739
|
+
for (var r, h = this._shape._defaultShape ? this._shape._defaultShape() : this._shape.getLatLngs(), d = this._shape.getBounds(), p = d.getCenter(), g = [], m = 0, y = h.length; m < y; m++) r = [h[m].lat - p.lat, h[m].lng - p.lng], g.push([o.lat + r[0], o.lng + r[1]]);
|
|
6740
6740
|
this._shape.setLatLngs(g), this._repositionCornerMarkers(), this._map.fire(L.Draw.Event.EDITMOVE, { layer: this._shape });
|
|
6741
6741
|
}, _resize: function(o) {
|
|
6742
6742
|
var r;
|
|
@@ -6790,8 +6790,8 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6790
6790
|
if (!o.touches.length) return;
|
|
6791
6791
|
h = o.touches[0];
|
|
6792
6792
|
} else if (o.pointerType !== "touch" || (h = o, !this._filterClick(o))) return;
|
|
6793
|
-
var d = this._map.mouseEventToContainerPoint(h),
|
|
6794
|
-
this._map.fire(r, { latlng: g, layerPoint:
|
|
6793
|
+
var d = this._map.mouseEventToContainerPoint(h), p = this._map.mouseEventToLayerPoint(h), g = this._map.layerPointToLatLng(p);
|
|
6794
|
+
this._map.fire(r, { latlng: g, layerPoint: p, containerPoint: d, pageX: h.pageX, pageY: h.pageY, originalEvent: o });
|
|
6795
6795
|
}, _filterClick: function(o) {
|
|
6796
6796
|
var r = o.timeStamp || o.originalEvent.timeStamp, h = L.DomEvent._lastClick && r - L.DomEvent._lastClick;
|
|
6797
6797
|
return h && h > 100 && h < 500 || o.target._simulatedClick && !o._simulated ? (L.DomEvent.stop(o), !1) : (L.DomEvent._lastClick = r, !0);
|
|
@@ -6809,7 +6809,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6809
6809
|
}, _onTouchMove: function(o) {
|
|
6810
6810
|
this._map._loaded && this._touchEvent(o, "touchmove");
|
|
6811
6811
|
}, _detectIE: function() {
|
|
6812
|
-
var o =
|
|
6812
|
+
var o = J.navigator.userAgent, r = o.indexOf("MSIE ");
|
|
6813
6813
|
if (r > 0) return parseInt(o.substring(r + 5, o.indexOf(".", r)), 10);
|
|
6814
6814
|
if (o.indexOf("Trident/") > 0) {
|
|
6815
6815
|
var h = o.indexOf("rv:");
|
|
@@ -6827,7 +6827,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6827
6827
|
L.Handler.MarkerDrag && (this.dragging = new L.Handler.MarkerDrag(this), this.options.draggable && this.dragging.enable());
|
|
6828
6828
|
}
|
|
6829
6829
|
}, _detectIE: function() {
|
|
6830
|
-
var o =
|
|
6830
|
+
var o = J.navigator.userAgent, r = o.indexOf("MSIE ");
|
|
6831
6831
|
if (r > 0) return parseInt(o.substring(r + 5, o.indexOf(".", r)), 10);
|
|
6832
6832
|
if (o.indexOf("Trident/") > 0) {
|
|
6833
6833
|
var h = o.indexOf("rv:");
|
|
@@ -6843,25 +6843,25 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6843
6843
|
} }, function() {
|
|
6844
6844
|
var o = { km: 2, ha: 2, m: 0, mi: 2, ac: 2, yd: 0, ft: 0, nm: 2 };
|
|
6845
6845
|
L.GeometryUtil = L.extend(L.GeometryUtil || {}, { geodesicArea: function(r) {
|
|
6846
|
-
var h, d,
|
|
6847
|
-
if (
|
|
6848
|
-
for (var y = 0; y <
|
|
6846
|
+
var h, d, p = r.length, g = 0, m = Math.PI / 180;
|
|
6847
|
+
if (p > 2) {
|
|
6848
|
+
for (var y = 0; y < p; y++) h = r[y], d = r[(y + 1) % p], g += (d.lng - h.lng) * m * (2 + Math.sin(h.lat * m) + Math.sin(d.lat * m));
|
|
6849
6849
|
g = 6378137 * g * 6378137 / 2;
|
|
6850
6850
|
}
|
|
6851
6851
|
return Math.abs(g);
|
|
6852
6852
|
}, formattedNumber: function(r, h) {
|
|
6853
|
-
var d = parseFloat(r).toFixed(h),
|
|
6853
|
+
var d = parseFloat(r).toFixed(h), p = L.drawLocal.format && L.drawLocal.format.numeric, g = p && p.delimiters, m = g && g.thousands, y = g && g.decimal;
|
|
6854
6854
|
if (m || y) {
|
|
6855
|
-
var
|
|
6856
|
-
d = m ?
|
|
6855
|
+
var O = d.split(".");
|
|
6856
|
+
d = m ? O[0].replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1" + m) : O[0], y = y || ".", O.length > 1 && (d = d + y + O[1]);
|
|
6857
6857
|
}
|
|
6858
6858
|
return d;
|
|
6859
6859
|
}, readableArea: function(r, h, m) {
|
|
6860
|
-
var
|
|
6861
|
-
return h ? (g = ["ha", "m"], type = typeof h, type === "string" ? g = [h] : type !== "boolean" && (g = h),
|
|
6862
|
-
}, readableDistance: function(r, h, d,
|
|
6860
|
+
var p, g, m = L.Util.extend({}, o, m);
|
|
6861
|
+
return h ? (g = ["ha", "m"], type = typeof h, type === "string" ? g = [h] : type !== "boolean" && (g = h), p = r >= 1e6 && g.indexOf("km") !== -1 ? L.GeometryUtil.formattedNumber(1e-6 * r, m.km) + " km²" : r >= 1e4 && g.indexOf("ha") !== -1 ? L.GeometryUtil.formattedNumber(1e-4 * r, m.ha) + " ha" : L.GeometryUtil.formattedNumber(r, m.m) + " m²") : (r /= 0.836127, p = r >= 3097600 ? L.GeometryUtil.formattedNumber(r / 3097600, m.mi) + " mi²" : r >= 4840 ? L.GeometryUtil.formattedNumber(r / 4840, m.ac) + " acres" : L.GeometryUtil.formattedNumber(r, m.yd) + " yd²"), p;
|
|
6862
|
+
}, readableDistance: function(r, h, d, p, y) {
|
|
6863
6863
|
var m, y = L.Util.extend({}, o, y);
|
|
6864
|
-
switch (h ? typeof h == "string" ? h : "metric" : d ? "feet" :
|
|
6864
|
+
switch (h ? typeof h == "string" ? h : "metric" : d ? "feet" : p ? "nauticalMile" : "yards") {
|
|
6865
6865
|
case "metric":
|
|
6866
6866
|
m = r > 1e3 ? L.GeometryUtil.formattedNumber(r / 1e3, y.km) + " km" : L.GeometryUtil.formattedNumber(r, y.m) + " m";
|
|
6867
6867
|
break;
|
|
@@ -6885,30 +6885,30 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6885
6885
|
}, _checkCounterclockwise: function(o, r, h) {
|
|
6886
6886
|
return (h.y - o.y) * (r.x - o.x) > (r.y - o.y) * (h.x - o.x);
|
|
6887
6887
|
} }), L.Polyline.include({ intersects: function() {
|
|
6888
|
-
var o, r, h, d = this._getProjectedPoints(),
|
|
6888
|
+
var o, r, h, d = this._getProjectedPoints(), p = d ? d.length : 0;
|
|
6889
6889
|
if (this._tooFewPointsForIntersection()) return !1;
|
|
6890
|
-
for (o =
|
|
6890
|
+
for (o = p - 1; o >= 3; o--) if (r = d[o - 1], h = d[o], this._lineSegmentsIntersectsRange(r, h, o - 2)) return !0;
|
|
6891
6891
|
return !1;
|
|
6892
6892
|
}, newLatLngIntersects: function(o, r) {
|
|
6893
6893
|
return !!this._map && this.newPointIntersects(this._map.latLngToLayerPoint(o), r);
|
|
6894
6894
|
}, newPointIntersects: function(o, r) {
|
|
6895
|
-
var h = this._getProjectedPoints(), d = h ? h.length : 0,
|
|
6896
|
-
return !this._tooFewPointsForIntersection(1) && this._lineSegmentsIntersectsRange(
|
|
6895
|
+
var h = this._getProjectedPoints(), d = h ? h.length : 0, p = h ? h[d - 1] : null, g = d - 2;
|
|
6896
|
+
return !this._tooFewPointsForIntersection(1) && this._lineSegmentsIntersectsRange(p, o, g, r ? 1 : 0);
|
|
6897
6897
|
}, _tooFewPointsForIntersection: function(o) {
|
|
6898
6898
|
var r = this._getProjectedPoints(), h = r ? r.length : 0;
|
|
6899
6899
|
return h += o || 0, !r || h <= 3;
|
|
6900
6900
|
}, _lineSegmentsIntersectsRange: function(o, r, h, d) {
|
|
6901
|
-
var
|
|
6901
|
+
var p, g, m = this._getProjectedPoints();
|
|
6902
6902
|
d = d || 0;
|
|
6903
|
-
for (var y = h; y > d; y--) if (
|
|
6903
|
+
for (var y = h; y > d; y--) if (p = m[y - 1], g = m[y], L.LineUtil.segmentsIntersect(o, r, p, g)) return !0;
|
|
6904
6904
|
return !1;
|
|
6905
6905
|
}, _getProjectedPoints: function() {
|
|
6906
6906
|
if (!this._defaultShape) return this._originalPoints;
|
|
6907
6907
|
for (var o = [], r = this._defaultShape(), h = 0; h < r.length; h++) o.push(this._map.latLngToLayerPoint(r[h]));
|
|
6908
6908
|
return o;
|
|
6909
6909
|
} }), L.Polygon.include({ intersects: function() {
|
|
6910
|
-
var o, r, h, d,
|
|
6911
|
-
return !this._tooFewPointsForIntersection() && (!!L.Polyline.prototype.intersects.call(this) || (o =
|
|
6910
|
+
var o, r, h, d, p = this._getProjectedPoints();
|
|
6911
|
+
return !this._tooFewPointsForIntersection() && (!!L.Polyline.prototype.intersects.call(this) || (o = p.length, r = p[0], h = p[o - 1], d = o - 2, this._lineSegmentsIntersectsRange(h, r, d, 1)));
|
|
6912
6912
|
} }), L.Control.Draw = L.Control.extend({ options: { position: "topleft", draw: {}, edit: !1 }, initialize: function(o) {
|
|
6913
6913
|
if (L.version < "0.7") throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");
|
|
6914
6914
|
L.Control.prototype.initialize.call(this, o);
|
|
@@ -6916,7 +6916,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6916
6916
|
this._toolbars = {}, L.DrawToolbar && this.options.draw && (r = new L.DrawToolbar(this.options.draw), this._toolbars[L.DrawToolbar.TYPE] = r, this._toolbars[L.DrawToolbar.TYPE].on("enable", this._toolbarEnabled, this)), L.EditToolbar && this.options.edit && (r = new L.EditToolbar(this.options.edit), this._toolbars[L.EditToolbar.TYPE] = r, this._toolbars[L.EditToolbar.TYPE].on("enable", this._toolbarEnabled, this)), L.toolbar = this;
|
|
6917
6917
|
}, onAdd: function(o) {
|
|
6918
6918
|
var r, h = L.DomUtil.create("div", "leaflet-draw"), d = !1;
|
|
6919
|
-
for (var
|
|
6919
|
+
for (var p in this._toolbars) this._toolbars.hasOwnProperty(p) && (r = this._toolbars[p].addToolbar(o)) && (d || (L.DomUtil.hasClass(r, "leaflet-draw-toolbar-top") || L.DomUtil.addClass(r.childNodes[0], "leaflet-draw-toolbar-top"), d = !0), h.appendChild(r));
|
|
6920
6920
|
return h;
|
|
6921
6921
|
}, onRemove: function() {
|
|
6922
6922
|
for (var o in this._toolbars) this._toolbars.hasOwnProperty(o) && this._toolbars[o].removeToolbar();
|
|
@@ -6936,19 +6936,19 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6936
6936
|
}, disable: function() {
|
|
6937
6937
|
this.enabled() && this._activeMode.handler.disable();
|
|
6938
6938
|
}, addToolbar: function(o) {
|
|
6939
|
-
var r, h = L.DomUtil.create("div", "leaflet-draw-section"), d = 0,
|
|
6940
|
-
for (this._toolbarContainer = L.DomUtil.create("div", "leaflet-draw-toolbar leaflet-bar"), this._map = o, r = 0; r < g.length; r++) g[r].enabled && this._initModeHandler(g[r].handler, this._toolbarContainer, d++,
|
|
6939
|
+
var r, h = L.DomUtil.create("div", "leaflet-draw-section"), d = 0, p = this._toolbarClass || "", g = this.getModeHandlers(o);
|
|
6940
|
+
for (this._toolbarContainer = L.DomUtil.create("div", "leaflet-draw-toolbar leaflet-bar"), this._map = o, r = 0; r < g.length; r++) g[r].enabled && this._initModeHandler(g[r].handler, this._toolbarContainer, d++, p, g[r].title);
|
|
6941
6941
|
if (d) return this._lastButtonIndex = --d, this._actionsContainer = L.DomUtil.create("ul", "leaflet-draw-actions"), h.appendChild(this._toolbarContainer), h.appendChild(this._actionsContainer), h;
|
|
6942
6942
|
}, removeToolbar: function() {
|
|
6943
6943
|
for (var o in this._modes) this._modes.hasOwnProperty(o) && (this._disposeButton(this._modes[o].button, this._modes[o].handler.enable, this._modes[o].handler), this._modes[o].handler.disable(), this._modes[o].handler.off("enabled", this._handlerActivated, this).off("disabled", this._handlerDeactivated, this));
|
|
6944
6944
|
this._modes = {};
|
|
6945
6945
|
for (var r = 0, h = this._actionButtons.length; r < h; r++) this._disposeButton(this._actionButtons[r].button, this._actionButtons[r].callback, this);
|
|
6946
6946
|
this._actionButtons = [], this._actionsContainer = null;
|
|
6947
|
-
}, _initModeHandler: function(o, r, h, d,
|
|
6947
|
+
}, _initModeHandler: function(o, r, h, d, p) {
|
|
6948
6948
|
var g = o.type;
|
|
6949
|
-
this._modes[g] = {}, this._modes[g].handler = o, this._modes[g].button = this._createButton({ type: g, title:
|
|
6949
|
+
this._modes[g] = {}, this._modes[g].handler = o, this._modes[g].button = this._createButton({ type: g, title: p, className: d + "-" + g, container: r, callback: this._modes[g].handler.enable, context: this._modes[g].handler }), this._modes[g].buttonIndex = h, this._modes[g].handler.on("enabled", this._handlerActivated, this).on("disabled", this._handlerDeactivated, this);
|
|
6950
6950
|
}, _detectIOS: function() {
|
|
6951
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !
|
|
6951
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !J.MSStream;
|
|
6952
6952
|
}, _createButton: function(o) {
|
|
6953
6953
|
var r = L.DomUtil.create("a", o.className || "", o.container), h = L.DomUtil.create("span", "sr-only", o.container);
|
|
6954
6954
|
r.href = "#", r.appendChild(h), o.title && (r.title = o.title, h.innerHTML = o.title), o.text && (r.innerHTML = o.text, h.innerHTML = o.text);
|
|
@@ -6962,10 +6962,10 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
6962
6962
|
}, _handlerDeactivated: function() {
|
|
6963
6963
|
this._hideActionsToolbar(), L.DomUtil.removeClass(this._activeMode.button, "leaflet-draw-toolbar-button-enabled"), this._activeMode = null, this.fire("disable");
|
|
6964
6964
|
}, _createActions: function(o) {
|
|
6965
|
-
var r, h, d,
|
|
6965
|
+
var r, h, d, p, g = this._actionsContainer, m = this.getActions(o), y = m.length;
|
|
6966
6966
|
for (h = 0, d = this._actionButtons.length; h < d; h++) this._disposeButton(this._actionButtons[h].button, this._actionButtons[h].callback);
|
|
6967
6967
|
for (this._actionButtons = []; g.firstChild; ) g.removeChild(g.firstChild);
|
|
6968
|
-
for (var
|
|
6968
|
+
for (var O = 0; O < y; O++) "enabled" in m[O] && !m[O].enabled || (r = L.DomUtil.create("li", "", g), p = this._createButton({ title: m[O].title, text: m[O].text, container: r, callback: m[O].callback, context: m[O].context }), this._actionButtons.push({ button: p, callback: m[O].callback }));
|
|
6969
6969
|
}, _showActionsToolbar: function() {
|
|
6970
6970
|
var o = this._activeMode.buttonIndex, r = this._lastButtonIndex, h = this._activeMode.button.offsetTop - 1;
|
|
6971
6971
|
this._createActions(this._activeMode.handler), this._actionsContainer.style.top = h + "px", o === 0 && (L.DomUtil.addClass(this._toolbarContainer, "leaflet-draw-toolbar-notop"), L.DomUtil.addClass(this._actionsContainer, "leaflet-draw-actions-top")), o === r && (L.DomUtil.addClass(this._toolbarContainer, "leaflet-draw-toolbar-nobottom"), L.DomUtil.addClass(this._actionsContainer, "leaflet-draw-actions-bottom")), this._actionsContainer.style.display = "block", this._map.fire(L.Draw.Event.TOOLBAROPENED);
|
|
@@ -7107,7 +7107,7 @@ const vt = /* @__PURE__ */ qo(Yo);
|
|
|
7107
7107
|
})(window, document);
|
|
7108
7108
|
class jo extends HTMLElement {
|
|
7109
7109
|
constructor() {
|
|
7110
|
-
super(), this.drawnItems = new
|
|
7110
|
+
super(), this.drawnItems = new pt.FeatureGroup(), this.readonly = !1, this.isReady = !1, this.isGeolocating = !1, this.pendingActions = [], this.attachShadow({ mode: "open" });
|
|
7111
7111
|
}
|
|
7112
7112
|
connectedCallback() {
|
|
7113
7113
|
this.shadowRoot && (this.shadowRoot.innerHTML = `
|
|
@@ -7134,22 +7134,21 @@ class jo extends HTMLElement {
|
|
|
7134
7134
|
<div id="map"></div>
|
|
7135
7135
|
`, this.initMap(), this.initDraw());
|
|
7136
7136
|
}
|
|
7137
|
-
runOrQueue(
|
|
7137
|
+
runOrQueue(D) {
|
|
7138
7138
|
if (!this.isReady) {
|
|
7139
|
-
this.pendingActions.push(
|
|
7139
|
+
this.pendingActions.push(D);
|
|
7140
7140
|
return;
|
|
7141
7141
|
}
|
|
7142
|
-
|
|
7142
|
+
D();
|
|
7143
7143
|
}
|
|
7144
7144
|
initMap() {
|
|
7145
|
-
const
|
|
7146
|
-
this.map =
|
|
7145
|
+
const D = this.shadowRoot.getElementById("map");
|
|
7146
|
+
this.map = pt.map(D).setView([0, 0], 2), pt.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
|
7147
7147
|
attribution: "© OpenStreetMap contributors"
|
|
7148
|
-
}).addTo(this.map), this.map.addLayer(this.drawnItems), this.isReady = !0, this.pendingActions.forEach((
|
|
7148
|
+
}).addTo(this.map), this.map.addLayer(this.drawnItems), this.isReady = !0, this.pendingActions.forEach((f) => f()), this.pendingActions = [], this.maybeUseGeolocation();
|
|
7149
7149
|
}
|
|
7150
7150
|
initDraw() {
|
|
7151
|
-
|
|
7152
|
-
const B = new vt.Control.Draw({
|
|
7151
|
+
this.map && (this.drawControl = new pt.Control.Draw({
|
|
7153
7152
|
edit: {
|
|
7154
7153
|
featureGroup: this.drawnItems
|
|
7155
7154
|
},
|
|
@@ -7161,52 +7160,135 @@ class jo extends HTMLElement {
|
|
|
7161
7160
|
marker: !1,
|
|
7162
7161
|
circlemarker: !1
|
|
7163
7162
|
}
|
|
7164
|
-
})
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7163
|
+
}), this.map.addControl(this.drawControl), this.map.on(pt.Draw.Event.CREATED, (D) => {
|
|
7164
|
+
const f = D.layer;
|
|
7165
|
+
f.setStyle({
|
|
7166
|
+
color: "#1d4ed8",
|
|
7167
|
+
weight: 3,
|
|
7168
|
+
opacity: 1,
|
|
7169
|
+
fillColor: "#3b82f6",
|
|
7170
|
+
fillOpacity: 0.35
|
|
7171
|
+
}), this.drawnItems.addLayer(f), this.emitChange();
|
|
7172
|
+
}), this.map.on(pt.Draw.Event.EDITED, (D) => {
|
|
7173
|
+
D.layers.eachLayer((f) => {
|
|
7174
|
+
f.setStyle({
|
|
7175
|
+
color: "#1d4ed8",
|
|
7176
|
+
weight: 3,
|
|
7177
|
+
fillColor: "#3b82f6",
|
|
7178
|
+
fillOpacity: 0.35
|
|
7179
|
+
});
|
|
7180
|
+
}), this.emitChange();
|
|
7181
|
+
}), this.map.on(pt.Draw.Event.DELETED, () => {
|
|
7170
7182
|
this.emitChange();
|
|
7171
|
-
});
|
|
7183
|
+
}));
|
|
7172
7184
|
}
|
|
7173
7185
|
emitChange() {
|
|
7174
|
-
const
|
|
7186
|
+
const D = this.getGeoJSON();
|
|
7175
7187
|
this.dispatchEvent(
|
|
7176
7188
|
new CustomEvent("change", {
|
|
7177
|
-
detail: { geojson:
|
|
7189
|
+
detail: { geojson: D }
|
|
7178
7190
|
})
|
|
7179
7191
|
);
|
|
7180
7192
|
}
|
|
7181
7193
|
// =========================
|
|
7182
|
-
// Public API (v0.
|
|
7194
|
+
// Public API (v0.3)
|
|
7183
7195
|
// =========================
|
|
7184
|
-
|
|
7185
|
-
return this.
|
|
7186
|
-
|
|
7187
|
-
|
|
7196
|
+
async enableGeolocation() {
|
|
7197
|
+
return this.map ? "geolocation" in navigator ? this.isGeolocating ? {
|
|
7198
|
+
status: "pending"
|
|
7199
|
+
} : (this.isGeolocating = !0, new Promise((D) => {
|
|
7200
|
+
navigator.geolocation.getCurrentPosition(
|
|
7201
|
+
(f) => {
|
|
7202
|
+
const { latitude: W, longitude: o } = f.coords;
|
|
7203
|
+
this.map.setView([W, o], 13), this.isGeolocating = !1, this.dispatchEvent(
|
|
7204
|
+
new CustomEvent("geolocation:success", {
|
|
7205
|
+
detail: { lat: W, lng: o }
|
|
7206
|
+
})
|
|
7207
|
+
), D({
|
|
7208
|
+
status: "granted",
|
|
7209
|
+
position: { lat: W, lng: o }
|
|
7210
|
+
});
|
|
7211
|
+
},
|
|
7212
|
+
(f) => {
|
|
7213
|
+
this.isGeolocating = !1, this.dispatchEvent(
|
|
7214
|
+
new CustomEvent("geolocation:error", {
|
|
7215
|
+
detail: f
|
|
7216
|
+
})
|
|
7217
|
+
), D({
|
|
7218
|
+
status: "denied",
|
|
7219
|
+
error: {
|
|
7220
|
+
code: f.code,
|
|
7221
|
+
message: f.message
|
|
7222
|
+
}
|
|
7223
|
+
});
|
|
7224
|
+
}
|
|
7225
|
+
);
|
|
7226
|
+
})) : {
|
|
7227
|
+
status: "error",
|
|
7228
|
+
error: { message: "Geolocation not supported" }
|
|
7229
|
+
} : {
|
|
7230
|
+
status: "error",
|
|
7231
|
+
error: { message: "Map is not ready" }
|
|
7188
7232
|
};
|
|
7189
7233
|
}
|
|
7190
|
-
|
|
7234
|
+
getGeoJSON() {
|
|
7235
|
+
return this.drawnItems.toGeoJSON();
|
|
7236
|
+
}
|
|
7237
|
+
setGeoJSON(D) {
|
|
7191
7238
|
this.runOrQueue(() => {
|
|
7192
|
-
if (!this.map
|
|
7239
|
+
if (!this.map) return;
|
|
7193
7240
|
this.drawnItems.clearLayers();
|
|
7194
|
-
const
|
|
7241
|
+
const W = pt.geoJSON(D, {
|
|
7195
7242
|
onEachFeature: (o, r) => {
|
|
7196
7243
|
this.drawnItems.addLayer(r);
|
|
7197
7244
|
}
|
|
7198
7245
|
}).getBounds();
|
|
7199
|
-
|
|
7246
|
+
W.isValid() && this.map.fitBounds(W), this.emitChange();
|
|
7200
7247
|
});
|
|
7201
7248
|
}
|
|
7202
|
-
|
|
7249
|
+
clear() {
|
|
7203
7250
|
this.runOrQueue(() => {
|
|
7204
|
-
this.
|
|
7251
|
+
this.drawnItems && (this.drawnItems.clearLayers(), this.emitChange());
|
|
7205
7252
|
});
|
|
7206
7253
|
}
|
|
7207
|
-
|
|
7254
|
+
getBoundary() {
|
|
7255
|
+
return this.boundaryLayer ? this.boundaryLayer.toGeoJSON() : null;
|
|
7256
|
+
}
|
|
7257
|
+
setBoundary(D) {
|
|
7208
7258
|
this.runOrQueue(() => {
|
|
7209
|
-
|
|
7259
|
+
if (!this.map) return;
|
|
7260
|
+
this.boundaryLayer && (this.map.removeLayer(this.boundaryLayer), this.boundaryLayer = void 0), this.boundaryLayer = pt.geoJSON(D, {
|
|
7261
|
+
interactive: !1,
|
|
7262
|
+
style: {
|
|
7263
|
+
color: "#2563eb",
|
|
7264
|
+
weight: 2,
|
|
7265
|
+
opacity: 0.9,
|
|
7266
|
+
fillColor: "#2563eb",
|
|
7267
|
+
fillOpacity: 0.05,
|
|
7268
|
+
// KEY: very light fill
|
|
7269
|
+
dashArray: "6 6"
|
|
7270
|
+
}
|
|
7271
|
+
}), this.boundaryLayer.addTo(this.map);
|
|
7272
|
+
const f = this.boundaryLayer.getBounds();
|
|
7273
|
+
f.isValid() && this.map.fitBounds(f);
|
|
7274
|
+
});
|
|
7275
|
+
}
|
|
7276
|
+
clearBoundary() {
|
|
7277
|
+
this.runOrQueue(() => {
|
|
7278
|
+
!this.map || !this.boundaryLayer || (this.map.removeLayer(this.boundaryLayer), this.boundaryLayer = void 0);
|
|
7279
|
+
});
|
|
7280
|
+
}
|
|
7281
|
+
setReadonly(D) {
|
|
7282
|
+
this.runOrQueue(() => {
|
|
7283
|
+
!this.map || !this.drawControl || this.readonly !== D && (this.readonly = D, D ? this.map.removeControl(this.drawControl) : this.map.addControl(this.drawControl));
|
|
7284
|
+
});
|
|
7285
|
+
}
|
|
7286
|
+
isReadonly() {
|
|
7287
|
+
return this.readonly;
|
|
7288
|
+
}
|
|
7289
|
+
setView(D, f, W) {
|
|
7290
|
+
this.runOrQueue(() => {
|
|
7291
|
+
this.map && (typeof W == "number" ? this.map.setView([D, f], W) : this.map.panTo([D, f]));
|
|
7210
7292
|
});
|
|
7211
7293
|
}
|
|
7212
7294
|
}
|