@maptiler/geocoding-control 1.4.2-dev.3 → 2.0.0-rc.1
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/MapLibreBasedGeocodingControl.d.ts +2971 -35
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +580 -569
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +3 -3
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +74 -16
- package/leaflet.js +1375 -1344
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +7 -7
- package/maplibregl-controller.js +683 -661
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +3 -3
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +1596 -1447
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1604 -1452
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +1 -1
- package/openlayers-controller.js +308 -306
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +3 -3
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +21 -0
- package/openlayers.js +1352 -1366
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +18 -18
- package/react.d.ts +4 -4
- package/react.js +805 -788
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte.d.ts +1 -1
- package/svelte/GeocodingControl.svelte +61 -32
- package/svelte/GeocodingControl.svelte.d.ts +24 -9
- package/svelte/MapLibreBasedGeocodingControl.d.ts +2971 -35
- package/svelte/MapLibreBasedGeocodingControl.js +166 -58
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +50 -24
- package/svelte/leaflet.d.ts +74 -16
- package/svelte/leaflet.js +25 -15
- package/svelte/maplibregl-controller.d.ts +7 -7
- package/svelte/maplibregl-controller.js +96 -66
- package/svelte/maplibregl.js +10 -7
- package/svelte/maptilersdk.js +23 -18
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +4 -1
- package/svelte/openlayers.d.ts +21 -0
- package/svelte/openlayers.js +30 -45
- package/svelte/react.d.ts +4 -4
- package/svelte/types.d.ts +32 -12
- package/svelte/vanilla.d.ts +14 -1
- package/svelte/vanilla.js +31 -8
- package/types.d.ts +32 -12
- package/vanilla.d.ts +14 -1
- package/vanilla.js +849 -804
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/maplibregl.d.ts +0 -16
- package/maptilersdk.d.ts +0 -11
- package/svelte/maplibregl.d.ts +0 -16
- package/svelte/maptilersdk.d.ts +0 -11
package/maplibregl-controller.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var te = Object.defineProperty;
|
|
2
|
+
var ee = (i, t, e) => t in i ? te(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var rt = (i, t, e) => ee(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function X(i, t, e = {}) {
|
|
5
5
|
const n = { type: "Feature" };
|
|
6
6
|
return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = i, n;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function yt(i, t, e = {}) {
|
|
9
9
|
for (const r of i) {
|
|
10
10
|
if (r.length < 4)
|
|
11
11
|
throw new Error(
|
|
@@ -17,17 +17,17 @@ function pt(i, t, e = {}) {
|
|
|
17
17
|
if (r[r.length - 1][o] !== r[0][o])
|
|
18
18
|
throw new Error("First and last Position are not equivalent.");
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return X({
|
|
21
21
|
type: "Polygon",
|
|
22
22
|
coordinates: i
|
|
23
23
|
}, t, e);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function V(i, t = {}) {
|
|
26
26
|
const e = { type: "FeatureCollection" };
|
|
27
27
|
return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features = i, e;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function jt(i, t, e = {}) {
|
|
30
|
+
return X({
|
|
31
31
|
type: "MultiPolygon",
|
|
32
32
|
coordinates: i
|
|
33
33
|
}, t, e);
|
|
@@ -54,67 +54,67 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
54
54
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
55
55
|
and limitations under the License.
|
|
56
56
|
***************************************************************************** */
|
|
57
|
-
function
|
|
57
|
+
function ne(i, t) {
|
|
58
58
|
var e = { label: 0, sent: function() {
|
|
59
59
|
if (o[0] & 1) throw o[1];
|
|
60
60
|
return o[1];
|
|
61
|
-
}, trys: [], ops: [] }, n, r, o,
|
|
62
|
-
return
|
|
61
|
+
}, trys: [], ops: [] }, n, r, o, f;
|
|
62
|
+
return f = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
|
|
63
63
|
return this;
|
|
64
|
-
}),
|
|
65
|
-
function
|
|
66
|
-
return function(
|
|
67
|
-
return c([
|
|
64
|
+
}), f;
|
|
65
|
+
function l(u) {
|
|
66
|
+
return function(p) {
|
|
67
|
+
return c([u, p]);
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function c(
|
|
70
|
+
function c(u) {
|
|
71
71
|
if (n) throw new TypeError("Generator is already executing.");
|
|
72
72
|
for (; e; ) try {
|
|
73
|
-
if (n = 1, r && (o =
|
|
74
|
-
switch (r = 0, o && (
|
|
73
|
+
if (n = 1, r && (o = u[0] & 2 ? r.return : u[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, u[1])).done) return o;
|
|
74
|
+
switch (r = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
|
|
75
75
|
case 0:
|
|
76
76
|
case 1:
|
|
77
|
-
o =
|
|
77
|
+
o = u;
|
|
78
78
|
break;
|
|
79
79
|
case 4:
|
|
80
|
-
return e.label++, { value:
|
|
80
|
+
return e.label++, { value: u[1], done: !1 };
|
|
81
81
|
case 5:
|
|
82
|
-
e.label++, r =
|
|
82
|
+
e.label++, r = u[1], u = [0];
|
|
83
83
|
continue;
|
|
84
84
|
case 7:
|
|
85
|
-
|
|
85
|
+
u = e.ops.pop(), e.trys.pop();
|
|
86
86
|
continue;
|
|
87
87
|
default:
|
|
88
|
-
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (
|
|
88
|
+
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
|
|
89
89
|
e = 0;
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
93
|
-
e.label =
|
|
92
|
+
if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
|
|
93
|
+
e.label = u[1];
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
97
|
-
e.label = o[1], o =
|
|
96
|
+
if (u[0] === 6 && e.label < o[1]) {
|
|
97
|
+
e.label = o[1], o = u;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
if (o && e.label < o[2]) {
|
|
101
|
-
e.label = o[2], e.ops.push(
|
|
101
|
+
e.label = o[2], e.ops.push(u);
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
o[2] && e.ops.pop(), e.trys.pop();
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
} catch (
|
|
109
|
-
|
|
107
|
+
u = t.call(i, e);
|
|
108
|
+
} catch (p) {
|
|
109
|
+
u = [6, p], r = 0;
|
|
110
110
|
} finally {
|
|
111
111
|
n = o = 0;
|
|
112
112
|
}
|
|
113
|
-
if (
|
|
114
|
-
return { value:
|
|
113
|
+
if (u[0] & 5) throw u[1];
|
|
114
|
+
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
var
|
|
117
|
+
var G = (
|
|
118
118
|
/** @class */
|
|
119
119
|
/* @__PURE__ */ function() {
|
|
120
120
|
function i(t, e) {
|
|
@@ -123,27 +123,27 @@ var F = (
|
|
|
123
123
|
return i;
|
|
124
124
|
}()
|
|
125
125
|
);
|
|
126
|
-
function
|
|
126
|
+
function ie(i, t) {
|
|
127
127
|
return i > t ? 1 : i < t ? -1 : 0;
|
|
128
128
|
}
|
|
129
129
|
function B(i, t, e) {
|
|
130
|
-
for (var n = new
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
130
|
+
for (var n = new G(null, null), r = n, o = n; ; ) {
|
|
131
|
+
var f = e(i, t.key);
|
|
132
|
+
if (f < 0) {
|
|
133
133
|
if (t.left === null)
|
|
134
134
|
break;
|
|
135
135
|
if (e(i, t.left.key) < 0) {
|
|
136
|
-
var
|
|
137
|
-
if (t.left =
|
|
136
|
+
var l = t.left;
|
|
137
|
+
if (t.left = l.right, l.right = t, t = l, t.left === null)
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
o.left = t, o = t, t = t.left;
|
|
141
|
-
} else if (
|
|
141
|
+
} else if (f > 0) {
|
|
142
142
|
if (t.right === null)
|
|
143
143
|
break;
|
|
144
144
|
if (e(i, t.right.key) > 0) {
|
|
145
|
-
var
|
|
146
|
-
if (t.right =
|
|
145
|
+
var l = t.right;
|
|
146
|
+
if (t.right = l.left, l.left = t, t = l, t.right === null)
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
r.right = t, r = t, t = t.right;
|
|
@@ -152,15 +152,15 @@ function B(i, t, e) {
|
|
|
152
152
|
}
|
|
153
153
|
return r.right = t.left, o.left = t.right, t.left = n.right, t.right = n.left, t;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
var r = new
|
|
155
|
+
function ot(i, t, e, n) {
|
|
156
|
+
var r = new G(i, t);
|
|
157
157
|
if (e === null)
|
|
158
158
|
return r.left = r.right = null, r;
|
|
159
159
|
e = B(i, e, n);
|
|
160
160
|
var o = n(i, e.key);
|
|
161
161
|
return o < 0 ? (r.left = e.left, r.right = e, e.left = null) : o >= 0 && (r.right = e.right, r.left = e, e.right = null), r;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Et(i, t, e) {
|
|
164
164
|
var n = null, r = null;
|
|
165
165
|
if (t) {
|
|
166
166
|
t = B(i, t, e);
|
|
@@ -169,30 +169,30 @@ function vt(i, t, e) {
|
|
|
169
169
|
}
|
|
170
170
|
return { left: n, right: r };
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function re(i, t, e) {
|
|
173
173
|
return t === null ? i : (i === null || (t = B(i.key, t, e), t.left = i), t);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ut(i, t, e, n, r) {
|
|
176
176
|
if (i) {
|
|
177
177
|
n("" + t + (e ? "└── " : "├── ") + r(i) + `
|
|
178
178
|
`);
|
|
179
179
|
var o = t + (e ? " " : "│ ");
|
|
180
|
-
i.left &&
|
|
180
|
+
i.left && ut(i.left, o, !1, n, r), i.right && ut(i.right, o, !0, n, r);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
var
|
|
183
|
+
var dt = (
|
|
184
184
|
/** @class */
|
|
185
185
|
function() {
|
|
186
186
|
function i(t) {
|
|
187
|
-
t === void 0 && (t =
|
|
187
|
+
t === void 0 && (t = ie), this._root = null, this._size = 0, this._comparator = t;
|
|
188
188
|
}
|
|
189
189
|
return i.prototype.insert = function(t, e) {
|
|
190
|
-
return this._size++, this._root =
|
|
190
|
+
return this._size++, this._root = ot(t, e, this._root, this._comparator);
|
|
191
191
|
}, i.prototype.add = function(t, e) {
|
|
192
|
-
var n = new
|
|
192
|
+
var n = new G(t, e);
|
|
193
193
|
this._root === null && (n.left = n.right = null, this._size++, this._root = n);
|
|
194
|
-
var r = this._comparator, o = B(t, this._root, r),
|
|
195
|
-
return
|
|
194
|
+
var r = this._comparator, o = B(t, this._root, r), f = r(t, o.key);
|
|
195
|
+
return f === 0 ? this._root = o : (f < 0 ? (n.left = o.left, n.right = o, o.left = null) : f > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
|
|
196
196
|
}, i.prototype.remove = function(t) {
|
|
197
197
|
this._root = this._remove(t, this._root, this._comparator);
|
|
198
198
|
}, i.prototype._remove = function(t, e, n) {
|
|
@@ -233,15 +233,15 @@ var yt = (
|
|
|
233
233
|
n !== null ? (r.push(n), n = n.left) : r.length !== 0 ? (n = r.pop(), t.call(e, n), n = n.right) : o = !0;
|
|
234
234
|
return this;
|
|
235
235
|
}, i.prototype.range = function(t, e, n, r) {
|
|
236
|
-
for (var o = [],
|
|
237
|
-
if (
|
|
238
|
-
o.push(
|
|
236
|
+
for (var o = [], f = this._comparator, l = this._root, c; o.length !== 0 || l; )
|
|
237
|
+
if (l)
|
|
238
|
+
o.push(l), l = l.left;
|
|
239
239
|
else {
|
|
240
|
-
if (
|
|
240
|
+
if (l = o.pop(), c = f(l.key, e), c > 0)
|
|
241
241
|
break;
|
|
242
|
-
if (
|
|
242
|
+
if (f(l.key, t) >= 0 && n.call(r, l))
|
|
243
243
|
return this;
|
|
244
|
-
|
|
244
|
+
l = l.right;
|
|
245
245
|
}
|
|
246
246
|
return this;
|
|
247
247
|
}, i.prototype.keys = function() {
|
|
@@ -312,15 +312,15 @@ var yt = (
|
|
|
312
312
|
}, i.prototype.clear = function() {
|
|
313
313
|
return this._root = null, this._size = 0, this;
|
|
314
314
|
}, i.prototype.toList = function() {
|
|
315
|
-
return
|
|
315
|
+
return se(this._root);
|
|
316
316
|
}, i.prototype.load = function(t, e, n) {
|
|
317
317
|
e === void 0 && (e = []), n === void 0 && (n = !1);
|
|
318
318
|
var r = t.length, o = this._comparator;
|
|
319
|
-
if (n &&
|
|
320
|
-
this._root =
|
|
319
|
+
if (n && ht(t, e, 0, r - 1, o), this._root === null)
|
|
320
|
+
this._root = ft(t, e, 0, r), this._size = r;
|
|
321
321
|
else {
|
|
322
|
-
var
|
|
323
|
-
r = this._size + r, this._root =
|
|
322
|
+
var f = le(this.toList(), oe(t, e), o);
|
|
323
|
+
r = this._size + r, this._root = ct({ head: f }, 0, r);
|
|
324
324
|
}
|
|
325
325
|
return this;
|
|
326
326
|
}, i.prototype.isEmpty = function() {
|
|
@@ -342,17 +342,17 @@ var yt = (
|
|
|
342
342
|
return String(n.key);
|
|
343
343
|
});
|
|
344
344
|
var e = [];
|
|
345
|
-
return
|
|
345
|
+
return ut(this._root, "", !0, function(n) {
|
|
346
346
|
return e.push(n);
|
|
347
347
|
}, t), e.join("");
|
|
348
348
|
}, i.prototype.update = function(t, e, n) {
|
|
349
|
-
var r = this._comparator, o =
|
|
350
|
-
r(t, e) < 0 ?
|
|
349
|
+
var r = this._comparator, o = Et(t, this._root, r), f = o.left, l = o.right;
|
|
350
|
+
r(t, e) < 0 ? l = ot(e, n, l, r) : f = ot(e, n, f, r), this._root = re(f, l, r);
|
|
351
351
|
}, i.prototype.split = function(t) {
|
|
352
|
-
return
|
|
352
|
+
return Et(t, this._root, this._comparator);
|
|
353
353
|
}, i.prototype[Symbol.iterator] = function() {
|
|
354
354
|
var t, e, n;
|
|
355
|
-
return
|
|
355
|
+
return ne(this, function(r) {
|
|
356
356
|
switch (r.label) {
|
|
357
357
|
case 0:
|
|
358
358
|
t = this._root, e = [], n = !1, r.label = 1;
|
|
@@ -376,69 +376,69 @@ var yt = (
|
|
|
376
376
|
}, i;
|
|
377
377
|
}()
|
|
378
378
|
);
|
|
379
|
-
function
|
|
379
|
+
function ft(i, t, e, n) {
|
|
380
380
|
var r = n - e;
|
|
381
381
|
if (r > 0) {
|
|
382
|
-
var o = e + Math.floor(r / 2),
|
|
383
|
-
return c.left =
|
|
382
|
+
var o = e + Math.floor(r / 2), f = i[o], l = t[o], c = new G(f, l);
|
|
383
|
+
return c.left = ft(i, t, e, o), c.right = ft(i, t, o + 1, n), c;
|
|
384
384
|
}
|
|
385
385
|
return null;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
for (var e = new
|
|
389
|
-
n = n.next = new
|
|
387
|
+
function oe(i, t) {
|
|
388
|
+
for (var e = new G(null, null), n = e, r = 0; r < i.length; r++)
|
|
389
|
+
n = n.next = new G(i[r], t[r]);
|
|
390
390
|
return n.next = null, e.next;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
for (var t = i, e = [], n = !1, r = new
|
|
392
|
+
function se(i) {
|
|
393
|
+
for (var t = i, e = [], n = !1, r = new G(null, null), o = r; !n; )
|
|
394
394
|
t ? (e.push(t), t = t.left) : e.length > 0 ? (t = o = o.next = e.pop(), t = t.right) : n = !0;
|
|
395
395
|
return o.next = null, r.next;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function ct(i, t, e) {
|
|
398
398
|
var n = e - t;
|
|
399
399
|
if (n > 0) {
|
|
400
|
-
var r = t + Math.floor(n / 2), o =
|
|
401
|
-
return
|
|
400
|
+
var r = t + Math.floor(n / 2), o = ct(i, t, r), f = i.head;
|
|
401
|
+
return f.left = o, i.head = i.head.next, f.right = ct(i, r + 1, e), f;
|
|
402
402
|
}
|
|
403
403
|
return null;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
for (var n = new
|
|
407
|
-
e(o.key,
|
|
408
|
-
return o !== null ? r.next = o :
|
|
405
|
+
function le(i, t, e) {
|
|
406
|
+
for (var n = new G(null, null), r = n, o = i, f = t; o !== null && f !== null; )
|
|
407
|
+
e(o.key, f.key) < 0 ? (r.next = o, o = o.next) : (r.next = f, f = f.next), r = r.next;
|
|
408
|
+
return o !== null ? r.next = o : f !== null && (r.next = f), n.next;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function ht(i, t, e, n, r) {
|
|
411
411
|
if (!(e >= n)) {
|
|
412
|
-
for (var o = i[e + n >> 1],
|
|
412
|
+
for (var o = i[e + n >> 1], f = e - 1, l = n + 1; ; ) {
|
|
413
413
|
do
|
|
414
|
-
|
|
415
|
-
while (r(i[
|
|
414
|
+
f++;
|
|
415
|
+
while (r(i[f], o) < 0);
|
|
416
416
|
do
|
|
417
|
-
|
|
418
|
-
while (r(i[
|
|
419
|
-
if (
|
|
417
|
+
l--;
|
|
418
|
+
while (r(i[l], o) > 0);
|
|
419
|
+
if (f >= l)
|
|
420
420
|
break;
|
|
421
|
-
var c = i[
|
|
422
|
-
i[
|
|
421
|
+
var c = i[f];
|
|
422
|
+
i[f] = i[l], i[l] = c, c = t[f], t[f] = t[l], t[l] = c;
|
|
423
423
|
}
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
const O = 11102230246251565e-32, S = 134217729,
|
|
428
|
-
function
|
|
429
|
-
let o,
|
|
430
|
-
|
|
431
|
-
let
|
|
432
|
-
if (
|
|
433
|
-
for (
|
|
434
|
-
|
|
435
|
-
for (;
|
|
436
|
-
|
|
424
|
+
ht(i, t, e, l, r), ht(i, t, l + 1, n, r);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
const O = 11102230246251565e-32, S = 134217729, ue = (3 + 8 * O) * O;
|
|
428
|
+
function st(i, t, e, n, r) {
|
|
429
|
+
let o, f, l, c, u = t[0], p = n[0], s = 0, h = 0;
|
|
430
|
+
p > u == p > -u ? (o = u, u = t[++s]) : (o = p, p = n[++h]);
|
|
431
|
+
let g = 0;
|
|
432
|
+
if (s < i && h < e)
|
|
433
|
+
for (p > u == p > -u ? (f = u + o, l = o - (f - u), u = t[++s]) : (f = p + o, l = o - (f - p), p = n[++h]), o = f, l !== 0 && (r[g++] = l); s < i && h < e; )
|
|
434
|
+
p > u == p > -u ? (f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s]) : (f = o + p, c = f - o, l = o - (f - c) + (p - c), p = n[++h]), o = f, l !== 0 && (r[g++] = l);
|
|
435
|
+
for (; s < i; )
|
|
436
|
+
f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s], o = f, l !== 0 && (r[g++] = l);
|
|
437
437
|
for (; h < e; )
|
|
438
|
-
|
|
439
|
-
return (o !== 0 ||
|
|
438
|
+
f = o + p, c = f - o, l = o - (f - c) + (p - c), p = n[++h], o = f, l !== 0 && (r[g++] = l);
|
|
439
|
+
return (o !== 0 || g === 0) && (r[g++] = o), g;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function fe(i, t) {
|
|
442
442
|
let e = t[0];
|
|
443
443
|
for (let n = 1; n < i; n++) e += t[n];
|
|
444
444
|
return e;
|
|
@@ -446,26 +446,26 @@ function se(i, t) {
|
|
|
446
446
|
function J(i) {
|
|
447
447
|
return new Float64Array(i);
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
451
|
-
let
|
|
452
|
-
const R = i - r,
|
|
453
|
-
|
|
454
|
-
let A =
|
|
455
|
-
if (A >=
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const
|
|
462
|
-
return
|
|
463
|
-
}
|
|
464
|
-
function
|
|
465
|
-
const
|
|
466
|
-
return Math.abs(c) >=
|
|
467
|
-
}
|
|
468
|
-
const
|
|
449
|
+
const ce = (3 + 16 * O) * O, he = (2 + 12 * O) * O, ae = (9 + 64 * O) * O * O, U = J(4), mt = J(8), wt = J(12), bt = J(16), P = J(4);
|
|
450
|
+
function ge(i, t, e, n, r, o, f) {
|
|
451
|
+
let l, c, u, p, s, h, g, y, x, m, a, d, v, E, w, b, M, _;
|
|
452
|
+
const R = i - r, I = e - r, C = t - o, k = n - o;
|
|
453
|
+
E = R * k, h = S * R, g = h - (h - R), y = R - g, h = S * k, x = h - (h - k), m = k - x, w = y * m - (E - g * x - y * x - g * m), b = C * I, h = S * C, g = h - (h - C), y = C - g, h = S * I, x = h - (h - I), m = I - x, M = y * m - (b - g * x - y * x - g * m), a = w - M, s = w - a, U[0] = w - (a + s) + (s - M), d = E + a, s = d - E, v = E - (d - s) + (a - s), a = v - b, s = v - a, U[1] = v - (a + s) + (s - b), _ = d + a, s = _ - d, U[2] = d - (_ - s) + (a - s), U[3] = _;
|
|
454
|
+
let A = fe(4, U), Q = he * f;
|
|
455
|
+
if (A >= Q || -A >= Q || (s = i - R, l = i - (R + s) + (s - r), s = e - I, u = e - (I + s) + (s - r), s = t - C, c = t - (C + s) + (s - o), s = n - k, p = n - (k + s) + (s - o), l === 0 && c === 0 && u === 0 && p === 0) || (Q = ae * f + ue * Math.abs(A), A += R * p + k * l - (C * u + I * c), A >= Q || -A >= Q)) return A;
|
|
456
|
+
E = l * k, h = S * l, g = h - (h - l), y = l - g, h = S * k, x = h - (h - k), m = k - x, w = y * m - (E - g * x - y * x - g * m), b = c * I, h = S * c, g = h - (h - c), y = c - g, h = S * I, x = h - (h - I), m = I - x, M = y * m - (b - g * x - y * x - g * m), a = w - M, s = w - a, P[0] = w - (a + s) + (s - M), d = E + a, s = d - E, v = E - (d - s) + (a - s), a = v - b, s = v - a, P[1] = v - (a + s) + (s - b), _ = d + a, s = _ - d, P[2] = d - (_ - s) + (a - s), P[3] = _;
|
|
457
|
+
const Jt = st(4, U, 4, P, mt);
|
|
458
|
+
E = R * p, h = S * R, g = h - (h - R), y = R - g, h = S * p, x = h - (h - p), m = p - x, w = y * m - (E - g * x - y * x - g * m), b = C * u, h = S * C, g = h - (h - C), y = C - g, h = S * u, x = h - (h - u), m = u - x, M = y * m - (b - g * x - y * x - g * m), a = w - M, s = w - a, P[0] = w - (a + s) + (s - M), d = E + a, s = d - E, v = E - (d - s) + (a - s), a = v - b, s = v - a, P[1] = v - (a + s) + (s - b), _ = d + a, s = _ - d, P[2] = d - (_ - s) + (a - s), P[3] = _;
|
|
459
|
+
const Kt = st(Jt, mt, 4, P, wt);
|
|
460
|
+
E = l * p, h = S * l, g = h - (h - l), y = l - g, h = S * p, x = h - (h - p), m = p - x, w = y * m - (E - g * x - y * x - g * m), b = c * u, h = S * c, g = h - (h - c), y = c - g, h = S * u, x = h - (h - u), m = u - x, M = y * m - (b - g * x - y * x - g * m), a = w - M, s = w - a, P[0] = w - (a + s) + (s - M), d = E + a, s = d - E, v = E - (d - s) + (a - s), a = v - b, s = v - a, P[1] = v - (a + s) + (s - b), _ = d + a, s = _ - d, P[2] = d - (_ - s) + (a - s), P[3] = _;
|
|
461
|
+
const Ht = st(Kt, wt, 4, P, bt);
|
|
462
|
+
return bt[Ht - 1];
|
|
463
|
+
}
|
|
464
|
+
function pe(i, t, e, n, r, o) {
|
|
465
|
+
const f = (t - o) * (e - r), l = (i - r) * (n - o), c = f - l, u = Math.abs(f + l);
|
|
466
|
+
return Math.abs(c) >= ce * u ? c : -ge(i, t, e, n, r, o, u);
|
|
467
|
+
}
|
|
468
|
+
const F = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, at = (i, t) => {
|
|
469
469
|
if (t.ur.x < i.ll.x || i.ur.x < t.ll.x || t.ur.y < i.ll.y || i.ur.y < t.ll.y) return null;
|
|
470
470
|
const e = i.ll.x < t.ll.x ? t.ll.x : i.ll.x, n = i.ur.x < t.ur.x ? i.ur.x : t.ur.x, r = i.ll.y < t.ll.y ? t.ll.y : i.ll.y, o = i.ur.y < t.ur.y ? i.ur.y : t.ur.y;
|
|
471
471
|
return {
|
|
@@ -479,20 +479,20 @@ const D = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
};
|
|
482
|
-
let
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
if (-
|
|
482
|
+
let T = Number.EPSILON;
|
|
483
|
+
T === void 0 && (T = Math.pow(2, -52));
|
|
484
|
+
const ye = T * T, _t = (i, t) => {
|
|
485
|
+
if (-T < i && i < T && -T < t && t < T)
|
|
486
486
|
return 0;
|
|
487
487
|
const e = i - t;
|
|
488
|
-
return e * e <
|
|
488
|
+
return e * e < ye * i * t ? 0 : i < t ? -1 : 1;
|
|
489
489
|
};
|
|
490
|
-
class
|
|
490
|
+
class de {
|
|
491
491
|
constructor() {
|
|
492
492
|
this.reset();
|
|
493
493
|
}
|
|
494
494
|
reset() {
|
|
495
|
-
this.xRounder = new
|
|
495
|
+
this.xRounder = new St(), this.yRounder = new St();
|
|
496
496
|
}
|
|
497
497
|
round(t, e) {
|
|
498
498
|
return {
|
|
@@ -501,9 +501,9 @@ class ge {
|
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
class
|
|
504
|
+
class St {
|
|
505
505
|
constructor() {
|
|
506
|
-
this.tree = new
|
|
506
|
+
this.tree = new dt(), this.round(0);
|
|
507
507
|
}
|
|
508
508
|
// Note: this can rounds input values backwards or forwards.
|
|
509
509
|
// You might ask, why not restrict this to just rounding
|
|
@@ -514,16 +514,16 @@ class _t {
|
|
|
514
514
|
// angle for t-intersections).
|
|
515
515
|
round(t) {
|
|
516
516
|
const e = this.tree.add(t), n = this.tree.prev(e);
|
|
517
|
-
if (n !== null &&
|
|
517
|
+
if (n !== null && _t(e.key, n.key) === 0)
|
|
518
518
|
return this.tree.remove(t), n.key;
|
|
519
519
|
const r = this.tree.next(e);
|
|
520
|
-
return r !== null &&
|
|
520
|
+
return r !== null && _t(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
const n =
|
|
523
|
+
const Z = new de(), tt = (i, t) => i.x * t.y - i.y * t.x, Yt = (i, t) => i.x * t.x + i.y * t.y, Pt = (i, t, e) => {
|
|
524
|
+
const n = pe(i.x, i.y, t.x, t.y, e.x, e.y);
|
|
525
525
|
return n > 0 ? -1 : n < 0 ? 1 : 0;
|
|
526
|
-
},
|
|
526
|
+
}, et = (i) => Math.sqrt(Yt(i, i)), xe = (i, t, e) => {
|
|
527
527
|
const n = {
|
|
528
528
|
x: t.x - i.x,
|
|
529
529
|
y: t.y - i.y
|
|
@@ -531,8 +531,8 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
|
|
|
531
531
|
x: e.x - i.x,
|
|
532
532
|
y: e.y - i.y
|
|
533
533
|
};
|
|
534
|
-
return
|
|
535
|
-
},
|
|
534
|
+
return tt(r, n) / et(r) / et(n);
|
|
535
|
+
}, ve = (i, t, e) => {
|
|
536
536
|
const n = {
|
|
537
537
|
x: t.x - i.x,
|
|
538
538
|
y: t.y - i.y
|
|
@@ -540,34 +540,34 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
|
|
|
540
540
|
x: e.x - i.x,
|
|
541
541
|
y: e.y - i.y
|
|
542
542
|
};
|
|
543
|
-
return
|
|
544
|
-
},
|
|
543
|
+
return Yt(r, n) / et(r) / et(n);
|
|
544
|
+
}, Mt = (i, t, e) => t.y === 0 ? null : {
|
|
545
545
|
x: i.x + t.x / t.y * (e - i.y),
|
|
546
546
|
y: e
|
|
547
|
-
},
|
|
547
|
+
}, Lt = (i, t, e) => t.x === 0 ? null : {
|
|
548
548
|
x: e,
|
|
549
549
|
y: i.y + t.y / t.x * (e - i.x)
|
|
550
|
-
},
|
|
551
|
-
if (t.x === 0) return
|
|
552
|
-
if (n.x === 0) return
|
|
553
|
-
if (t.y === 0) return
|
|
554
|
-
if (n.y === 0) return
|
|
555
|
-
const r =
|
|
550
|
+
}, Ee = (i, t, e, n) => {
|
|
551
|
+
if (t.x === 0) return Lt(e, n, i.x);
|
|
552
|
+
if (n.x === 0) return Lt(i, t, e.x);
|
|
553
|
+
if (t.y === 0) return Mt(e, n, i.y);
|
|
554
|
+
if (n.y === 0) return Mt(i, t, e.y);
|
|
555
|
+
const r = tt(t, n);
|
|
556
556
|
if (r == 0) return null;
|
|
557
557
|
const o = {
|
|
558
558
|
x: e.x - i.x,
|
|
559
559
|
y: e.y - i.y
|
|
560
|
-
},
|
|
560
|
+
}, f = tt(o, t) / r, l = tt(o, n) / r, c = i.x + l * t.x, u = e.x + f * n.x, p = i.y + l * t.y, s = e.y + f * n.y, h = (c + u) / 2, g = (p + s) / 2;
|
|
561
561
|
return {
|
|
562
562
|
x: h,
|
|
563
|
-
y:
|
|
563
|
+
y: g
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
566
|
class L {
|
|
567
567
|
// for ordering sweep events in the sweep event queue
|
|
568
568
|
static compare(t, e) {
|
|
569
569
|
const n = L.comparePoints(t.point, e.point);
|
|
570
|
-
return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 :
|
|
570
|
+
return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 : z.compare(t.segment, e.segment));
|
|
571
571
|
}
|
|
572
572
|
// for ordering points in sweep line order
|
|
573
573
|
static comparePoints(t, e) {
|
|
@@ -622,25 +622,25 @@ class L {
|
|
|
622
622
|
const e = /* @__PURE__ */ new Map(), n = (r) => {
|
|
623
623
|
const o = r.otherSE;
|
|
624
624
|
e.set(r, {
|
|
625
|
-
sine:
|
|
626
|
-
cosine:
|
|
625
|
+
sine: xe(this.point, t.point, o.point),
|
|
626
|
+
cosine: ve(this.point, t.point, o.point)
|
|
627
627
|
});
|
|
628
628
|
};
|
|
629
629
|
return (r, o) => {
|
|
630
630
|
e.has(r) || n(r), e.has(o) || n(o);
|
|
631
631
|
const {
|
|
632
|
-
sine:
|
|
633
|
-
cosine:
|
|
632
|
+
sine: f,
|
|
633
|
+
cosine: l
|
|
634
634
|
} = e.get(r), {
|
|
635
635
|
sine: c,
|
|
636
|
-
cosine:
|
|
636
|
+
cosine: u
|
|
637
637
|
} = e.get(o);
|
|
638
|
-
return
|
|
638
|
+
return f >= 0 && c >= 0 ? l < u ? 1 : l > u ? -1 : 0 : f < 0 && c < 0 ? l < u ? -1 : l > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
let
|
|
643
|
-
class
|
|
642
|
+
let me = 0;
|
|
643
|
+
class z {
|
|
644
644
|
/* This compare() function is for ordering segments in the sweep
|
|
645
645
|
* line tree, and does so according to the following criteria:
|
|
646
646
|
*
|
|
@@ -655,60 +655,60 @@ class T {
|
|
|
655
655
|
* is directly on the right-more of the two left inputs.
|
|
656
656
|
*/
|
|
657
657
|
static compare(t, e) {
|
|
658
|
-
const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x,
|
|
659
|
-
if (
|
|
658
|
+
const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
|
|
659
|
+
if (f < n) return 1;
|
|
660
660
|
if (o < r) return -1;
|
|
661
|
-
const
|
|
661
|
+
const l = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, p = e.rightSE.point.y;
|
|
662
662
|
if (n < r) {
|
|
663
|
-
if (c <
|
|
664
|
-
if (c >
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
if (
|
|
663
|
+
if (c < l && c < u) return 1;
|
|
664
|
+
if (c > l && c > u) return -1;
|
|
665
|
+
const s = t.comparePoint(e.leftSE.point);
|
|
666
|
+
if (s < 0) return 1;
|
|
667
|
+
if (s > 0) return -1;
|
|
668
668
|
const h = e.comparePoint(t.rightSE.point);
|
|
669
669
|
return h !== 0 ? h : -1;
|
|
670
670
|
}
|
|
671
671
|
if (n > r) {
|
|
672
|
-
if (
|
|
673
|
-
if (
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
672
|
+
if (l < c && l < p) return -1;
|
|
673
|
+
if (l > c && l > p) return 1;
|
|
674
|
+
const s = e.comparePoint(t.leftSE.point);
|
|
675
|
+
if (s !== 0) return s;
|
|
676
676
|
const h = t.comparePoint(e.rightSE.point);
|
|
677
677
|
return h < 0 ? 1 : h > 0 ? -1 : 1;
|
|
678
678
|
}
|
|
679
|
-
if (
|
|
680
|
-
if (
|
|
681
|
-
if (o <
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
679
|
+
if (l < c) return -1;
|
|
680
|
+
if (l > c) return 1;
|
|
681
|
+
if (o < f) {
|
|
682
|
+
const s = e.comparePoint(t.rightSE.point);
|
|
683
|
+
if (s !== 0) return s;
|
|
684
684
|
}
|
|
685
|
-
if (o >
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
if (
|
|
685
|
+
if (o > f) {
|
|
686
|
+
const s = t.comparePoint(e.rightSE.point);
|
|
687
|
+
if (s < 0) return 1;
|
|
688
|
+
if (s > 0) return -1;
|
|
689
689
|
}
|
|
690
|
-
if (o !==
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
if (
|
|
690
|
+
if (o !== f) {
|
|
691
|
+
const s = u - l, h = o - n, g = p - c, y = f - r;
|
|
692
|
+
if (s > h && g < y) return 1;
|
|
693
|
+
if (s < h && g > y) return -1;
|
|
694
694
|
}
|
|
695
|
-
return o >
|
|
695
|
+
return o > f ? 1 : o < f || u < p ? -1 : u > p ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
|
|
696
696
|
}
|
|
697
697
|
/* Warning: a reference to ringWindings input will be stored,
|
|
698
698
|
* and possibly will be later modified */
|
|
699
699
|
constructor(t, e, n, r) {
|
|
700
|
-
this.id = ++
|
|
700
|
+
this.id = ++me, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
|
|
701
701
|
}
|
|
702
702
|
static fromRing(t, e, n) {
|
|
703
|
-
let r, o,
|
|
704
|
-
const
|
|
705
|
-
if (
|
|
706
|
-
r = t, o = e,
|
|
707
|
-
else if (
|
|
708
|
-
r = e, o = t,
|
|
703
|
+
let r, o, f;
|
|
704
|
+
const l = L.comparePoints(t, e);
|
|
705
|
+
if (l < 0)
|
|
706
|
+
r = t, o = e, f = 1;
|
|
707
|
+
else if (l > 0)
|
|
708
|
+
r = e, o = t, f = -1;
|
|
709
709
|
else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);
|
|
710
|
-
const c = new L(r, !0),
|
|
711
|
-
return new
|
|
710
|
+
const c = new L(r, !0), u = new L(o, !1);
|
|
711
|
+
return new z(c, u, [n], [f]);
|
|
712
712
|
}
|
|
713
713
|
/* When a segment is split, the rightSE is replaced with a new sweep event */
|
|
714
714
|
replaceRightSE(t) {
|
|
@@ -755,9 +755,9 @@ class T {
|
|
|
755
755
|
const e = this.leftSE.point, n = this.rightSE.point, r = this.vector();
|
|
756
756
|
if (e.x === n.x)
|
|
757
757
|
return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
|
|
758
|
-
const o = (t.y - e.y) / r.y,
|
|
759
|
-
if (t.x ===
|
|
760
|
-
const
|
|
758
|
+
const o = (t.y - e.y) / r.y, f = e.x + o * r.x;
|
|
759
|
+
if (t.x === f) return 0;
|
|
760
|
+
const l = (t.x - e.x) / r.x, c = e.y + l * r.y;
|
|
761
761
|
return t.y === c ? 0 : t.y < c ? -1 : 1;
|
|
762
762
|
}
|
|
763
763
|
/**
|
|
@@ -776,20 +776,20 @@ class T {
|
|
|
776
776
|
* Else, return null.
|
|
777
777
|
*/
|
|
778
778
|
getIntersection(t) {
|
|
779
|
-
const e = this.bbox(), n = t.bbox(), r =
|
|
779
|
+
const e = this.bbox(), n = t.bbox(), r = at(e, n);
|
|
780
780
|
if (r === null) return null;
|
|
781
|
-
const o = this.leftSE.point,
|
|
782
|
-
if (
|
|
783
|
-
return h && !
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
786
|
-
if (
|
|
787
|
-
return h &&
|
|
788
|
-
if (h &&
|
|
789
|
-
if (h) return
|
|
790
|
-
if (
|
|
791
|
-
const
|
|
792
|
-
return
|
|
781
|
+
const o = this.leftSE.point, f = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, u = F(e, l) && this.comparePoint(l) === 0, p = F(n, o) && t.comparePoint(o) === 0, s = F(e, c) && this.comparePoint(c) === 0, h = F(n, f) && t.comparePoint(f) === 0;
|
|
782
|
+
if (p && u)
|
|
783
|
+
return h && !s ? f : !h && s ? c : null;
|
|
784
|
+
if (p)
|
|
785
|
+
return s && o.x === c.x && o.y === c.y ? null : o;
|
|
786
|
+
if (u)
|
|
787
|
+
return h && f.x === l.x && f.y === l.y ? null : l;
|
|
788
|
+
if (h && s) return null;
|
|
789
|
+
if (h) return f;
|
|
790
|
+
if (s) return c;
|
|
791
|
+
const g = Ee(o, this.vector(), l, t.vector());
|
|
792
|
+
return g === null || !F(r, g) ? null : Z.round(g.x, g.y);
|
|
793
793
|
}
|
|
794
794
|
/**
|
|
795
795
|
* Split the given segment into multiple segments on the given points.
|
|
@@ -804,10 +804,10 @@ class T {
|
|
|
804
804
|
* Warning: input array of points is modified
|
|
805
805
|
*/
|
|
806
806
|
split(t) {
|
|
807
|
-
const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1),
|
|
807
|
+
const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1), f = this.rightSE;
|
|
808
808
|
this.replaceRightSE(o), e.push(o), e.push(r);
|
|
809
|
-
const
|
|
810
|
-
return L.comparePoints(
|
|
809
|
+
const l = new z(r, f, this.rings.slice(), this.windings.slice());
|
|
810
|
+
return L.comparePoints(l.leftSE.point, l.rightSE.point) > 0 && l.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), o.checkForConsuming()), e;
|
|
811
811
|
}
|
|
812
812
|
/* Swap which event is left and right */
|
|
813
813
|
swapEvents() {
|
|
@@ -822,7 +822,7 @@ class T {
|
|
|
822
822
|
let e = this, n = t;
|
|
823
823
|
for (; e.consumedBy; ) e = e.consumedBy;
|
|
824
824
|
for (; n.consumedBy; ) n = n.consumedBy;
|
|
825
|
-
const r =
|
|
825
|
+
const r = z.compare(e, n);
|
|
826
826
|
if (r !== 0) {
|
|
827
827
|
if (r > 0) {
|
|
828
828
|
const o = e;
|
|
@@ -832,9 +832,9 @@ class T {
|
|
|
832
832
|
const o = e;
|
|
833
833
|
e = n, n = o;
|
|
834
834
|
}
|
|
835
|
-
for (let o = 0,
|
|
836
|
-
const
|
|
837
|
-
|
|
835
|
+
for (let o = 0, f = n.rings.length; o < f; o++) {
|
|
836
|
+
const l = n.rings[o], c = n.windings[o], u = e.rings.indexOf(l);
|
|
837
|
+
u === -1 ? (e.rings.push(l), e.windings.push(c)) : e.windings[u] += c;
|
|
838
838
|
}
|
|
839
839
|
n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
|
|
840
840
|
}
|
|
@@ -865,25 +865,25 @@ class T {
|
|
|
865
865
|
multiPolys: []
|
|
866
866
|
};
|
|
867
867
|
const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
|
|
868
|
-
for (let
|
|
869
|
-
const
|
|
870
|
-
|
|
868
|
+
for (let l = 0, c = this.rings.length; l < c; l++) {
|
|
869
|
+
const u = this.rings[l], p = this.windings[l], s = e.indexOf(u);
|
|
870
|
+
s === -1 ? (e.push(u), n.push(p)) : n[s] += p;
|
|
871
871
|
}
|
|
872
|
-
const o = [],
|
|
873
|
-
for (let
|
|
874
|
-
if (n[
|
|
875
|
-
const
|
|
876
|
-
if (
|
|
877
|
-
if (
|
|
872
|
+
const o = [], f = [];
|
|
873
|
+
for (let l = 0, c = e.length; l < c; l++) {
|
|
874
|
+
if (n[l] === 0) continue;
|
|
875
|
+
const u = e[l], p = u.poly;
|
|
876
|
+
if (f.indexOf(p) === -1)
|
|
877
|
+
if (u.isExterior) o.push(p);
|
|
878
878
|
else {
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
|
|
879
|
+
f.indexOf(p) === -1 && f.push(p);
|
|
880
|
+
const s = o.indexOf(u.poly);
|
|
881
|
+
s !== -1 && o.splice(s, 1);
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
for (let
|
|
885
|
-
const
|
|
886
|
-
r.indexOf(
|
|
884
|
+
for (let l = 0, c = o.length; l < c; l++) {
|
|
885
|
+
const u = o[l].multiPoly;
|
|
886
|
+
r.indexOf(u) === -1 && r.push(u);
|
|
887
887
|
}
|
|
888
888
|
return this._afterState;
|
|
889
889
|
}
|
|
@@ -919,13 +919,13 @@ class T {
|
|
|
919
919
|
return this._isInResult;
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class Rt {
|
|
923
923
|
constructor(t, e, n) {
|
|
924
924
|
if (!Array.isArray(t) || t.length === 0)
|
|
925
925
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
926
926
|
if (this.poly = e, this.isExterior = n, this.segments = [], typeof t[0][0] != "number" || typeof t[0][1] != "number")
|
|
927
927
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
928
|
-
const r =
|
|
928
|
+
const r = Z.round(t[0][0], t[0][1]);
|
|
929
929
|
this.bbox = {
|
|
930
930
|
ll: {
|
|
931
931
|
x: r.x,
|
|
@@ -937,13 +937,13 @@ class Lt {
|
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
939
|
let o = r;
|
|
940
|
-
for (let
|
|
941
|
-
if (typeof t[
|
|
940
|
+
for (let f = 1, l = t.length; f < l; f++) {
|
|
941
|
+
if (typeof t[f][0] != "number" || typeof t[f][1] != "number")
|
|
942
942
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
943
|
-
let c =
|
|
944
|
-
c.x === o.x && c.y === o.y || (this.segments.push(
|
|
943
|
+
let c = Z.round(t[f][0], t[f][1]);
|
|
944
|
+
c.x === o.x && c.y === o.y || (this.segments.push(z.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
|
|
945
945
|
}
|
|
946
|
-
(r.x !== o.x || r.y !== o.y) && this.segments.push(
|
|
946
|
+
(r.x !== o.x || r.y !== o.y) && this.segments.push(z.fromRing(o, r, this));
|
|
947
947
|
}
|
|
948
948
|
getSweepEvents() {
|
|
949
949
|
const t = [];
|
|
@@ -954,11 +954,11 @@ class Lt {
|
|
|
954
954
|
return t;
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
class
|
|
957
|
+
class we {
|
|
958
958
|
constructor(t, e) {
|
|
959
959
|
if (!Array.isArray(t))
|
|
960
960
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
961
|
-
this.exteriorRing = new
|
|
961
|
+
this.exteriorRing = new Rt(t[0], this, !0), this.bbox = {
|
|
962
962
|
ll: {
|
|
963
963
|
x: this.exteriorRing.bbox.ll.x,
|
|
964
964
|
y: this.exteriorRing.bbox.ll.y
|
|
@@ -969,7 +969,7 @@ class ve {
|
|
|
969
969
|
}
|
|
970
970
|
}, this.interiorRings = [];
|
|
971
971
|
for (let n = 1, r = t.length; n < r; n++) {
|
|
972
|
-
const o = new
|
|
972
|
+
const o = new Rt(t[n], this, !1);
|
|
973
973
|
o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.interiorRings.push(o);
|
|
974
974
|
}
|
|
975
975
|
this.multiPoly = e;
|
|
@@ -978,13 +978,13 @@ class ve {
|
|
|
978
978
|
const t = this.exteriorRing.getSweepEvents();
|
|
979
979
|
for (let e = 0, n = this.interiorRings.length; e < n; e++) {
|
|
980
980
|
const r = this.interiorRings[e].getSweepEvents();
|
|
981
|
-
for (let o = 0,
|
|
981
|
+
for (let o = 0, f = r.length; o < f; o++)
|
|
982
982
|
t.push(r[o]);
|
|
983
983
|
}
|
|
984
984
|
return t;
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
class
|
|
987
|
+
class It {
|
|
988
988
|
constructor(t, e) {
|
|
989
989
|
if (!Array.isArray(t))
|
|
990
990
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
@@ -1003,7 +1003,7 @@ class Rt {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
};
|
|
1005
1005
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1006
|
-
const o = new
|
|
1006
|
+
const o = new we(t[n], this);
|
|
1007
1007
|
o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.polys.push(o);
|
|
1008
1008
|
}
|
|
1009
1009
|
this.isSubject = e;
|
|
@@ -1012,13 +1012,13 @@ class Rt {
|
|
|
1012
1012
|
const t = [];
|
|
1013
1013
|
for (let e = 0, n = this.polys.length; e < n; e++) {
|
|
1014
1014
|
const r = this.polys[e].getSweepEvents();
|
|
1015
|
-
for (let o = 0,
|
|
1015
|
+
for (let o = 0, f = r.length; o < f; o++)
|
|
1016
1016
|
t.push(r[o]);
|
|
1017
1017
|
}
|
|
1018
1018
|
return t;
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
class
|
|
1021
|
+
class nt {
|
|
1022
1022
|
/* Given the segments from the sweep line pass, compute & return a series
|
|
1023
1023
|
* of closed rings from all the segments marked to be part of the result */
|
|
1024
1024
|
static factory(t) {
|
|
@@ -1026,39 +1026,39 @@ class et {
|
|
|
1026
1026
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1027
1027
|
const o = t[n];
|
|
1028
1028
|
if (!o.isInResult() || o.ringOut) continue;
|
|
1029
|
-
let
|
|
1030
|
-
const
|
|
1031
|
-
for (;
|
|
1029
|
+
let f = null, l = o.leftSE, c = o.rightSE;
|
|
1030
|
+
const u = [l], p = l.point, s = [];
|
|
1031
|
+
for (; f = l, l = c, u.push(l), l.point !== p; )
|
|
1032
1032
|
for (; ; ) {
|
|
1033
|
-
const h =
|
|
1033
|
+
const h = l.getAvailableLinkedEvents();
|
|
1034
1034
|
if (h.length === 0) {
|
|
1035
|
-
const x =
|
|
1036
|
-
throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${
|
|
1035
|
+
const x = u[0].point, m = u[u.length - 1].point;
|
|
1036
|
+
throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${m.x}, ${m.y}].`);
|
|
1037
1037
|
}
|
|
1038
1038
|
if (h.length === 1) {
|
|
1039
1039
|
c = h[0].otherSE;
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
|
-
let
|
|
1043
|
-
for (let x = 0,
|
|
1044
|
-
if (
|
|
1045
|
-
|
|
1042
|
+
let g = null;
|
|
1043
|
+
for (let x = 0, m = s.length; x < m; x++)
|
|
1044
|
+
if (s[x].point === l.point) {
|
|
1045
|
+
g = x;
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
|
-
if (
|
|
1049
|
-
const x =
|
|
1050
|
-
|
|
1048
|
+
if (g !== null) {
|
|
1049
|
+
const x = s.splice(g)[0], m = u.splice(x.index);
|
|
1050
|
+
m.unshift(m[0].otherSE), e.push(new nt(m.reverse()));
|
|
1051
1051
|
continue;
|
|
1052
1052
|
}
|
|
1053
|
-
|
|
1054
|
-
index:
|
|
1055
|
-
point:
|
|
1053
|
+
s.push({
|
|
1054
|
+
index: u.length,
|
|
1055
|
+
point: l.point
|
|
1056
1056
|
});
|
|
1057
|
-
const
|
|
1058
|
-
c = h.sort(
|
|
1057
|
+
const y = l.getLeftmostComparator(f);
|
|
1058
|
+
c = h.sort(y)[0].otherSE;
|
|
1059
1059
|
break;
|
|
1060
1060
|
}
|
|
1061
|
-
e.push(new
|
|
1061
|
+
e.push(new nt(u));
|
|
1062
1062
|
}
|
|
1063
1063
|
return e;
|
|
1064
1064
|
}
|
|
@@ -1071,15 +1071,15 @@ class et {
|
|
|
1071
1071
|
getGeom() {
|
|
1072
1072
|
let t = this.events[0].point;
|
|
1073
1073
|
const e = [t];
|
|
1074
|
-
for (let
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1074
|
+
for (let u = 1, p = this.events.length - 1; u < p; u++) {
|
|
1075
|
+
const s = this.events[u].point, h = this.events[u + 1].point;
|
|
1076
|
+
Pt(s, t, h) !== 0 && (e.push(s), t = s);
|
|
1077
1077
|
}
|
|
1078
1078
|
if (e.length === 1) return null;
|
|
1079
1079
|
const n = e[0], r = e[1];
|
|
1080
|
-
|
|
1081
|
-
const o = this.isExteriorRing() ? 1 : -1,
|
|
1082
|
-
for (let
|
|
1080
|
+
Pt(n, t, r) === 0 && e.shift(), e.push(e[0]);
|
|
1081
|
+
const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, l = this.isExteriorRing() ? e.length : -1, c = [];
|
|
1082
|
+
for (let u = f; u != l; u += o) c.push([e[u].x, e[u].y]);
|
|
1083
1083
|
return c;
|
|
1084
1084
|
}
|
|
1085
1085
|
isExteriorRing() {
|
|
@@ -1096,8 +1096,8 @@ class et {
|
|
|
1096
1096
|
_calcEnclosingRing() {
|
|
1097
1097
|
let t = this.events[0];
|
|
1098
1098
|
for (let r = 1, o = this.events.length; r < o; r++) {
|
|
1099
|
-
const
|
|
1100
|
-
L.compare(t,
|
|
1099
|
+
const f = this.events[r];
|
|
1100
|
+
L.compare(t, f) > 0 && (t = f);
|
|
1101
1101
|
}
|
|
1102
1102
|
let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1103
1103
|
for (; ; ) {
|
|
@@ -1109,7 +1109,7 @@ class et {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
-
class
|
|
1112
|
+
class Ct {
|
|
1113
1113
|
constructor(t) {
|
|
1114
1114
|
this.exteriorRing = t, t.poly = this, this.interiorRings = [];
|
|
1115
1115
|
}
|
|
@@ -1126,7 +1126,7 @@ class kt {
|
|
|
1126
1126
|
return t;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
class
|
|
1129
|
+
class be {
|
|
1130
1130
|
constructor(t) {
|
|
1131
1131
|
this.rings = t, this.polys = this._composePolys(t);
|
|
1132
1132
|
}
|
|
@@ -1143,19 +1143,19 @@ class we {
|
|
|
1143
1143
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1144
1144
|
const o = t[n];
|
|
1145
1145
|
if (!o.poly)
|
|
1146
|
-
if (o.isExteriorRing()) e.push(new
|
|
1146
|
+
if (o.isExteriorRing()) e.push(new Ct(o));
|
|
1147
1147
|
else {
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1148
|
+
const f = o.enclosingRing();
|
|
1149
|
+
f.poly || e.push(new Ct(f)), f.poly.addInterior(o);
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
return e;
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
|
-
class
|
|
1155
|
+
class _e {
|
|
1156
1156
|
constructor(t) {
|
|
1157
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1158
|
-
this.queue = t, this.tree = new
|
|
1157
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : z.compare;
|
|
1158
|
+
this.queue = t, this.tree = new dt(e), this.segments = [];
|
|
1159
1159
|
}
|
|
1160
1160
|
process(t) {
|
|
1161
1161
|
const e = t.segment, n = [];
|
|
@@ -1163,51 +1163,51 @@ class Ee {
|
|
|
1163
1163
|
return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
|
|
1164
1164
|
const r = t.isLeft ? this.tree.add(e) : this.tree.find(e);
|
|
1165
1165
|
if (!r) throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);
|
|
1166
|
-
let o = r,
|
|
1167
|
-
for (;
|
|
1168
|
-
o = this.tree.prev(o), o === null ?
|
|
1166
|
+
let o = r, f = r, l, c;
|
|
1167
|
+
for (; l === void 0; )
|
|
1168
|
+
o = this.tree.prev(o), o === null ? l = null : o.key.consumedBy === void 0 && (l = o.key);
|
|
1169
1169
|
for (; c === void 0; )
|
|
1170
|
-
|
|
1170
|
+
f = this.tree.next(f), f === null ? c = null : f.key.consumedBy === void 0 && (c = f.key);
|
|
1171
1171
|
if (t.isLeft) {
|
|
1172
|
-
let
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
const h = this._splitSafely(
|
|
1177
|
-
for (let
|
|
1178
|
-
n.push(h[
|
|
1172
|
+
let u = null;
|
|
1173
|
+
if (l) {
|
|
1174
|
+
const s = l.getIntersection(e);
|
|
1175
|
+
if (s !== null && (e.isAnEndpoint(s) || (u = s), !l.isAnEndpoint(s))) {
|
|
1176
|
+
const h = this._splitSafely(l, s);
|
|
1177
|
+
for (let g = 0, y = h.length; g < y; g++)
|
|
1178
|
+
n.push(h[g]);
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
let
|
|
1181
|
+
let p = null;
|
|
1182
1182
|
if (c) {
|
|
1183
|
-
const
|
|
1184
|
-
if (
|
|
1185
|
-
const h = this._splitSafely(c,
|
|
1186
|
-
for (let
|
|
1187
|
-
n.push(h[
|
|
1183
|
+
const s = c.getIntersection(e);
|
|
1184
|
+
if (s !== null && (e.isAnEndpoint(s) || (p = s), !c.isAnEndpoint(s))) {
|
|
1185
|
+
const h = this._splitSafely(c, s);
|
|
1186
|
+
for (let g = 0, y = h.length; g < y; g++)
|
|
1187
|
+
n.push(h[g]);
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
if (
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1193
|
-
const h = e.split(
|
|
1194
|
-
for (let
|
|
1195
|
-
n.push(h[
|
|
1190
|
+
if (u !== null || p !== null) {
|
|
1191
|
+
let s = null;
|
|
1192
|
+
u === null ? s = p : p === null ? s = u : s = L.comparePoints(u, p) <= 0 ? u : p, this.queue.remove(e.rightSE), n.push(e.rightSE);
|
|
1193
|
+
const h = e.split(s);
|
|
1194
|
+
for (let g = 0, y = h.length; g < y; g++)
|
|
1195
|
+
n.push(h[g]);
|
|
1196
1196
|
}
|
|
1197
|
-
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev =
|
|
1197
|
+
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = l);
|
|
1198
1198
|
} else {
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
if (!
|
|
1203
|
-
const
|
|
1204
|
-
for (let
|
|
1205
|
-
n.push(
|
|
1199
|
+
if (l && c) {
|
|
1200
|
+
const u = l.getIntersection(c);
|
|
1201
|
+
if (u !== null) {
|
|
1202
|
+
if (!l.isAnEndpoint(u)) {
|
|
1203
|
+
const p = this._splitSafely(l, u);
|
|
1204
|
+
for (let s = 0, h = p.length; s < h; s++)
|
|
1205
|
+
n.push(p[s]);
|
|
1206
1206
|
}
|
|
1207
|
-
if (!c.isAnEndpoint(
|
|
1208
|
-
const
|
|
1209
|
-
for (let
|
|
1210
|
-
n.push(
|
|
1207
|
+
if (!c.isAnEndpoint(u)) {
|
|
1208
|
+
const p = this._splitSafely(c, u);
|
|
1209
|
+
for (let s = 0, h = p.length; s < h; s++)
|
|
1210
|
+
n.push(p[s]);
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
@@ -1225,157 +1225,157 @@ class Ee {
|
|
|
1225
1225
|
return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
const
|
|
1229
|
-
class
|
|
1228
|
+
const kt = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, Se = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1229
|
+
class Pe {
|
|
1230
1230
|
run(t, e, n) {
|
|
1231
|
-
$.type = t,
|
|
1232
|
-
const r = [new
|
|
1233
|
-
for (let
|
|
1234
|
-
r.push(new
|
|
1231
|
+
$.type = t, Z.reset();
|
|
1232
|
+
const r = [new It(e, !0)];
|
|
1233
|
+
for (let s = 0, h = n.length; s < h; s++)
|
|
1234
|
+
r.push(new It(n[s], !1));
|
|
1235
1235
|
if ($.numMultiPolys = r.length, $.type === "difference") {
|
|
1236
|
-
const
|
|
1236
|
+
const s = r[0];
|
|
1237
1237
|
let h = 1;
|
|
1238
1238
|
for (; h < r.length; )
|
|
1239
|
-
|
|
1239
|
+
at(r[h].bbox, s.bbox) !== null ? h++ : r.splice(h, 1);
|
|
1240
1240
|
}
|
|
1241
1241
|
if ($.type === "intersection")
|
|
1242
|
-
for (let
|
|
1243
|
-
const
|
|
1244
|
-
for (let
|
|
1245
|
-
if (
|
|
1242
|
+
for (let s = 0, h = r.length; s < h; s++) {
|
|
1243
|
+
const g = r[s];
|
|
1244
|
+
for (let y = s + 1, x = r.length; y < x; y++)
|
|
1245
|
+
if (at(g.bbox, r[y].bbox) === null) return [];
|
|
1246
1246
|
}
|
|
1247
|
-
const o = new
|
|
1248
|
-
for (let
|
|
1249
|
-
const
|
|
1250
|
-
for (let
|
|
1251
|
-
if (o.insert(
|
|
1247
|
+
const o = new dt(L.compare);
|
|
1248
|
+
for (let s = 0, h = r.length; s < h; s++) {
|
|
1249
|
+
const g = r[s].getSweepEvents();
|
|
1250
|
+
for (let y = 0, x = g.length; y < x; y++)
|
|
1251
|
+
if (o.insert(g[y]), o.size > kt)
|
|
1252
1252
|
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
|
|
1253
1253
|
}
|
|
1254
|
-
const
|
|
1255
|
-
let
|
|
1254
|
+
const f = new _e(o);
|
|
1255
|
+
let l = o.size, c = o.pop();
|
|
1256
1256
|
for (; c; ) {
|
|
1257
|
-
const
|
|
1258
|
-
if (o.size ===
|
|
1259
|
-
const
|
|
1260
|
-
throw new Error(`Unable to pop() ${
|
|
1257
|
+
const s = c.key;
|
|
1258
|
+
if (o.size === l) {
|
|
1259
|
+
const g = s.segment;
|
|
1260
|
+
throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`);
|
|
1261
1261
|
}
|
|
1262
|
-
if (o.size >
|
|
1262
|
+
if (o.size > kt)
|
|
1263
1263
|
throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
|
|
1264
|
-
if (
|
|
1264
|
+
if (f.segments.length > Se)
|
|
1265
1265
|
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1266
|
-
const h =
|
|
1267
|
-
for (let
|
|
1268
|
-
const x = h[
|
|
1266
|
+
const h = f.process(s);
|
|
1267
|
+
for (let g = 0, y = h.length; g < y; g++) {
|
|
1268
|
+
const x = h[g];
|
|
1269
1269
|
x.consumedBy === void 0 && o.insert(x);
|
|
1270
1270
|
}
|
|
1271
|
-
|
|
1271
|
+
l = o.size, c = o.pop();
|
|
1272
1272
|
}
|
|
1273
|
-
|
|
1274
|
-
const
|
|
1275
|
-
return new
|
|
1273
|
+
Z.reset();
|
|
1274
|
+
const u = nt.factory(f.segments);
|
|
1275
|
+
return new be(u).getGeom();
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
const $ = new
|
|
1278
|
+
const $ = new Pe(), Me = function(i) {
|
|
1279
1279
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1280
1280
|
e[n - 1] = arguments[n];
|
|
1281
1281
|
return $.run("union", i, e);
|
|
1282
|
-
},
|
|
1282
|
+
}, Le = function(i) {
|
|
1283
1283
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1284
1284
|
e[n - 1] = arguments[n];
|
|
1285
1285
|
return $.run("intersection", i, e);
|
|
1286
|
-
},
|
|
1286
|
+
}, Re = function(i) {
|
|
1287
1287
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1288
1288
|
e[n - 1] = arguments[n];
|
|
1289
1289
|
return $.run("xor", i, e);
|
|
1290
|
-
},
|
|
1290
|
+
}, Ie = function(i) {
|
|
1291
1291
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1292
1292
|
e[n - 1] = arguments[n];
|
|
1293
1293
|
return $.run("difference", i, e);
|
|
1294
1294
|
};
|
|
1295
|
-
var
|
|
1296
|
-
union:
|
|
1297
|
-
intersection:
|
|
1298
|
-
xor:
|
|
1299
|
-
difference:
|
|
1295
|
+
var Qt = {
|
|
1296
|
+
union: Me,
|
|
1297
|
+
intersection: Le,
|
|
1298
|
+
xor: Re,
|
|
1299
|
+
difference: Ie
|
|
1300
1300
|
};
|
|
1301
|
-
function
|
|
1301
|
+
function Ft(i, t, e) {
|
|
1302
1302
|
if (i !== null)
|
|
1303
|
-
for (var n, r, o,
|
|
1304
|
-
|
|
1305
|
-
for (var
|
|
1306
|
-
var
|
|
1307
|
-
if (
|
|
1308
|
-
c =
|
|
1309
|
-
var
|
|
1310
|
-
switch (
|
|
1303
|
+
for (var n, r, o, f, l, c, u, p = 0, s = 0, h, g = i.type, y = g === "FeatureCollection", x = g === "Feature", m = y ? i.features.length : 1, a = 0; a < m; a++) {
|
|
1304
|
+
u = y ? i.features[a].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, l = h ? u.geometries.length : 1;
|
|
1305
|
+
for (var d = 0; d < l; d++) {
|
|
1306
|
+
var v = 0, E = 0;
|
|
1307
|
+
if (f = h ? u.geometries[d] : u, f !== null) {
|
|
1308
|
+
c = f.coordinates;
|
|
1309
|
+
var w = f.type;
|
|
1310
|
+
switch (p = 0, w) {
|
|
1311
1311
|
case null:
|
|
1312
1312
|
break;
|
|
1313
1313
|
case "Point":
|
|
1314
1314
|
if (t(
|
|
1315
1315
|
c,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1316
|
+
s,
|
|
1317
|
+
a,
|
|
1318
|
+
v,
|
|
1319
|
+
E
|
|
1320
1320
|
) === !1)
|
|
1321
1321
|
return !1;
|
|
1322
|
-
|
|
1322
|
+
s++, v++;
|
|
1323
1323
|
break;
|
|
1324
1324
|
case "LineString":
|
|
1325
1325
|
case "MultiPoint":
|
|
1326
1326
|
for (n = 0; n < c.length; n++) {
|
|
1327
1327
|
if (t(
|
|
1328
1328
|
c[n],
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1329
|
+
s,
|
|
1330
|
+
a,
|
|
1331
|
+
v,
|
|
1332
|
+
E
|
|
1333
1333
|
) === !1)
|
|
1334
1334
|
return !1;
|
|
1335
|
-
|
|
1335
|
+
s++, w === "MultiPoint" && v++;
|
|
1336
1336
|
}
|
|
1337
|
-
|
|
1337
|
+
w === "LineString" && v++;
|
|
1338
1338
|
break;
|
|
1339
1339
|
case "Polygon":
|
|
1340
1340
|
case "MultiLineString":
|
|
1341
1341
|
for (n = 0; n < c.length; n++) {
|
|
1342
|
-
for (r = 0; r < c[n].length -
|
|
1342
|
+
for (r = 0; r < c[n].length - p; r++) {
|
|
1343
1343
|
if (t(
|
|
1344
1344
|
c[n][r],
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1345
|
+
s,
|
|
1346
|
+
a,
|
|
1347
|
+
v,
|
|
1348
|
+
E
|
|
1349
1349
|
) === !1)
|
|
1350
1350
|
return !1;
|
|
1351
|
-
|
|
1351
|
+
s++;
|
|
1352
1352
|
}
|
|
1353
|
-
|
|
1353
|
+
w === "MultiLineString" && v++, w === "Polygon" && E++;
|
|
1354
1354
|
}
|
|
1355
|
-
|
|
1355
|
+
w === "Polygon" && v++;
|
|
1356
1356
|
break;
|
|
1357
1357
|
case "MultiPolygon":
|
|
1358
1358
|
for (n = 0; n < c.length; n++) {
|
|
1359
|
-
for (
|
|
1360
|
-
for (o = 0; o < c[n][r].length -
|
|
1359
|
+
for (E = 0, r = 0; r < c[n].length; r++) {
|
|
1360
|
+
for (o = 0; o < c[n][r].length - p; o++) {
|
|
1361
1361
|
if (t(
|
|
1362
1362
|
c[n][r][o],
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1363
|
+
s,
|
|
1364
|
+
a,
|
|
1365
|
+
v,
|
|
1366
|
+
E
|
|
1367
1367
|
) === !1)
|
|
1368
1368
|
return !1;
|
|
1369
|
-
|
|
1369
|
+
s++;
|
|
1370
1370
|
}
|
|
1371
|
-
|
|
1371
|
+
E++;
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
v++;
|
|
1374
1374
|
}
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "GeometryCollection":
|
|
1377
|
-
for (n = 0; n <
|
|
1378
|
-
if (
|
|
1377
|
+
for (n = 0; n < f.geometries.length; n++)
|
|
1378
|
+
if (Ft(f.geometries[n], t) === !1)
|
|
1379
1379
|
return !1;
|
|
1380
1380
|
break;
|
|
1381
1381
|
default:
|
|
@@ -1385,17 +1385,17 @@ function Qt(i, t, e) {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1389
|
-
var e, n, r, o,
|
|
1388
|
+
function xt(i, t) {
|
|
1389
|
+
var e, n, r, o, f, l, c, u, p, s, h = 0, g = i.type === "FeatureCollection", y = i.type === "Feature", x = g ? i.features.length : 1;
|
|
1390
1390
|
for (e = 0; e < x; e++) {
|
|
1391
|
-
for (
|
|
1392
|
-
if (o = c ?
|
|
1391
|
+
for (l = g ? i.features[e].geometry : y ? i.geometry : i, u = g ? i.features[e].properties : y ? i.properties : {}, p = g ? i.features[e].bbox : y ? i.bbox : void 0, s = g ? i.features[e].id : y ? i.id : void 0, c = l ? l.type === "GeometryCollection" : !1, f = c ? l.geometries.length : 1, r = 0; r < f; r++) {
|
|
1392
|
+
if (o = c ? l.geometries[r] : l, o === null) {
|
|
1393
1393
|
if (t(
|
|
1394
1394
|
null,
|
|
1395
1395
|
h,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1396
|
+
u,
|
|
1397
|
+
p,
|
|
1398
|
+
s
|
|
1399
1399
|
) === !1)
|
|
1400
1400
|
return !1;
|
|
1401
1401
|
continue;
|
|
@@ -1410,9 +1410,9 @@ function dt(i, t) {
|
|
|
1410
1410
|
if (t(
|
|
1411
1411
|
o,
|
|
1412
1412
|
h,
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1413
|
+
u,
|
|
1414
|
+
p,
|
|
1415
|
+
s
|
|
1416
1416
|
) === !1)
|
|
1417
1417
|
return !1;
|
|
1418
1418
|
break;
|
|
@@ -1422,9 +1422,9 @@ function dt(i, t) {
|
|
|
1422
1422
|
if (t(
|
|
1423
1423
|
o.geometries[n],
|
|
1424
1424
|
h,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1425
|
+
u,
|
|
1426
|
+
p,
|
|
1427
|
+
s
|
|
1428
1428
|
) === !1)
|
|
1429
1429
|
return !1;
|
|
1430
1430
|
break;
|
|
@@ -1436,22 +1436,22 @@ function dt(i, t) {
|
|
|
1436
1436
|
h++;
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1440
|
-
|
|
1441
|
-
var
|
|
1442
|
-
switch (
|
|
1439
|
+
function Ce(i, t) {
|
|
1440
|
+
xt(i, function(e, n, r, o, f) {
|
|
1441
|
+
var l = e === null ? null : e.type;
|
|
1442
|
+
switch (l) {
|
|
1443
1443
|
case null:
|
|
1444
1444
|
case "Point":
|
|
1445
1445
|
case "LineString":
|
|
1446
1446
|
case "Polygon":
|
|
1447
1447
|
return t(
|
|
1448
|
-
|
|
1448
|
+
X(e, r, { bbox: o, id: f }),
|
|
1449
1449
|
n,
|
|
1450
1450
|
0
|
|
1451
1451
|
) === !1 ? !1 : void 0;
|
|
1452
1452
|
}
|
|
1453
1453
|
var c;
|
|
1454
|
-
switch (
|
|
1454
|
+
switch (l) {
|
|
1455
1455
|
case "MultiPoint":
|
|
1456
1456
|
c = "Point";
|
|
1457
1457
|
break;
|
|
@@ -1462,147 +1462,147 @@ function Le(i, t) {
|
|
|
1462
1462
|
c = "Polygon";
|
|
1463
1463
|
break;
|
|
1464
1464
|
}
|
|
1465
|
-
for (var
|
|
1466
|
-
var
|
|
1465
|
+
for (var u = 0; u < e.coordinates.length; u++) {
|
|
1466
|
+
var p = e.coordinates[u], s = {
|
|
1467
1467
|
type: c,
|
|
1468
|
-
coordinates:
|
|
1468
|
+
coordinates: p
|
|
1469
1469
|
};
|
|
1470
|
-
if (t(
|
|
1470
|
+
if (t(X(s, r), n, u) === !1)
|
|
1471
1471
|
return !1;
|
|
1472
1472
|
}
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function ke(i, t = {}) {
|
|
1476
1476
|
const e = [];
|
|
1477
|
-
if (
|
|
1477
|
+
if (xt(i, (r) => {
|
|
1478
1478
|
e.push(r.coordinates);
|
|
1479
1479
|
}), e.length < 2)
|
|
1480
1480
|
throw new Error("Must have at least 2 geometries");
|
|
1481
|
-
const n =
|
|
1482
|
-
return n.length === 0 ? null : n.length === 1 ?
|
|
1481
|
+
const n = Qt.union(e[0], ...e.slice(1));
|
|
1482
|
+
return n.length === 0 ? null : n.length === 1 ? yt(n[0], t.properties) : jt(n, t.properties);
|
|
1483
1483
|
}
|
|
1484
|
-
var
|
|
1484
|
+
var Dt = ke;
|
|
1485
1485
|
function W() {
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Xt(i) {
|
|
1488
1488
|
return i();
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function $t() {
|
|
1491
1491
|
return /* @__PURE__ */ Object.create(null);
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1494
|
-
i.forEach(
|
|
1493
|
+
function it(i) {
|
|
1494
|
+
i.forEach(Xt);
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1496
|
+
function Vt(i) {
|
|
1497
1497
|
return typeof i == "function";
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function $e(i, t) {
|
|
1500
1500
|
return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function Ae(i) {
|
|
1503
1503
|
return Object.keys(i).length === 0;
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function Oe(i, t) {
|
|
1506
1506
|
i.appendChild(t);
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function Ne(i, t, e) {
|
|
1509
1509
|
i.insertBefore(t, e || null);
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1511
|
+
function Zt(i) {
|
|
1512
1512
|
i.parentNode && i.parentNode.removeChild(i);
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function At(i) {
|
|
1515
1515
|
return document.createElementNS("http://www.w3.org/2000/svg", i);
|
|
1516
1516
|
}
|
|
1517
1517
|
function N(i, t, e) {
|
|
1518
1518
|
e == null ? i.removeAttribute(t) : i.getAttribute(t) !== e && i.setAttribute(t, e);
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function Be(i) {
|
|
1521
1521
|
return Array.from(i.childNodes);
|
|
1522
1522
|
}
|
|
1523
1523
|
function K(i, t, e) {
|
|
1524
1524
|
i.classList.toggle(t, !!e);
|
|
1525
1525
|
}
|
|
1526
|
-
let
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1526
|
+
let vt;
|
|
1527
|
+
function D(i) {
|
|
1528
|
+
vt = i;
|
|
1529
1529
|
}
|
|
1530
|
-
const
|
|
1531
|
-
let
|
|
1532
|
-
const
|
|
1533
|
-
let
|
|
1534
|
-
function
|
|
1535
|
-
|
|
1530
|
+
const j = [], Ot = [];
|
|
1531
|
+
let Y = [];
|
|
1532
|
+
const Nt = [], Te = /* @__PURE__ */ Promise.resolve();
|
|
1533
|
+
let gt = !1;
|
|
1534
|
+
function ze() {
|
|
1535
|
+
gt || (gt = !0, Te.then(Wt));
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1538
|
-
|
|
1537
|
+
function pt(i) {
|
|
1538
|
+
Y.push(i);
|
|
1539
1539
|
}
|
|
1540
|
-
const
|
|
1540
|
+
const lt = /* @__PURE__ */ new Set();
|
|
1541
1541
|
let q = 0;
|
|
1542
|
-
function
|
|
1542
|
+
function Wt() {
|
|
1543
1543
|
if (q !== 0)
|
|
1544
1544
|
return;
|
|
1545
|
-
const i =
|
|
1545
|
+
const i = vt;
|
|
1546
1546
|
do {
|
|
1547
1547
|
try {
|
|
1548
|
-
for (; q <
|
|
1549
|
-
const t =
|
|
1550
|
-
q++,
|
|
1548
|
+
for (; q < j.length; ) {
|
|
1549
|
+
const t = j[q];
|
|
1550
|
+
q++, D(t), Ge(t.$$);
|
|
1551
1551
|
}
|
|
1552
1552
|
} catch (t) {
|
|
1553
|
-
throw
|
|
1553
|
+
throw j.length = 0, q = 0, t;
|
|
1554
1554
|
}
|
|
1555
|
-
for (
|
|
1556
|
-
for (let t = 0; t <
|
|
1557
|
-
const e =
|
|
1558
|
-
|
|
1555
|
+
for (D(null), j.length = 0, q = 0; Ot.length; ) Ot.pop()();
|
|
1556
|
+
for (let t = 0; t < Y.length; t += 1) {
|
|
1557
|
+
const e = Y[t];
|
|
1558
|
+
lt.has(e) || (lt.add(e), e());
|
|
1559
1559
|
}
|
|
1560
|
-
|
|
1561
|
-
} while (
|
|
1562
|
-
for (;
|
|
1563
|
-
|
|
1564
|
-
|
|
1560
|
+
Y.length = 0;
|
|
1561
|
+
} while (j.length);
|
|
1562
|
+
for (; Nt.length; )
|
|
1563
|
+
Nt.pop()();
|
|
1564
|
+
gt = !1, lt.clear(), D(i);
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function Ge(i) {
|
|
1567
1567
|
if (i.fragment !== null) {
|
|
1568
|
-
i.update(),
|
|
1568
|
+
i.update(), it(i.before_update);
|
|
1569
1569
|
const t = i.dirty;
|
|
1570
|
-
i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(
|
|
1570
|
+
i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(pt);
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Ue(i) {
|
|
1574
1574
|
const t = [], e = [];
|
|
1575
|
-
|
|
1575
|
+
Y.forEach((n) => i.indexOf(n) === -1 ? t.push(n) : e.push(n)), e.forEach((n) => n()), Y = t;
|
|
1576
1576
|
}
|
|
1577
|
-
const
|
|
1578
|
-
function
|
|
1579
|
-
i && i.i && (
|
|
1577
|
+
const qe = /* @__PURE__ */ new Set();
|
|
1578
|
+
function je(i, t) {
|
|
1579
|
+
i && i.i && (qe.delete(i), i.i(t));
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function Ye(i, t, e) {
|
|
1582
1582
|
const { fragment: n, after_update: r } = i.$$;
|
|
1583
|
-
n && n.m(t, e),
|
|
1584
|
-
const o = i.$$.on_mount.map(
|
|
1585
|
-
i.$$.on_destroy ? i.$$.on_destroy.push(...o) :
|
|
1586
|
-
}), r.forEach(
|
|
1583
|
+
n && n.m(t, e), pt(() => {
|
|
1584
|
+
const o = i.$$.on_mount.map(Xt).filter(Vt);
|
|
1585
|
+
i.$$.on_destroy ? i.$$.on_destroy.push(...o) : it(o), i.$$.on_mount = [];
|
|
1586
|
+
}), r.forEach(pt);
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function Qe(i, t) {
|
|
1589
1589
|
const e = i.$$;
|
|
1590
|
-
e.fragment !== null && (
|
|
1590
|
+
e.fragment !== null && (Ue(e.after_update), it(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1593
|
-
i.$$.dirty[0] === -1 && (
|
|
1592
|
+
function Fe(i, t) {
|
|
1593
|
+
i.$$.dirty[0] === -1 && (j.push(i), ze(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1596
|
-
const c =
|
|
1597
|
-
|
|
1598
|
-
const
|
|
1595
|
+
function De(i, t, e, n, r, o, f = null, l = [-1]) {
|
|
1596
|
+
const c = vt;
|
|
1597
|
+
D(i);
|
|
1598
|
+
const u = i.$$ = {
|
|
1599
1599
|
fragment: null,
|
|
1600
1600
|
ctx: [],
|
|
1601
1601
|
// state
|
|
1602
1602
|
props: o,
|
|
1603
1603
|
update: W,
|
|
1604
1604
|
not_equal: r,
|
|
1605
|
-
bound:
|
|
1605
|
+
bound: $t(),
|
|
1606
1606
|
// lifecycle
|
|
1607
1607
|
on_mount: [],
|
|
1608
1608
|
on_destroy: [],
|
|
@@ -1611,27 +1611,27 @@ function Ue(i, t, e, n, r, o, u = null, s = [-1]) {
|
|
|
1611
1611
|
after_update: [],
|
|
1612
1612
|
context: new Map(t.context || (c ? c.$$.context : [])),
|
|
1613
1613
|
// everything else
|
|
1614
|
-
callbacks:
|
|
1615
|
-
dirty:
|
|
1614
|
+
callbacks: $t(),
|
|
1615
|
+
dirty: l,
|
|
1616
1616
|
skip_bound: !1,
|
|
1617
1617
|
root: t.target || c.$$.root
|
|
1618
1618
|
};
|
|
1619
|
-
|
|
1620
|
-
let
|
|
1621
|
-
if (
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1624
|
-
}) : [],
|
|
1619
|
+
f && f(u.root);
|
|
1620
|
+
let p = !1;
|
|
1621
|
+
if (u.ctx = e ? e(i, t.props || {}, (s, h, ...g) => {
|
|
1622
|
+
const y = g.length ? g[0] : h;
|
|
1623
|
+
return u.ctx && r(u.ctx[s], u.ctx[s] = y) && (!u.skip_bound && u.bound[s] && u.bound[s](y), p && Fe(i, s)), h;
|
|
1624
|
+
}) : [], u.update(), p = !0, it(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
|
|
1625
1625
|
if (t.hydrate) {
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1626
|
+
const s = Be(t.target);
|
|
1627
|
+
u.fragment && u.fragment.l(s), s.forEach(Zt);
|
|
1628
1628
|
} else
|
|
1629
|
-
|
|
1630
|
-
t.intro &&
|
|
1629
|
+
u.fragment && u.fragment.c();
|
|
1630
|
+
t.intro && je(i.$$.fragment), Ye(i, t.target, t.anchor), Wt();
|
|
1631
1631
|
}
|
|
1632
|
-
|
|
1632
|
+
D(c);
|
|
1633
1633
|
}
|
|
1634
|
-
class
|
|
1634
|
+
class Xe {
|
|
1635
1635
|
constructor() {
|
|
1636
1636
|
/**
|
|
1637
1637
|
* ### PRIVATE API
|
|
@@ -1640,7 +1640,7 @@ class Ye {
|
|
|
1640
1640
|
*
|
|
1641
1641
|
* @type {any}
|
|
1642
1642
|
*/
|
|
1643
|
-
|
|
1643
|
+
rt(this, "$$");
|
|
1644
1644
|
/**
|
|
1645
1645
|
* ### PRIVATE API
|
|
1646
1646
|
*
|
|
@@ -1648,11 +1648,11 @@ class Ye {
|
|
|
1648
1648
|
*
|
|
1649
1649
|
* @type {any}
|
|
1650
1650
|
*/
|
|
1651
|
-
|
|
1651
|
+
rt(this, "$$set");
|
|
1652
1652
|
}
|
|
1653
1653
|
/** @returns {void} */
|
|
1654
1654
|
$destroy() {
|
|
1655
|
-
|
|
1655
|
+
Qe(this, 1), this.$destroy = W;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -1661,7 +1661,7 @@ class Ye {
|
|
|
1661
1661
|
* @returns {() => void}
|
|
1662
1662
|
*/
|
|
1663
1663
|
$on(t, e) {
|
|
1664
|
-
if (!
|
|
1664
|
+
if (!Vt(e))
|
|
1665
1665
|
return W;
|
|
1666
1666
|
const n = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
1667
1667
|
return n.push(e), () => {
|
|
@@ -1674,16 +1674,16 @@ class Ye {
|
|
|
1674
1674
|
* @returns {void}
|
|
1675
1675
|
*/
|
|
1676
1676
|
$set(t) {
|
|
1677
|
-
this.$$set && !
|
|
1677
|
+
this.$$set && !Ae(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
const
|
|
1681
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
1682
|
-
function
|
|
1680
|
+
const Ve = "4";
|
|
1681
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ve);
|
|
1682
|
+
function Ze(i) {
|
|
1683
1683
|
let t, e, n;
|
|
1684
1684
|
return {
|
|
1685
1685
|
c() {
|
|
1686
|
-
t =
|
|
1686
|
+
t = At("svg"), e = At("path"), N(e, "stroke-width", "4"), N(e, "d", "M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"), N(e, "class", "svelte-gzo3ar"), N(t, "width", n = /*displayIn*/
|
|
1687
1687
|
i[0] === "list" ? 20 : void 0), N(t, "viewBox", "0 0 70 85"), N(t, "fill", "none"), N(t, "class", "svelte-gzo3ar"), K(
|
|
1688
1688
|
t,
|
|
1689
1689
|
"in-map",
|
|
@@ -1697,7 +1697,7 @@ function Xe(i) {
|
|
|
1697
1697
|
);
|
|
1698
1698
|
},
|
|
1699
1699
|
m(r, o) {
|
|
1700
|
-
|
|
1700
|
+
Ne(r, t, o), Oe(t, e);
|
|
1701
1701
|
},
|
|
1702
1702
|
p(r, [o]) {
|
|
1703
1703
|
o & /*displayIn*/
|
|
@@ -1719,57 +1719,57 @@ function Xe(i) {
|
|
|
1719
1719
|
i: W,
|
|
1720
1720
|
o: W,
|
|
1721
1721
|
d(r) {
|
|
1722
|
-
r &&
|
|
1722
|
+
r && Zt(t);
|
|
1723
1723
|
}
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function We(i, t, e) {
|
|
1727
1727
|
let { displayIn: n } = t;
|
|
1728
1728
|
return i.$$set = (r) => {
|
|
1729
1729
|
"displayIn" in r && e(0, n = r.displayIn);
|
|
1730
1730
|
}, [n];
|
|
1731
1731
|
}
|
|
1732
|
-
class
|
|
1732
|
+
class Je extends Xe {
|
|
1733
1733
|
constructor(t) {
|
|
1734
|
-
super(),
|
|
1734
|
+
super(), De(this, t, We, Ze, $e, { displayIn: 0 });
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1737
|
+
function Ke(i, t = {}) {
|
|
1738
1738
|
if (i.bbox != null && t.recompute !== !0)
|
|
1739
1739
|
return i.bbox;
|
|
1740
1740
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
1741
|
-
return
|
|
1741
|
+
return Ft(i, (n) => {
|
|
1742
1742
|
e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
|
|
1743
1743
|
}), e;
|
|
1744
1744
|
}
|
|
1745
|
-
var
|
|
1746
|
-
function
|
|
1745
|
+
var Bt = Ke;
|
|
1746
|
+
function He(i) {
|
|
1747
1747
|
const t = [];
|
|
1748
|
-
if (
|
|
1748
|
+
if (xt(i, (r) => {
|
|
1749
1749
|
t.push(r.coordinates);
|
|
1750
1750
|
}), t.length < 2)
|
|
1751
1751
|
throw new Error("Must have at least two features");
|
|
1752
|
-
const e = i.features[0].properties || {}, n =
|
|
1753
|
-
return n.length === 0 ? null : n.length === 1 ?
|
|
1752
|
+
const e = i.features[0].properties || {}, n = Qt.difference(t[0], ...t.slice(1));
|
|
1753
|
+
return n.length === 0 ? null : n.length === 1 ? yt(n[0], e) : jt(n, e);
|
|
1754
1754
|
}
|
|
1755
|
-
var
|
|
1756
|
-
function
|
|
1755
|
+
var tn = He;
|
|
1756
|
+
function en(i) {
|
|
1757
1757
|
if (!i)
|
|
1758
1758
|
throw new Error("geojson is required");
|
|
1759
1759
|
var t = [];
|
|
1760
|
-
return
|
|
1760
|
+
return Ce(i, function(e) {
|
|
1761
1761
|
t.push(e);
|
|
1762
|
-
}),
|
|
1762
|
+
}), V(t);
|
|
1763
1763
|
}
|
|
1764
|
-
var
|
|
1765
|
-
function
|
|
1764
|
+
var nn = en;
|
|
1765
|
+
function Tt(i) {
|
|
1766
1766
|
const t = [...i];
|
|
1767
1767
|
return t[2] < t[0] && (Math.abs((t[0] + t[2] + 360) / 2) > Math.abs((t[0] - 360 + t[2]) / 2) ? t[0] -= 360 : t[2] += 360), t;
|
|
1768
1768
|
}
|
|
1769
1769
|
function zt(i, t) {
|
|
1770
|
-
const e =
|
|
1771
|
-
|
|
1772
|
-
|
|
1770
|
+
const e = tn(
|
|
1771
|
+
V([
|
|
1772
|
+
yt([
|
|
1773
1773
|
[
|
|
1774
1774
|
[180, 90],
|
|
1775
1775
|
[-180, 90],
|
|
@@ -1784,28 +1784,27 @@ function zt(i, t) {
|
|
|
1784
1784
|
if (!e)
|
|
1785
1785
|
return;
|
|
1786
1786
|
e.properties = { isMask: !0 };
|
|
1787
|
-
const n = Bt(
|
|
1788
|
-
if (
|
|
1789
|
-
for (const c of
|
|
1790
|
-
const
|
|
1791
|
-
if (
|
|
1792
|
-
for (const
|
|
1793
|
-
for (const
|
|
1794
|
-
|
|
1795
|
-
if (o &&
|
|
1796
|
-
for (const
|
|
1797
|
-
for (const
|
|
1798
|
-
|
|
1787
|
+
const n = Tt(Bt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, l = nn(i);
|
|
1788
|
+
if (l.features.length > 1 && (o || f))
|
|
1789
|
+
for (const c of l.features) {
|
|
1790
|
+
const u = Tt(Bt(c));
|
|
1791
|
+
if (f && u[0] < -180 + r)
|
|
1792
|
+
for (const p of c.geometry.coordinates)
|
|
1793
|
+
for (const s of p)
|
|
1794
|
+
s[0] += 360 - r;
|
|
1795
|
+
if (o && u[2] > 180 - r)
|
|
1796
|
+
for (const p of c.geometry.coordinates)
|
|
1797
|
+
for (const s of p)
|
|
1798
|
+
s[0] -= 360 - r;
|
|
1799
1799
|
}
|
|
1800
1800
|
t(
|
|
1801
|
-
|
|
1802
|
-
|
|
1801
|
+
V([
|
|
1802
|
+
l.features.length < 2 ? i : Dt(l) ?? i,
|
|
1803
1803
|
e
|
|
1804
1804
|
])
|
|
1805
1805
|
);
|
|
1806
1806
|
}
|
|
1807
|
-
const
|
|
1808
|
-
function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
1807
|
+
const Gt = {
|
|
1809
1808
|
fill: {
|
|
1810
1809
|
paint: {
|
|
1811
1810
|
"fill-color": "#000",
|
|
@@ -1824,123 +1823,146 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
|
1824
1823
|
},
|
|
1825
1824
|
filter: ["!", ["has", "isMask"]]
|
|
1826
1825
|
}
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1826
|
+
}, H = "mtlr-gc-full-geom", Ut = "mtlr-gc-full-geom-fill", qt = "mtlr-gc-full-geom-line";
|
|
1827
|
+
function on(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt, l = !1) {
|
|
1828
|
+
let c;
|
|
1829
|
+
const u = [];
|
|
1830
|
+
let p, s, h;
|
|
1831
|
+
function g() {
|
|
1832
|
+
if (!i.loaded) {
|
|
1833
|
+
i.once("load", g);
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
const a = f ? f === !0 ? Gt : f : void 0;
|
|
1837
|
+
if (!(a != null && a.fill) && !(a != null && a.line))
|
|
1838
|
+
return;
|
|
1839
|
+
const d = i.getSource(H);
|
|
1840
|
+
if (d)
|
|
1841
|
+
d.setData(h ?? V([]));
|
|
1842
|
+
else if (h)
|
|
1843
|
+
i.addSource(H, {
|
|
1844
|
+
type: "geojson",
|
|
1845
|
+
data: h
|
|
1846
|
+
});
|
|
1847
|
+
else
|
|
1848
|
+
return;
|
|
1849
|
+
!i.getLayer(Ut) && (a != null && a.fill) && i.addLayer({
|
|
1850
|
+
...a == null ? void 0 : a.fill,
|
|
1851
|
+
id: Ut,
|
|
1838
1852
|
type: "fill",
|
|
1839
|
-
source:
|
|
1840
|
-
}), !i.getLayer(
|
|
1841
|
-
...
|
|
1842
|
-
id:
|
|
1853
|
+
source: H
|
|
1854
|
+
}), !i.getLayer(qt) && (a != null && a.line) && i.addLayer({
|
|
1855
|
+
...a == null ? void 0 : a.line,
|
|
1856
|
+
id: qt,
|
|
1843
1857
|
type: "line",
|
|
1844
|
-
source:
|
|
1845
|
-
})
|
|
1858
|
+
source: H
|
|
1859
|
+
});
|
|
1846
1860
|
}
|
|
1847
|
-
|
|
1848
|
-
h();
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1861
|
+
function y(a) {
|
|
1862
|
+
h = a, g();
|
|
1863
|
+
}
|
|
1864
|
+
i.on("styledata", () => {
|
|
1865
|
+
setTimeout(() => {
|
|
1866
|
+
h && g();
|
|
1867
|
+
});
|
|
1851
1868
|
});
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1869
|
+
const x = (a) => {
|
|
1870
|
+
c == null || c({
|
|
1854
1871
|
type: "mapClick",
|
|
1855
|
-
coordinates: [
|
|
1872
|
+
coordinates: [a.lngLat.lng, a.lngLat.lat]
|
|
1856
1873
|
});
|
|
1857
1874
|
};
|
|
1858
|
-
function
|
|
1875
|
+
function m(a = !1) {
|
|
1859
1876
|
if (!t)
|
|
1860
1877
|
throw new Error();
|
|
1861
|
-
const
|
|
1862
|
-
return
|
|
1878
|
+
const d = document.createElement("div");
|
|
1879
|
+
return a && d.classList.add("marker-interactive"), new Je({
|
|
1863
1880
|
props: { displayIn: "maplibre" },
|
|
1864
|
-
target:
|
|
1865
|
-
}), new t.Marker({ element:
|
|
1866
|
-
}
|
|
1867
|
-
function x(y) {
|
|
1868
|
-
var p;
|
|
1869
|
-
l = y, y && ((p = i.getSource("full-geom")) == null || p.setData(y));
|
|
1881
|
+
target: d
|
|
1882
|
+
}), new t.Marker({ element: d, offset: [1, -13] });
|
|
1870
1883
|
}
|
|
1871
1884
|
return {
|
|
1872
|
-
setEventHandler(
|
|
1873
|
-
|
|
1885
|
+
setEventHandler(a) {
|
|
1886
|
+
a ? (c = a, i.on("click", x)) : (c = void 0, i.off("click", x));
|
|
1874
1887
|
},
|
|
1875
|
-
flyTo(
|
|
1876
|
-
i.flyTo({ center:
|
|
1888
|
+
flyTo(a, d) {
|
|
1889
|
+
i.flyTo({ center: a, ...d ? { zoom: d } : {}, ...r });
|
|
1877
1890
|
},
|
|
1878
|
-
fitBounds(
|
|
1891
|
+
fitBounds(a, d, v) {
|
|
1879
1892
|
i.fitBounds(
|
|
1880
1893
|
[
|
|
1881
|
-
[
|
|
1882
|
-
[
|
|
1894
|
+
[a[0], a[1]],
|
|
1895
|
+
[a[2], a[3]]
|
|
1883
1896
|
],
|
|
1884
|
-
{ padding:
|
|
1897
|
+
{ padding: d, ...v ? { maxZoom: v } : {}, ...o }
|
|
1885
1898
|
);
|
|
1886
1899
|
},
|
|
1887
|
-
indicateReverse(
|
|
1888
|
-
i.getCanvasContainer().style.cursor =
|
|
1900
|
+
indicateReverse(a) {
|
|
1901
|
+
i.getCanvasContainer().style.cursor = a ? "crosshair" : "";
|
|
1889
1902
|
},
|
|
1890
|
-
setReverseMarker(
|
|
1891
|
-
!t || !e || (
|
|
1903
|
+
setReverseMarker(a) {
|
|
1904
|
+
!t || !e || (s ? a ? s.setLngLat(a) : (s.remove(), s = void 0) : a && (e instanceof Function ? s = e(i) ?? void 0 : (s = (typeof e == "object" ? new t.Marker(e) : m()).setLngLat(a).addTo(i), s.getElement().classList.add("marker-reverse"))));
|
|
1892
1905
|
},
|
|
1893
|
-
setMarkers(
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
if (
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1906
|
+
setMarkers(a, d) {
|
|
1907
|
+
for (const v of u)
|
|
1908
|
+
v.remove();
|
|
1909
|
+
if (u.length = 0, y(void 0), !!t) {
|
|
1910
|
+
if (d) {
|
|
1911
|
+
let v = !1;
|
|
1912
|
+
if (d.geometry.type === "GeometryCollection") {
|
|
1913
|
+
const E = d.geometry.geometries.filter(
|
|
1914
|
+
(w) => w.type === "Polygon" || w.type === "MultiPolygon"
|
|
1915
|
+
);
|
|
1916
|
+
t: if (E.length > 0) {
|
|
1917
|
+
const w = Dt(
|
|
1918
|
+
V(E.map((b) => X(b)))
|
|
1903
1919
|
);
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
w.length > 0 && (x({
|
|
1922
|
-
...p,
|
|
1923
|
-
geometry: { type: "GeometryCollection", geometries: w }
|
|
1924
|
-
}), v = !0);
|
|
1925
|
-
}
|
|
1920
|
+
if (!w)
|
|
1921
|
+
break t;
|
|
1922
|
+
zt(
|
|
1923
|
+
{
|
|
1924
|
+
...d,
|
|
1925
|
+
geometry: w.geometry
|
|
1926
|
+
},
|
|
1927
|
+
y
|
|
1928
|
+
), v = !0;
|
|
1929
|
+
} else {
|
|
1930
|
+
const w = d.geometry.geometries.filter(
|
|
1931
|
+
(b) => b.type === "LineString" || b.type === "MultiLineString"
|
|
1932
|
+
);
|
|
1933
|
+
w.length > 0 && (y({
|
|
1934
|
+
...d,
|
|
1935
|
+
geometry: { type: "GeometryCollection", geometries: w }
|
|
1936
|
+
}), v = !0);
|
|
1926
1937
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1938
|
+
}
|
|
1939
|
+
if (!v) {
|
|
1940
|
+
if (d.geometry.type === "Polygon" || d.geometry.type === "MultiPolygon")
|
|
1941
|
+
zt(d, y);
|
|
1942
|
+
else if (d.geometry.type === "LineString" || d.geometry.type === "MultiLineString") {
|
|
1943
|
+
y(d);
|
|
1944
|
+
return;
|
|
1934
1945
|
}
|
|
1935
|
-
e && c.push(
|
|
1936
|
-
(typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p.center).addTo(i)
|
|
1937
|
-
);
|
|
1938
1946
|
}
|
|
1939
|
-
if (
|
|
1940
|
-
|
|
1941
|
-
|
|
1947
|
+
if (!l && d.geometry.type !== "Point")
|
|
1948
|
+
return;
|
|
1949
|
+
if (e instanceof Function) {
|
|
1950
|
+
const E = e(i, d);
|
|
1951
|
+
E && u.push(E);
|
|
1952
|
+
} else e && u.push(
|
|
1953
|
+
typeof e == "object" ? new t.Marker(e) : m().setLngLat(d.center).addTo(i)
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
if (n)
|
|
1957
|
+
for (const v of a ?? []) {
|
|
1958
|
+
if (v === d)
|
|
1959
|
+
continue;
|
|
1960
|
+
let E;
|
|
1961
|
+
if (n instanceof Function) {
|
|
1962
|
+
if (E = n(i, v), !E)
|
|
1942
1963
|
continue;
|
|
1943
|
-
|
|
1964
|
+
} else
|
|
1965
|
+
E = (typeof n == "object" ? new t.Marker(n) : m(!0)).setLngLat(v.center).setPopup(
|
|
1944
1966
|
new t.Popup({
|
|
1945
1967
|
offset: [1, -27],
|
|
1946
1968
|
closeButton: !1,
|
|
@@ -1949,28 +1971,28 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
|
1949
1971
|
}).setText(
|
|
1950
1972
|
v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, "")
|
|
1951
1973
|
)
|
|
1952
|
-
).addTo(i)
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}),
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1974
|
+
).addTo(i);
|
|
1975
|
+
const w = E.getElement();
|
|
1976
|
+
w.addEventListener("click", (b) => {
|
|
1977
|
+
b.stopPropagation(), c == null || c({ type: "markerClick", id: v.id });
|
|
1978
|
+
}), w.addEventListener("mouseenter", () => {
|
|
1979
|
+
c == null || c({ type: "markerMouseEnter", id: v.id }), E.togglePopup();
|
|
1980
|
+
}), w.addEventListener("mouseleave", () => {
|
|
1981
|
+
c == null || c({ type: "markerMouseLeave", id: v.id }), E.togglePopup();
|
|
1982
|
+
}), u.push(E);
|
|
1983
|
+
}
|
|
1962
1984
|
}
|
|
1963
1985
|
},
|
|
1964
|
-
setSelectedMarker(
|
|
1965
|
-
|
|
1986
|
+
setSelectedMarker(a) {
|
|
1987
|
+
p && p.getElement().classList.toggle("marker-selected", !1), p = a > -1 ? u[a] : void 0, p == null || p.getElement().classList.toggle("marker-selected", !0);
|
|
1966
1988
|
},
|
|
1967
1989
|
getCenterAndZoom() {
|
|
1968
|
-
const
|
|
1969
|
-
return [i.getZoom(),
|
|
1990
|
+
const a = i.getCenter();
|
|
1991
|
+
return [i.getZoom(), a.lng, a.lat];
|
|
1970
1992
|
}
|
|
1971
1993
|
};
|
|
1972
1994
|
}
|
|
1973
1995
|
export {
|
|
1974
|
-
|
|
1996
|
+
on as createMapLibreGlMapController
|
|
1975
1997
|
};
|
|
1976
1998
|
//# sourceMappingURL=maplibregl-controller.js.map
|