@maptiler/geocoding-control 0.0.31 → 0.0.32
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 +28 -14
- package/dist/leaflet.js +136 -132
- package/dist/leaflet.umd.cjs +1 -1
- package/dist/lib/LeafletGeocodingControl.d.ts +1 -1
- package/dist/lib/MaplibreglGeocodingControl.d.ts +1 -1
- package/package.json +2 -2
- package/src/lib/LeafletGeocodingControl.ts +15 -3
- package/src/lib/MaplibreglGeocodingControl.ts +1 -3
- package/dist/lib/LeafletMapControllerImpl.d.ts +0 -3
- package/dist/lib/MaplibreMapControllerImpl.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MapTiler Geocoding control for MapLibre GL JS and Leaflet
|
|
2
2
|
|
|
3
|
-
A geocoding control for [
|
|
3
|
+
A geocoding control for [Maplibre GL JS](https://github.com/maplibre/maplibre-gl-js) and [Leaflet](https://github.com/maplibre/maplibre-gl-js).
|
|
4
4
|
|
|
5
5
|
Component can be used as ES module or UMD module.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Component can be used as ES module or UMD module.
|
|
|
8
8
|
|
|
9
9
|
### Usage with a module bundler
|
|
10
10
|
|
|
11
|
-
Example for
|
|
11
|
+
Example for Maplibre GL JS:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install --save @maptiler/geocoding-control maplibre-gl
|
|
@@ -23,20 +23,22 @@ const API_KEY = "your API key";
|
|
|
23
23
|
|
|
24
24
|
const map = new maplibregl.Map({
|
|
25
25
|
container: "map", // id of HTML container element
|
|
26
|
-
style:
|
|
26
|
+
style:
|
|
27
|
+
"https://api.maptiler.com/maps/streets/style.json?key=" +
|
|
28
|
+
YOUR_MAPTILER_API_KEY_HERE,
|
|
27
29
|
center: [16.3, 49.2],
|
|
28
30
|
zoom: 7,
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
const gc = new GeocodingControl({
|
|
32
|
-
apiKey:
|
|
34
|
+
apiKey: YOUR_MAPTILER_API_KEY_HERE,
|
|
33
35
|
maplibregl,
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
map.addControl(gc);
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
Example for
|
|
41
|
+
Example for Leaflet:
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
44
|
npm install --save @maptiler/geocoding-control leaflet
|
|
@@ -47,19 +49,31 @@ import * as L from "leaflet";
|
|
|
47
49
|
import { GeocodingControl } from "@maptiler/geocoding-control/leaflet";
|
|
48
50
|
import "@maptiler/geocoding-control/dist/style.css";
|
|
49
51
|
|
|
50
|
-
const API_KEY = "your API key";
|
|
51
|
-
|
|
52
52
|
const map = L.map(document.getElementById("map")).setView([49.2, 16.3], 6);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
54
|
+
const scale = devicePixelRatio > 1.5 ? "@2x" : "";
|
|
55
|
+
|
|
56
|
+
L.tileLayer(
|
|
57
|
+
`https://api.maptiler.com/maps/streets/{z}/{x}/{y}${scale}.png?key=` +
|
|
58
|
+
YOUR_MAPTILER_API_KEY_HERE,
|
|
59
|
+
{
|
|
60
|
+
tileSize: 512,
|
|
61
|
+
zoomOffset: -1,
|
|
62
|
+
minZoom: 1,
|
|
63
|
+
attribution:
|
|
64
|
+
'<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a>, ' +
|
|
65
|
+
'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>',
|
|
66
|
+
crossOrigin: true,
|
|
67
|
+
}
|
|
68
|
+
).addTo(map);
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
L.control.maptilerGeocoding({ apiKey: YOUR_MAPTILER_API_KEY_HERE }).addTo(map);
|
|
60
71
|
```
|
|
61
72
|
|
|
62
|
-
|
|
73
|
+
For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.html`. After building this library (`npm install && npm run build`) you can open it in the browser:
|
|
74
|
+
|
|
75
|
+
- Maplibre GL JS: `sensible-browser file://$(pwd)/demo-maplibregl.html#key=YOUR_MAPTILER_API_KEY_HERE`
|
|
76
|
+
- Leaflet: `sensible-browser file://$(pwd)/demo-leaflet.html#key=YOUR_MAPTILER_API_KEY_HERE`
|
|
63
77
|
|
|
64
78
|
## API Documentation
|
|
65
79
|
|
|
@@ -161,5 +175,5 @@ You will find compilation result in `dist` directory.
|
|
|
161
175
|
## Running in dev mode
|
|
162
176
|
|
|
163
177
|
```bash
|
|
164
|
-
npm install && VITE_API_KEY=
|
|
178
|
+
npm install && VITE_API_KEY=YOUR_MAPTILER_API_KEY_HERE npm run dev
|
|
165
179
|
```
|
package/dist/leaflet.js
CHANGED
|
@@ -8,9 +8,9 @@ var Z = (t, e, n) => (Ve(t, e, "read from private field"), n ? n.call(t) : e.get
|
|
|
8
8
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
9
9
|
}, Ce = (t, e, n, l) => (Ve(t, e, "write to private field"), l ? l.call(t, n) : e.set(t, n), n);
|
|
10
10
|
import * as se from "leaflet";
|
|
11
|
-
function
|
|
11
|
+
function v() {
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function wt(t, e) {
|
|
14
14
|
for (const n in e)
|
|
15
15
|
t[n] = e[n];
|
|
16
16
|
return t;
|
|
@@ -18,7 +18,7 @@ function vt(t, e) {
|
|
|
18
18
|
function $e(t) {
|
|
19
19
|
return t();
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ge() {
|
|
22
22
|
return /* @__PURE__ */ Object.create(null);
|
|
23
23
|
}
|
|
24
24
|
function te(t) {
|
|
@@ -30,7 +30,7 @@ function et(t) {
|
|
|
30
30
|
function he(t, e) {
|
|
31
31
|
return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function vt(t) {
|
|
34
34
|
return Object.keys(t).length === 0;
|
|
35
35
|
}
|
|
36
36
|
function kt(t, e, n, l) {
|
|
@@ -40,7 +40,7 @@ function kt(t, e, n, l) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function tt(t, e, n, l) {
|
|
43
|
-
return t[1] && l ?
|
|
43
|
+
return t[1] && l ? wt(n.ctx.slice(), t[1](l(e))) : n.ctx;
|
|
44
44
|
}
|
|
45
45
|
function Ct(t, e, n, l) {
|
|
46
46
|
if (t[2] && l) {
|
|
@@ -72,7 +72,7 @@ function Tt(t) {
|
|
|
72
72
|
}
|
|
73
73
|
return -1;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Ue(t) {
|
|
76
76
|
return t == null ? "" : t;
|
|
77
77
|
}
|
|
78
78
|
function y(t, e) {
|
|
@@ -84,7 +84,7 @@ function V(t, e, n) {
|
|
|
84
84
|
function H(t) {
|
|
85
85
|
t.parentNode.removeChild(t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Lt(t, e) {
|
|
88
88
|
for (let n = 0; n < t.length; n += 1)
|
|
89
89
|
t[n] && t[n].d(e);
|
|
90
90
|
}
|
|
@@ -103,7 +103,7 @@ function x() {
|
|
|
103
103
|
function Q(t, e, n, l) {
|
|
104
104
|
return t.addEventListener(e, n, l), () => t.removeEventListener(e, n, l);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Et(t) {
|
|
107
107
|
return function(e) {
|
|
108
108
|
return e.preventDefault(), t.call(this, e);
|
|
109
109
|
};
|
|
@@ -111,13 +111,13 @@ function Rt(t) {
|
|
|
111
111
|
function f(t, e, n) {
|
|
112
112
|
n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Rt(t) {
|
|
115
115
|
return Array.from(t.childNodes);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function we(t, e) {
|
|
118
118
|
e = "" + e, t.wholeText !== e && (t.data = e);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function We(t, e) {
|
|
121
121
|
t.value = e == null ? "" : e;
|
|
122
122
|
}
|
|
123
123
|
function O(t, e, n) {
|
|
@@ -127,14 +127,14 @@ function St(t, e, { bubbles: n = !1, cancelable: l = !1 } = {}) {
|
|
|
127
127
|
const r = document.createEvent("CustomEvent");
|
|
128
128
|
return r.initCustomEvent(t, n, l, e), r;
|
|
129
129
|
}
|
|
130
|
-
let
|
|
130
|
+
let ve;
|
|
131
131
|
function pe(t) {
|
|
132
|
-
|
|
132
|
+
ve = t;
|
|
133
133
|
}
|
|
134
134
|
function nt() {
|
|
135
|
-
if (!
|
|
135
|
+
if (!ve)
|
|
136
136
|
throw new Error("Function called outside component initialization");
|
|
137
|
-
return
|
|
137
|
+
return ve;
|
|
138
138
|
}
|
|
139
139
|
function It(t) {
|
|
140
140
|
nt().$$.on_destroy.push(t);
|
|
@@ -163,7 +163,7 @@ function je(t) {
|
|
|
163
163
|
const Pe = /* @__PURE__ */ new Set();
|
|
164
164
|
let Me = 0;
|
|
165
165
|
function lt() {
|
|
166
|
-
const t =
|
|
166
|
+
const t = ve;
|
|
167
167
|
do {
|
|
168
168
|
for (; Me < be.length; ) {
|
|
169
169
|
const e = be[Me];
|
|
@@ -188,27 +188,27 @@ function zt(t) {
|
|
|
188
188
|
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(je);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const Le = /* @__PURE__ */ new Set();
|
|
192
192
|
let oe;
|
|
193
|
-
function
|
|
193
|
+
function Ee() {
|
|
194
194
|
oe = {
|
|
195
195
|
r: 0,
|
|
196
196
|
c: [],
|
|
197
197
|
p: oe
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Re() {
|
|
201
201
|
oe.r || te(oe.c), oe = oe.p;
|
|
202
202
|
}
|
|
203
203
|
function P(t, e) {
|
|
204
|
-
t && t.i && (
|
|
204
|
+
t && t.i && (Le.delete(t), t.i(e));
|
|
205
205
|
}
|
|
206
206
|
function q(t, e, n, l) {
|
|
207
207
|
if (t && t.o) {
|
|
208
|
-
if (
|
|
208
|
+
if (Le.has(t))
|
|
209
209
|
return;
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
Le.add(t), oe.c.push(() => {
|
|
211
|
+
Le.delete(t), l && (n && t.d(1), l());
|
|
212
212
|
}), t.o(e);
|
|
213
213
|
} else
|
|
214
214
|
l && l();
|
|
@@ -231,22 +231,22 @@ function jt(t, e) {
|
|
|
231
231
|
t.$$.dirty[0] === -1 && (be.push(t), At(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
232
232
|
}
|
|
233
233
|
function _e(t, e, n, l, r, c, o, i = [-1]) {
|
|
234
|
-
const u =
|
|
234
|
+
const u = ve;
|
|
235
235
|
pe(t);
|
|
236
236
|
const a = t.$$ = {
|
|
237
237
|
fragment: null,
|
|
238
238
|
ctx: [],
|
|
239
239
|
props: c,
|
|
240
|
-
update:
|
|
240
|
+
update: v,
|
|
241
241
|
not_equal: r,
|
|
242
|
-
bound:
|
|
242
|
+
bound: Ge(),
|
|
243
243
|
on_mount: [],
|
|
244
244
|
on_destroy: [],
|
|
245
245
|
on_disconnect: [],
|
|
246
246
|
before_update: [],
|
|
247
247
|
after_update: [],
|
|
248
248
|
context: new Map(e.context || (u ? u.$$.context : [])),
|
|
249
|
-
callbacks:
|
|
249
|
+
callbacks: Ge(),
|
|
250
250
|
dirty: i,
|
|
251
251
|
skip_bound: !1,
|
|
252
252
|
root: e.target || u.$$.root
|
|
@@ -258,7 +258,7 @@ function _e(t, e, n, l, r, c, o, i = [-1]) {
|
|
|
258
258
|
return a.ctx && r(a.ctx[p], a.ctx[p] = m) && (!a.skip_bound && a.bound[p] && a.bound[p](m), h && jt(t, p)), D;
|
|
259
259
|
}) : [], a.update(), h = !0, te(a.before_update), a.fragment = l ? l(a.ctx) : !1, e.target) {
|
|
260
260
|
if (e.hydrate) {
|
|
261
|
-
const p =
|
|
261
|
+
const p = Rt(e.target);
|
|
262
262
|
a.fragment && a.fragment.l(p), p.forEach(H);
|
|
263
263
|
} else
|
|
264
264
|
a.fragment && a.fragment.c();
|
|
@@ -268,11 +268,11 @@ function _e(t, e, n, l, r, c, o, i = [-1]) {
|
|
|
268
268
|
}
|
|
269
269
|
class ge {
|
|
270
270
|
$destroy() {
|
|
271
|
-
de(this, 1), this.$destroy =
|
|
271
|
+
de(this, 1), this.$destroy = v;
|
|
272
272
|
}
|
|
273
273
|
$on(e, n) {
|
|
274
274
|
if (!et(n))
|
|
275
|
-
return
|
|
275
|
+
return v;
|
|
276
276
|
const l = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
277
277
|
return l.push(n), () => {
|
|
278
278
|
const r = l.indexOf(n);
|
|
@@ -280,7 +280,7 @@ class ge {
|
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
$set(e) {
|
|
283
|
-
this.$$set && !
|
|
283
|
+
this.$$set && !vt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
function Ot(t) {
|
|
@@ -292,9 +292,9 @@ function Ot(t) {
|
|
|
292
292
|
m(l, r) {
|
|
293
293
|
V(l, e, r), y(e, n);
|
|
294
294
|
},
|
|
295
|
-
p:
|
|
296
|
-
i:
|
|
297
|
-
o:
|
|
295
|
+
p: v,
|
|
296
|
+
i: v,
|
|
297
|
+
o: v,
|
|
298
298
|
d(l) {
|
|
299
299
|
l && H(e);
|
|
300
300
|
}
|
|
@@ -314,9 +314,9 @@ function Nt(t) {
|
|
|
314
314
|
m(l, r) {
|
|
315
315
|
V(l, e, r), y(e, n);
|
|
316
316
|
},
|
|
317
|
-
p:
|
|
318
|
-
i:
|
|
319
|
-
o:
|
|
317
|
+
p: v,
|
|
318
|
+
i: v,
|
|
319
|
+
o: v,
|
|
320
320
|
d(l) {
|
|
321
321
|
l && H(e);
|
|
322
322
|
}
|
|
@@ -336,9 +336,9 @@ function Ht(t) {
|
|
|
336
336
|
m(n, l) {
|
|
337
337
|
V(n, e, l);
|
|
338
338
|
},
|
|
339
|
-
p:
|
|
340
|
-
i:
|
|
341
|
-
o:
|
|
339
|
+
p: v,
|
|
340
|
+
i: v,
|
|
341
|
+
o: v,
|
|
342
342
|
d(n) {
|
|
343
343
|
n && H(e);
|
|
344
344
|
}
|
|
@@ -361,8 +361,8 @@ function Qt(t) {
|
|
|
361
361
|
p(r, [c]) {
|
|
362
362
|
c & 1 && l !== (l = r[0] !== "list" ? void 0 : "20") && f(e, "width", l), c & 1 && O(e, "in-map", r[0] !== "list"), c & 1 && O(e, "for-maplibre", r[0] === "maplibre"), c & 1 && O(e, "for-leaflet", r[0] === "leaflet"), c & 1 && O(e, "list-icon", r[0] === "list");
|
|
363
363
|
},
|
|
364
|
-
i:
|
|
365
|
-
o:
|
|
364
|
+
i: v,
|
|
365
|
+
o: v,
|
|
366
366
|
d(r) {
|
|
367
367
|
r && H(e);
|
|
368
368
|
}
|
|
@@ -379,7 +379,7 @@ class rt extends ge {
|
|
|
379
379
|
super(), _e(this, e, Vt, Qt, he, { displayIn: 0 });
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Gt(t) {
|
|
383
383
|
let e, n;
|
|
384
384
|
return {
|
|
385
385
|
c() {
|
|
@@ -388,17 +388,17 @@ function Ut(t) {
|
|
|
388
388
|
m(l, r) {
|
|
389
389
|
V(l, e, r), y(e, n);
|
|
390
390
|
},
|
|
391
|
-
p:
|
|
392
|
-
i:
|
|
393
|
-
o:
|
|
391
|
+
p: v,
|
|
392
|
+
i: v,
|
|
393
|
+
o: v,
|
|
394
394
|
d(l) {
|
|
395
395
|
l && H(e);
|
|
396
396
|
}
|
|
397
397
|
};
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class Ut extends ge {
|
|
400
400
|
constructor(e) {
|
|
401
|
-
super(), _e(this, e, null,
|
|
401
|
+
super(), _e(this, e, null, Gt, he, {});
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
function xe(t, e, n) {
|
|
@@ -448,7 +448,7 @@ function Xe(t) {
|
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function Wt(t) {
|
|
452
452
|
let e, n, l, r, c = t[10], o = [];
|
|
453
453
|
for (let u = 0; u < c.length; u += 1)
|
|
454
454
|
o[u] = Fe(xe(t, c, u));
|
|
@@ -479,9 +479,9 @@ function Gt(t) {
|
|
|
479
479
|
const p = xe(u, c, h);
|
|
480
480
|
o[h] ? (o[h].p(p, a), P(o[h], 1)) : (o[h] = Fe(p), o[h].c(), P(o[h], 1), o[h].m(e, null));
|
|
481
481
|
}
|
|
482
|
-
for (
|
|
482
|
+
for (Ee(), h = c.length; h < o.length; h += 1)
|
|
483
483
|
i(h);
|
|
484
|
-
|
|
484
|
+
Re();
|
|
485
485
|
}
|
|
486
486
|
},
|
|
487
487
|
i(u) {
|
|
@@ -498,7 +498,7 @@ function Gt(t) {
|
|
|
498
498
|
n = !1;
|
|
499
499
|
},
|
|
500
500
|
d(u) {
|
|
501
|
-
u && H(e),
|
|
501
|
+
u && H(e), Lt(o, u), l = !1, te(r);
|
|
502
502
|
}
|
|
503
503
|
};
|
|
504
504
|
}
|
|
@@ -512,10 +512,10 @@ function Zt(t) {
|
|
|
512
512
|
V(l, e, r), y(e, n);
|
|
513
513
|
},
|
|
514
514
|
p(l, r) {
|
|
515
|
-
r[0] & 32 &&
|
|
515
|
+
r[0] & 32 && we(n, l[5]);
|
|
516
516
|
},
|
|
517
|
-
i:
|
|
518
|
-
o:
|
|
517
|
+
i: v,
|
|
518
|
+
o: v,
|
|
519
519
|
d(l) {
|
|
520
520
|
l && H(e);
|
|
521
521
|
}
|
|
@@ -531,10 +531,10 @@ function xt(t) {
|
|
|
531
531
|
V(l, e, r), y(e, n);
|
|
532
532
|
},
|
|
533
533
|
p(l, r) {
|
|
534
|
-
r[0] & 16 &&
|
|
534
|
+
r[0] & 16 && we(n, l[4]);
|
|
535
535
|
},
|
|
536
|
-
i:
|
|
537
|
-
o:
|
|
536
|
+
i: v,
|
|
537
|
+
o: v,
|
|
538
538
|
d(l) {
|
|
539
539
|
l && H(e);
|
|
540
540
|
}
|
|
@@ -549,9 +549,9 @@ function Jt(t) {
|
|
|
549
549
|
m(l, r) {
|
|
550
550
|
V(l, n, r);
|
|
551
551
|
},
|
|
552
|
-
p:
|
|
553
|
-
i:
|
|
554
|
-
o:
|
|
552
|
+
p: v,
|
|
553
|
+
i: v,
|
|
554
|
+
o: v,
|
|
555
555
|
d(l) {
|
|
556
556
|
l && H(n);
|
|
557
557
|
}
|
|
@@ -567,7 +567,7 @@ function Ye(t) {
|
|
|
567
567
|
V(r, e, c), y(e, l);
|
|
568
568
|
},
|
|
569
569
|
p(r, c) {
|
|
570
|
-
c[0] & 1024 && n !== (n = r[59].place_type + "") &&
|
|
570
|
+
c[0] & 1024 && n !== (n = r[59].place_type + "") && we(l, n);
|
|
571
571
|
},
|
|
572
572
|
d(r) {
|
|
573
573
|
r && H(e);
|
|
@@ -575,13 +575,13 @@ function Ye(t) {
|
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
577
|
function Fe(t) {
|
|
578
|
-
let e, n, l, r, c, o, i = t[59].place_name.replace(/,.*/, "") + "", u, a, h, p, D, d = t[59].place_name.replace(/[^,]*,?\s*/, "") + "", m, g, b, C, M,
|
|
578
|
+
let e, n, l, r, c, o, i = t[59].place_name.replace(/,.*/, "") + "", u, a, h, p, D, d = t[59].place_name.replace(/[^,]*,?\s*/, "") + "", m, g, b, C, M, G;
|
|
579
579
|
n = new rt({ props: { displayIn: "list" } });
|
|
580
580
|
let T = t[8] && Ye(t);
|
|
581
|
-
function
|
|
581
|
+
function L() {
|
|
582
582
|
return t[48](t[61]);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function w() {
|
|
585
585
|
return t[49](t[59]);
|
|
586
586
|
}
|
|
587
587
|
return {
|
|
@@ -589,13 +589,13 @@ function Fe(t) {
|
|
|
589
589
|
e = A("li"), ke(n.$$.fragment), l = x(), r = A("span"), c = A("span"), o = A("span"), u = ce(i), a = x(), T && T.c(), h = x(), p = A("span"), D = A("span"), m = ce(d), g = x(), f(o, "class", "svelte-16s24r9"), f(c, "class", "svelte-16s24r9"), f(r, "class", "svelte-16s24r9"), f(D, "class", "svelte-16s24r9"), f(p, "class", "svelte-16s24r9"), f(e, "tabindex", "0"), f(e, "data-selected", b = t[12] === t[61]), f(e, "class", "svelte-16s24r9"), O(e, "selected", t[12] === t[61]);
|
|
590
590
|
},
|
|
591
591
|
m(j, k) {
|
|
592
|
-
V(j, e, k), ae(n, e, null), y(e, l), y(e, r), y(r, c), y(c, o), y(o, u), y(c, a), T && T.m(c, null), y(e, h), y(e, p), y(p, D), y(D, m), y(e, g), C = !0, M || (
|
|
593
|
-
Q(e, "mouseover",
|
|
594
|
-
Q(e, "focus",
|
|
592
|
+
V(j, e, k), ae(n, e, null), y(e, l), y(e, r), y(r, c), y(c, o), y(o, u), y(c, a), T && T.m(c, null), y(e, h), y(e, p), y(p, D), y(D, m), y(e, g), C = !0, M || (G = [
|
|
593
|
+
Q(e, "mouseover", L),
|
|
594
|
+
Q(e, "focus", w)
|
|
595
595
|
], M = !0);
|
|
596
596
|
},
|
|
597
597
|
p(j, k) {
|
|
598
|
-
t = j, (!C || k[0] & 1024) && i !== (i = t[59].place_name.replace(/,.*/, "") + "") &&
|
|
598
|
+
t = j, (!C || k[0] & 1024) && i !== (i = t[59].place_name.replace(/,.*/, "") + "") && we(u, i), t[8] ? T ? T.p(t, k) : (T = Ye(t), T.c(), T.m(c, null)) : T && (T.d(1), T = null), (!C || k[0] & 1024) && d !== (d = t[59].place_name.replace(/[^,]*,?\s*/, "") + "") && we(m, d), (!C || k[0] & 4096 && b !== (b = t[12] === t[61])) && f(e, "data-selected", b), (!C || k[0] & 4096) && O(e, "selected", t[12] === t[61]);
|
|
599
599
|
},
|
|
600
600
|
i(j) {
|
|
601
601
|
C || (P(n.$$.fragment, j), C = !0);
|
|
@@ -604,25 +604,25 @@ function Fe(t) {
|
|
|
604
604
|
q(n.$$.fragment, j), C = !1;
|
|
605
605
|
},
|
|
606
606
|
d(j) {
|
|
607
|
-
j && H(e), de(n), T && T.d(), M = !1, te(
|
|
607
|
+
j && H(e), de(n), T && T.d(), M = !1, te(G);
|
|
608
608
|
}
|
|
609
609
|
};
|
|
610
610
|
}
|
|
611
611
|
function Xt(t) {
|
|
612
|
-
let e, n, l, r, c, o, i, u, a, h, p, D, d, m, g, b, C, M,
|
|
613
|
-
r = new
|
|
614
|
-
let
|
|
615
|
-
const j = t[39].default, k = kt(j, t, t[38], null),
|
|
612
|
+
let e, n, l, r, c, o, i, u, a, h, p, D, d, m, g, b, C, M, G, T;
|
|
613
|
+
r = new Ut({}), h = new qt({});
|
|
614
|
+
let L = t[16] && Je(), w = t[7] && Xe(t);
|
|
615
|
+
const j = t[39].default, k = kt(j, t, t[38], null), R = [Jt, xt, Zt, Wt], z = [];
|
|
616
616
|
function me(_, S) {
|
|
617
617
|
var J, X;
|
|
618
618
|
return _[13] ? _[15] ? 1 : ((J = _[10]) == null ? void 0 : J.length) === 0 ? 2 : _[13] && ((X = _[10]) == null ? void 0 : X.length) ? 3 : -1 : 0;
|
|
619
619
|
}
|
|
620
|
-
return ~(g = me(t)) && (b = z[g] =
|
|
620
|
+
return ~(g = me(t)) && (b = z[g] = R[g](t)), {
|
|
621
621
|
c() {
|
|
622
|
-
e = A("form"), n = A("div"), l = A("button"), ke(r.$$.fragment), c = x(), o = A("input"), i = x(), u = A("div"), a = A("button"), ke(h.$$.fragment), p = x(),
|
|
622
|
+
e = A("form"), n = A("div"), l = A("button"), ke(r.$$.fragment), c = x(), o = A("input"), i = x(), u = A("div"), a = A("button"), ke(h.$$.fragment), p = x(), L && L.c(), D = x(), w && w.c(), d = x(), k && k.c(), m = x(), b && b.c(), f(l, "type", "button"), f(l, "class", "svelte-16s24r9"), f(o, "placeholder", t[3]), f(o, "aria-label", t[3]), f(o, "class", "svelte-16s24r9"), f(a, "type", "button"), f(a, "class", "svelte-16s24r9"), O(a, "displayable", t[0] !== ""), f(u, "class", "clear-button-container svelte-16s24r9"), f(n, "class", "input-group svelte-16s24r9"), f(e, "tabindex", "0"), f(e, "class", C = Ue(t[2]) + " svelte-16s24r9"), O(e, "can-collapse", t[6] && t[0] === "");
|
|
623
623
|
},
|
|
624
624
|
m(_, S) {
|
|
625
|
-
V(_, e, S), y(e, n), y(n, l), ae(r, l, null), y(n, c), y(n, o), t[41](o),
|
|
625
|
+
V(_, e, S), y(e, n), y(n, l), ae(r, l, null), y(n, c), y(n, o), t[41](o), We(o, t[0]), y(n, i), y(n, u), y(u, a), ae(h, a, null), y(u, p), L && L.m(u, null), y(n, D), w && w.m(n, null), y(n, d), k && k.m(n, null), y(e, m), ~g && z[g].m(e, null), M = !0, G || (T = [
|
|
626
626
|
Q(l, "click", t[40]),
|
|
627
627
|
Q(o, "input", t[42]),
|
|
628
628
|
Q(o, "focus", t[43]),
|
|
@@ -630,15 +630,15 @@ function Xt(t) {
|
|
|
630
630
|
Q(o, "keydown", t[18]),
|
|
631
631
|
Q(o, "input", t[45]),
|
|
632
632
|
Q(a, "click", t[46]),
|
|
633
|
-
Q(e, "submit",
|
|
634
|
-
],
|
|
633
|
+
Q(e, "submit", Et(t[17]))
|
|
634
|
+
], G = !0);
|
|
635
635
|
},
|
|
636
636
|
p(_, S) {
|
|
637
|
-
(!M || S[0] & 8) && f(o, "placeholder", _[3]), (!M || S[0] & 8) && f(o, "aria-label", _[3]), S[0] & 1 && o.value !== _[0] &&
|
|
638
|
-
|
|
639
|
-
}),
|
|
640
|
-
|
|
641
|
-
}),
|
|
637
|
+
(!M || S[0] & 8) && f(o, "placeholder", _[3]), (!M || S[0] & 8) && f(o, "aria-label", _[3]), S[0] & 1 && o.value !== _[0] && We(o, _[0]), (!M || S[0] & 1) && O(a, "displayable", _[0] !== ""), _[16] ? L ? S[0] & 65536 && P(L, 1) : (L = Je(), L.c(), P(L, 1), L.m(u, null)) : L && (Ee(), q(L, 1, 1, () => {
|
|
638
|
+
L = null;
|
|
639
|
+
}), Re()), _[7] ? w ? (w.p(_, S), S[0] & 128 && P(w, 1)) : (w = Xe(_), w.c(), P(w, 1), w.m(n, d)) : w && (Ee(), q(w, 1, 1, () => {
|
|
640
|
+
w = null;
|
|
641
|
+
}), Re()), k && k.p && (!M || S[1] & 128) && Mt(
|
|
642
642
|
k,
|
|
643
643
|
j,
|
|
644
644
|
_,
|
|
@@ -647,23 +647,23 @@ function Xt(t) {
|
|
|
647
647
|
null
|
|
648
648
|
);
|
|
649
649
|
let J = g;
|
|
650
|
-
g = me(_), g === J ? ~g && z[g].p(_, S) : (b && (
|
|
650
|
+
g = me(_), g === J ? ~g && z[g].p(_, S) : (b && (Ee(), q(z[J], 1, 1, () => {
|
|
651
651
|
z[J] = null;
|
|
652
|
-
}),
|
|
652
|
+
}), Re()), ~g ? (b = z[g], b ? b.p(_, S) : (b = z[g] = R[g](_), b.c()), P(b, 1), b.m(e, null)) : b = null), (!M || S[0] & 4 && C !== (C = Ue(_[2]) + " svelte-16s24r9")) && f(e, "class", C), (!M || S[0] & 69) && O(e, "can-collapse", _[6] && _[0] === "");
|
|
653
653
|
},
|
|
654
654
|
i(_) {
|
|
655
|
-
M || (P(r.$$.fragment, _), P(h.$$.fragment, _), P(
|
|
655
|
+
M || (P(r.$$.fragment, _), P(h.$$.fragment, _), P(L), P(w), P(k, _), P(b), M = !0);
|
|
656
656
|
},
|
|
657
657
|
o(_) {
|
|
658
|
-
q(r.$$.fragment, _), q(h.$$.fragment, _), q(
|
|
658
|
+
q(r.$$.fragment, _), q(h.$$.fragment, _), q(L), q(w), q(k, _), q(b), M = !1;
|
|
659
659
|
},
|
|
660
660
|
d(_) {
|
|
661
|
-
_ && H(e), de(r), t[41](null), de(h),
|
|
661
|
+
_ && H(e), de(r), t[41](null), de(h), L && L.d(), w && w.d(), k && k.d(_), ~g && z[g].d(), G = !1, te(T);
|
|
662
662
|
}
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
665
|
function Yt(t, e, n) {
|
|
666
|
-
let l, { $$slots: r = {}, $$scope: c } = e, { class: o = void 0 } = e, { mapController: i = void 0 } = e, { apiKey: u } = e, { debounceSearch: a = 200 } = e, { placeholder: h = "Search" } = e, { errorMessage: p = "Searching failed" } = e, { noResultsMessage: D = "No results found" } = e, { proximity: d = void 0 } = e, { bbox: m = void 0 } = e, { trackProximity: g = !0 } = e, { minLength: b = 2 } = e, { language: C = void 0 } = e, { showResultsWhileTyping: M = !0 } = e, { zoom:
|
|
666
|
+
let l, { $$slots: r = {}, $$scope: c } = e, { class: o = void 0 } = e, { mapController: i = void 0 } = e, { apiKey: u } = e, { debounceSearch: a = 200 } = e, { placeholder: h = "Search" } = e, { errorMessage: p = "Searching failed" } = e, { noResultsMessage: D = "No results found" } = e, { proximity: d = void 0 } = e, { bbox: m = void 0 } = e, { trackProximity: g = !0 } = e, { minLength: b = 2 } = e, { language: C = void 0 } = e, { showResultsWhileTyping: M = !0 } = e, { zoom: G = 16 } = e, { flyTo: T = !0 } = e, { collapsed: L = !1 } = e, { clearOnBlur: w = !1 } = e, { enableReverse: j = !1 } = e, { filter: k = () => !0 } = e, { searchValue: R = "" } = e, { reverseActive: z = !1 } = e, { showPlaceType: me = !1 } = e;
|
|
667
667
|
function _() {
|
|
668
668
|
Y.focus();
|
|
669
669
|
}
|
|
@@ -671,25 +671,25 @@ function Yt(t, e, n) {
|
|
|
671
671
|
Y.blur();
|
|
672
672
|
}
|
|
673
673
|
function J(s, K = !0) {
|
|
674
|
-
n(0,
|
|
674
|
+
n(0, R = s), K && (n(12, B = -1), Ne());
|
|
675
675
|
}
|
|
676
|
-
let X = !1,
|
|
676
|
+
let X = !1, E, N, I, Oe = "", Y, B = -1, ne, De = [], le, Se, Ie;
|
|
677
677
|
const F = Bt();
|
|
678
678
|
It(() => {
|
|
679
679
|
i && (i.setProximityChangeHandler(void 0), i.setMapClickHandler(void 0), i.indicateReverse(!1), i.setSelectedMarker(-1), i.setMarkers(void 0, void 0));
|
|
680
680
|
});
|
|
681
681
|
function Ne() {
|
|
682
|
-
B > -1 &&
|
|
683
|
-
n(36, N =
|
|
682
|
+
B > -1 && E ? (n(11, I = E[B]), n(0, R = I.place_name.replace(/,.*/, "")), n(15, ne = void 0), n(36, N = void 0), n(12, B = -1)) : R && qe(R).then(() => {
|
|
683
|
+
n(36, N = E), n(11, I = void 0), st();
|
|
684
684
|
}).catch((s) => n(15, ne = s));
|
|
685
685
|
}
|
|
686
686
|
async function qe(s) {
|
|
687
687
|
n(15, ne = void 0);
|
|
688
|
-
const K = /^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s),
|
|
689
|
-
|
|
690
|
-
const re = "https://api.maptiler.com/geocoding/" + encodeURIComponent(s) + ".json?" +
|
|
688
|
+
const K = /^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s), W = new URLSearchParams();
|
|
689
|
+
W.set("key", u), C && W.set("language", String(C)), K || (m && W.set("bbox", m.join(",")), d && W.set("proximity", d.join(",")));
|
|
690
|
+
const re = "https://api.maptiler.com/geocoding/" + encodeURIComponent(s) + ".json?" + W.toString();
|
|
691
691
|
if (re === Oe) {
|
|
692
|
-
n(10,
|
|
692
|
+
n(10, E = De);
|
|
693
693
|
return;
|
|
694
694
|
}
|
|
695
695
|
Oe = re, le == null || le.abort(), n(16, le = new AbortController());
|
|
@@ -706,38 +706,38 @@ function Yt(t, e, n) {
|
|
|
706
706
|
if (!fe.ok)
|
|
707
707
|
throw new Error();
|
|
708
708
|
const ye = await fe.json();
|
|
709
|
-
F("response", { url: re, featureCollection: ye }), n(10,
|
|
709
|
+
F("response", { url: re, featureCollection: ye }), n(10, E = ye.features.filter(k)), De = E, K && Y.focus();
|
|
710
710
|
}
|
|
711
711
|
function st() {
|
|
712
|
-
var K,
|
|
712
|
+
var K, W, re, fe, ye, ue, Ke, Qe;
|
|
713
713
|
if (!(N != null && N.length) || !T)
|
|
714
714
|
return;
|
|
715
715
|
const s = [180, 90, -180, -90];
|
|
716
716
|
for (const $ of N)
|
|
717
|
-
s[0] = Math.min(s[0], (
|
|
718
|
-
i && N.length > 0 && (I && s[0] === s[2] && s[1] === s[3] ? i.flyTo(I.center,
|
|
717
|
+
s[0] = Math.min(s[0], (W = (K = $.bbox) == null ? void 0 : K[0]) != null ? W : $.center[0]), s[1] = Math.min(s[1], (fe = (re = $.bbox) == null ? void 0 : re[1]) != null ? fe : $.center[1]), s[2] = Math.max(s[2], (ue = (ye = $.bbox) == null ? void 0 : ye[2]) != null ? ue : $.center[0]), s[3] = Math.max(s[3], (Qe = (Ke = $.bbox) == null ? void 0 : Ke[3]) != null ? Qe : $.center[1]);
|
|
718
|
+
i && N.length > 0 && (I && s[0] === s[2] && s[1] === s[3] ? i.flyTo(I.center, G) : i.fitBounds(s, 50));
|
|
719
719
|
}
|
|
720
720
|
function ot(s) {
|
|
721
721
|
n(1, z = !1), J(s[0].toFixed(6) + "," + s[1].toFixed(6));
|
|
722
722
|
}
|
|
723
723
|
function it(s) {
|
|
724
|
-
if (!
|
|
724
|
+
if (!E)
|
|
725
725
|
return;
|
|
726
726
|
let K = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
|
|
727
|
-
K ? (B === -1 && K === -1 && n(12, B =
|
|
727
|
+
K ? (B === -1 && K === -1 && n(12, B = E.length), n(12, B += K), B >= E.length && n(12, B = -1), s.preventDefault()) : ["ArrowLeft", "ArrowRight", "Home", "End"].includes(s.key) && n(12, B = -1);
|
|
728
728
|
}
|
|
729
729
|
function He(s = !0) {
|
|
730
|
-
if (M &&
|
|
730
|
+
if (M && R.length > b) {
|
|
731
731
|
Se && clearTimeout(Se);
|
|
732
|
-
const K =
|
|
732
|
+
const K = R;
|
|
733
733
|
Se = window.setTimeout(
|
|
734
734
|
() => {
|
|
735
|
-
qe(K).catch((
|
|
735
|
+
qe(K).catch((W) => n(15, ne = W));
|
|
736
736
|
},
|
|
737
737
|
s ? a : 0
|
|
738
738
|
);
|
|
739
739
|
} else
|
|
740
|
-
n(10,
|
|
740
|
+
n(10, E = void 0), n(15, ne = void 0);
|
|
741
741
|
}
|
|
742
742
|
const ct = () => Y.focus();
|
|
743
743
|
function ft(s) {
|
|
@@ -746,34 +746,34 @@ function Yt(t, e, n) {
|
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
function ut() {
|
|
749
|
-
|
|
749
|
+
R = this.value, n(0, R), n(9, X), n(31, w);
|
|
750
750
|
}
|
|
751
751
|
const at = () => n(9, X = !0), dt = () => n(9, X = !1), ht = () => He(), _t = () => {
|
|
752
|
-
n(0,
|
|
752
|
+
n(0, R = ""), Y.focus();
|
|
753
753
|
}, gt = () => n(1, z = !z), mt = (s) => n(12, B = s), yt = (s) => {
|
|
754
|
-
n(11, I = s), n(0,
|
|
754
|
+
n(11, I = s), n(0, R = s.place_name.replace(/,.*/, "")), n(12, B = -1);
|
|
755
755
|
}, bt = () => n(12, B = -1), pt = () => {
|
|
756
756
|
};
|
|
757
757
|
return t.$$set = (s) => {
|
|
758
|
-
"class" in s && n(2, o = s.class), "mapController" in s && n(21, i = s.mapController), "apiKey" in s && n(22, u = s.apiKey), "debounceSearch" in s && n(23, a = s.debounceSearch), "placeholder" in s && n(3, h = s.placeholder), "errorMessage" in s && n(4, p = s.errorMessage), "noResultsMessage" in s && n(5, D = s.noResultsMessage), "proximity" in s && n(20, d = s.proximity), "bbox" in s && n(24, m = s.bbox), "trackProximity" in s && n(25, g = s.trackProximity), "minLength" in s && n(26, b = s.minLength), "language" in s && n(27, C = s.language), "showResultsWhileTyping" in s && n(28, M = s.showResultsWhileTyping), "zoom" in s && n(29,
|
|
758
|
+
"class" in s && n(2, o = s.class), "mapController" in s && n(21, i = s.mapController), "apiKey" in s && n(22, u = s.apiKey), "debounceSearch" in s && n(23, a = s.debounceSearch), "placeholder" in s && n(3, h = s.placeholder), "errorMessage" in s && n(4, p = s.errorMessage), "noResultsMessage" in s && n(5, D = s.noResultsMessage), "proximity" in s && n(20, d = s.proximity), "bbox" in s && n(24, m = s.bbox), "trackProximity" in s && n(25, g = s.trackProximity), "minLength" in s && n(26, b = s.minLength), "language" in s && n(27, C = s.language), "showResultsWhileTyping" in s && n(28, M = s.showResultsWhileTyping), "zoom" in s && n(29, G = s.zoom), "flyTo" in s && n(30, T = s.flyTo), "collapsed" in s && n(6, L = s.collapsed), "clearOnBlur" in s && n(31, w = s.clearOnBlur), "enableReverse" in s && n(7, j = s.enableReverse), "filter" in s && n(32, k = s.filter), "searchValue" in s && n(0, R = s.searchValue), "reverseActive" in s && n(1, z = s.reverseActive), "showPlaceType" in s && n(8, me = s.showPlaceType), "$$scope" in s && n(38, c = s.$$scope);
|
|
759
759
|
}, t.$$.update = () => {
|
|
760
760
|
t.$$.dirty[0] & 35651584 && i && i.setProximityChangeHandler(g ? (s) => {
|
|
761
761
|
n(20, d = s);
|
|
762
762
|
} : void 0), t.$$.dirty[0] & 33554432 && (g || n(20, d = void 0)), t.$$.dirty[0] & 512 | t.$$.dirty[1] & 1 && setTimeout(() => {
|
|
763
|
-
n(13, Ie = X),
|
|
764
|
-
}), t.$$.dirty[0] & 1025 && (
|
|
763
|
+
n(13, Ie = X), w && !X && n(0, R = "");
|
|
764
|
+
}), t.$$.dirty[0] & 1025 && (R || (n(11, I = void 0), n(10, E = void 0), n(15, ne = void 0), n(36, N = E))), t.$$.dirty[0] & 1612711936 && i && I && T && (!I.bbox || I.bbox[0] === I.bbox[2] && I.bbox[1] === I.bbox[3] ? i.flyTo(I.center, G) : i.fitBounds(I.bbox, 0), n(10, E = void 0), n(36, N = void 0), n(12, B = -1)), t.$$.dirty[0] & 1024 | t.$$.dirty[1] & 32 && N !== E && n(36, N = void 0), t.$$.dirty[0] & 2099200 | t.$$.dirty[1] & 32 && i && i.setMarkers(N, I), t.$$.dirty[0] & 1 && n(12, B = -1), t.$$.dirty[0] & 2101248 && (i == null || i.setSelectedMarker(B)), t.$$.dirty[0] & 5120 && n(37, l = E == null ? void 0 : E[B]), t.$$.dirty[1] & 64 && F("select", l), t.$$.dirty[0] & 2048 && F("pick", I), t.$$.dirty[0] & 9216 && F("optionsVisibilityChange", Ie && !!E), t.$$.dirty[0] & 1024 && F("featuresListed", E), t.$$.dirty[1] & 32 && F("featuresMarked", N), t.$$.dirty[0] & 2 && F("reverseToggle", z), t.$$.dirty[0] & 1 && F("queryChange", R), t.$$.dirty[0] & 2097154 && i && i.indicateReverse(z), t.$$.dirty[0] & 2097154 && i && i.setMapClickHandler(z ? ot : void 0);
|
|
765
765
|
}, [
|
|
766
|
-
|
|
766
|
+
R,
|
|
767
767
|
z,
|
|
768
768
|
o,
|
|
769
769
|
h,
|
|
770
770
|
p,
|
|
771
771
|
D,
|
|
772
|
-
|
|
772
|
+
L,
|
|
773
773
|
j,
|
|
774
774
|
me,
|
|
775
775
|
X,
|
|
776
|
-
|
|
776
|
+
E,
|
|
777
777
|
I,
|
|
778
778
|
B,
|
|
779
779
|
Ie,
|
|
@@ -792,9 +792,9 @@ function Yt(t, e, n) {
|
|
|
792
792
|
b,
|
|
793
793
|
C,
|
|
794
794
|
M,
|
|
795
|
-
|
|
795
|
+
G,
|
|
796
796
|
T,
|
|
797
|
-
|
|
797
|
+
w,
|
|
798
798
|
k,
|
|
799
799
|
_,
|
|
800
800
|
S,
|
|
@@ -927,11 +927,11 @@ function $t(t, e = !0, n = !0, l = {}, r = {}) {
|
|
|
927
927
|
}
|
|
928
928
|
};
|
|
929
929
|
}
|
|
930
|
-
var
|
|
931
|
-
class
|
|
930
|
+
var U, ie;
|
|
931
|
+
class en extends se.Control {
|
|
932
932
|
constructor(n) {
|
|
933
933
|
super();
|
|
934
|
-
Be(this,
|
|
934
|
+
Be(this, U, void 0);
|
|
935
935
|
Be(this, ie, void 0);
|
|
936
936
|
Ce(this, ie, n);
|
|
937
937
|
}
|
|
@@ -945,7 +945,7 @@ class tn extends se.Control {
|
|
|
945
945
|
u,
|
|
946
946
|
u
|
|
947
947
|
);
|
|
948
|
-
Ce(this,
|
|
948
|
+
Ce(this, U, new Ft({
|
|
949
949
|
target: l,
|
|
950
950
|
props: {
|
|
951
951
|
mapController: a,
|
|
@@ -963,7 +963,7 @@ class tn extends se.Control {
|
|
|
963
963
|
"reverseToggle",
|
|
964
964
|
"queryChange"
|
|
965
965
|
])
|
|
966
|
-
Z(this,
|
|
966
|
+
Z(this, U).$on(
|
|
967
967
|
h,
|
|
968
968
|
(p) => n.fire(h.toLowerCase(), p.detail)
|
|
969
969
|
);
|
|
@@ -973,30 +973,34 @@ class tn extends se.Control {
|
|
|
973
973
|
var i;
|
|
974
974
|
Ce(this, ie, n);
|
|
975
975
|
const { marker: l, showResultMarkers: r, flyTo: c, ...o } = Z(this, ie);
|
|
976
|
-
(i = Z(this,
|
|
976
|
+
(i = Z(this, U)) == null || i.$set(o);
|
|
977
977
|
}
|
|
978
978
|
setQuery(n, l = !0) {
|
|
979
979
|
var r;
|
|
980
|
-
(r = Z(this,
|
|
980
|
+
(r = Z(this, U)) == null || r.setQuery(n, l);
|
|
981
981
|
}
|
|
982
982
|
setReverseMode(n) {
|
|
983
983
|
var l;
|
|
984
|
-
(l = Z(this,
|
|
984
|
+
(l = Z(this, U)) == null || l.$set({ reverseActive: n });
|
|
985
985
|
}
|
|
986
986
|
focus() {
|
|
987
987
|
var n;
|
|
988
|
-
(n = Z(this,
|
|
988
|
+
(n = Z(this, U)) == null || n.focus();
|
|
989
989
|
}
|
|
990
990
|
blur() {
|
|
991
991
|
var n;
|
|
992
|
-
(n = Z(this,
|
|
992
|
+
(n = Z(this, U)) == null || n.blur();
|
|
993
993
|
}
|
|
994
994
|
onRemove() {
|
|
995
995
|
var n;
|
|
996
|
-
(n = Z(this,
|
|
996
|
+
(n = Z(this, U)) == null || n.$destroy();
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
|
|
999
|
+
U = new WeakMap(), ie = new WeakMap();
|
|
1000
|
+
function tn(...t) {
|
|
1001
|
+
return new en(...t);
|
|
1002
|
+
}
|
|
1003
|
+
window.L && typeof window.L == "object" && typeof window.L.control == "function" && (window.L.control.maptilerGeocoding = tn);
|
|
1000
1004
|
export {
|
|
1001
|
-
|
|
1005
|
+
en as GeocodingControl
|
|
1002
1006
|
};
|
package/dist/leaflet.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var it=(S,L,W)=>{if(!L.has(S))throw TypeError("Cannot "+W)};var F=(S,L,W)=>(it(S,L,"read from private field"),W?W.call(S):L.get(S)),Ne=(S,L,W)=>{if(L.has(S))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(S):L.set(S,W)},Pe=(S,L,W,J)=>(it(S,L,"write to private field"),J?J.call(S,W):L.set(S,W),W);(function(S,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],L):(S=typeof globalThis<"u"?globalThis:S||self,L(S.leafletMaptilerGeocoder={},S.leaflet))})(this,function(S,L){var Z,ce;"use strict";function W(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,l.get?l:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const J=W(L);function w(){}function ct(t,e){for(const n in e)t[n]=e[n];return t}function qe(t){return t()}function Ge(){return Object.create(null)}function te(t){t.forEach(qe)}function He(t){return typeof t=="function"}function de(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ft(t){return Object.keys(t).length===0}function ut(t,e,n,l){if(t){const r=Ke(t,e,n,l);return t[0](r)}}function Ke(t,e,n,l){return t[1]&&l?ct(n.ctx.slice(),t[1](l(e))):n.ctx}function at(t,e,n,l){if(t[2]&&l){const r=t[2](l(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const c=[],o=Math.max(e.dirty.length,r.length);for(let i=0;i<o;i+=1)c[i]=e.dirty[i]|r[i];return c}return e.dirty|r}return e.dirty}function dt(t,e,n,l,r,c){if(r){const o=Ke(e,n,l,c);t.p(o,r)}}function ht(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let l=0;l<n;l++)e[l]=-1;return e}return-1}function Qe(t){return t==null?"":t}function y(t,e){t.appendChild(e)}function Q(t,e,n){t.insertBefore(e,n||null)}function q(t){t.parentNode.removeChild(t)}function _t(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function I(t){return document.createElement(t)}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function oe(t){return document.createTextNode(t)}function X(){return oe(" ")}function V(t,e,n,l){return t.addEventListener(e,n,l),()=>t.removeEventListener(e,n,l)}function gt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function f(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function mt(t){return Array.from(t.childNodes)}function pe(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ve(t,e){t.value=e==null?"":e}function D(t,e,n){t.classList[n?"add":"remove"](e)}function yt(t,e,{bubbles:n=!1,cancelable:l=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,l,e),r}let ve;function we(t){ve=t}function Ue(){if(!ve)throw new Error("Function called outside component initialization");return ve}function bt(t){Ue().$$.on_destroy.push(t)}function pt(){const t=Ue();return(e,n,{cancelable:l=!1}={})=>{const r=t.$$.callbacks[e];if(r){const c=yt(e,n,{cancelable:l});return r.slice().forEach(o=>{o.call(t,c)}),!c.defaultPrevented}return!0}}const ke=[],je=[],Ee=[],We=[],vt=Promise.resolve();let Oe=!1;function wt(){Oe||(Oe=!0,vt.then(Ze))}function Be(t){Ee.push(t)}const Ae=new Set;let Se=0;function Ze(){const t=ve;do{for(;Se<ke.length;){const e=ke[Se];Se++,we(e),kt(e.$$)}for(we(null),ke.length=0,Se=0;je.length;)je.pop()();for(let e=0;e<Ee.length;e+=1){const n=Ee[e];Ae.has(n)||(Ae.add(n),n())}Ee.length=0}while(ke.length);for(;We.length;)We.pop()();Oe=!1,Ae.clear(),we(t)}function kt(t){if(t.fragment!==null){t.update(),te(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Be)}}const Re=new Set;let ie;function Le(){ie={r:0,c:[],p:ie}}function Ie(){ie.r||te(ie.c),ie=ie.p}function P(t,e){t&&t.i&&(Re.delete(t),t.i(e))}function G(t,e,n,l){if(t&&t.o){if(Re.has(t))return;Re.add(t),ie.c.push(()=>{Re.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Me(t){t&&t.c()}function he(t,e,n,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(e,n),l||Be(()=>{const o=t.$$.on_mount.map(qe).filter(He);t.$$.on_destroy?t.$$.on_destroy.push(...o):te(o),t.$$.on_mount=[]}),c.forEach(Be)}function _e(t,e){const n=t.$$;n.fragment!==null&&(te(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Mt(t,e){t.$$.dirty[0]===-1&&(ke.push(t),wt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ge(t,e,n,l,r,c,o,i=[-1]){const u=ve;we(t);const a=t.$$={fragment:null,ctx:[],props:c,update:w,not_equal:r,bound:Ge(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Ge(),dirty:i,skip_bound:!1,root:e.target||u.$$.root};o&&o(a.root);let h=!1;if(a.ctx=n?n(t,e.props||{},(p,H,...d)=>{const m=d.length?d[0]:H;return a.ctx&&r(a.ctx[p],a.ctx[p]=m)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](m),h&&Mt(t,p)),H}):[],a.update(),h=!0,te(a.before_update),a.fragment=l?l(a.ctx):!1,e.target){if(e.hydrate){const p=mt(e.target);a.fragment&&a.fragment.l(p),p.forEach(q)}else a.fragment&&a.fragment.c();e.intro&&P(t.$$.fragment),he(t,e.target,e.anchor,e.customElement),Ze()}we(u)}class me{$destroy(){_e(this,1),this.$destroy=w}$on(e,n){if(!He(n))return w;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const r=l.indexOf(n);r!==-1&&l.splice(r,1)}}$set(e){this.$$set&&!ft(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const rn="";function Ct(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"),f(e,"viewBox","0 0 1000 1000"),f(e,"width","18px"),f(e,"height","18px"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Tt extends me{constructor(e){super(),ge(this,e,null,Ct,de,{})}}const sn="";function Et(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),f(e,"viewBox","0 0 18 18"),f(e,"width","16"),f(e,"height","16"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class St extends me{constructor(e){super(),ge(this,e,null,Et,de,{})}}const on="";function Rt(t){let e;return{c(){e=I("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',f(e,"class","svelte-7cmwmc")},m(n,l){Q(n,e,l)},p:w,i:w,o:w,d(n){n&&q(e)}}}class Lt extends me{constructor(e){super(),ge(this,e,null,Rt,de,{})}}const cn="";function It(t){let e,n,l;return{c(){e=ne("svg"),n=ne("path"),f(n,"stroke-width","4"),f(n,"fill-rule","evenodd"),f(n,"clip-rule","evenodd"),f(n,"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"),f(n,"class","svelte-656hh2"),f(e,"width",l=t[0]!=="list"?void 0:"20"),f(e,"viewBox","0 0 70 85"),f(e,"fill","none"),f(e,"class","svelte-656hh2"),D(e,"in-map",t[0]!=="list"),D(e,"for-maplibre",t[0]==="maplibre"),D(e,"for-leaflet",t[0]==="leaflet"),D(e,"list-icon",t[0]==="list")},m(r,c){Q(r,e,c),y(e,n)},p(r,[c]){c&1&&l!==(l=r[0]!=="list"?void 0:"20")&&f(e,"width",l),c&1&&D(e,"in-map",r[0]!=="list"),c&1&&D(e,"for-maplibre",r[0]==="maplibre"),c&1&&D(e,"for-leaflet",r[0]==="leaflet"),c&1&&D(e,"list-icon",r[0]==="list")},i:w,o:w,d(r){r&&q(e)}}}function Pt(t,e,n){let{displayIn:l}=e;return t.$$set=r=>{"displayIn"in r&&n(0,l=r.displayIn)},[l]}class xe extends me{constructor(e){super(),ge(this,e,Pt,It,de,{displayIn:0})}}const fn="";function jt(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),f(e,"viewBox","0 0 18 18"),f(e,"xml:space","preserve"),f(e,"width","20"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Ot extends me{constructor(e){super(),ge(this,e,null,jt,de,{})}}const un="";function Je(t,e,n){const l=t.slice();return l[59]=e[n],l[61]=n,l}function Xe(t){let e,n;return e=new Lt({}),{c(){Me(e.$$.fragment)},m(l,r){he(e,l,r),n=!0},i(l){n||(P(e.$$.fragment,l),n=!0)},o(l){G(e.$$.fragment,l),n=!1},d(l){_e(e,l)}}}function Ye(t){let e,n,l,r,c,o;return n=new Tt({}),{c(){e=I("button"),Me(n.$$.fragment),f(e,"type","button"),f(e,"title",l=t[7]===!0?"toggle reverse geocoding":t[7]),f(e,"class","svelte-16s24r9"),D(e,"active",t[1])},m(i,u){Q(i,e,u),he(n,e,null),r=!0,c||(o=V(e,"click",t[47]),c=!0)},p(i,u){(!r||u[0]&128&&l!==(l=i[7]===!0?"toggle reverse geocoding":i[7]))&&f(e,"title",l),(!r||u[0]&2)&&D(e,"active",i[1])},i(i){r||(P(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&q(e),_e(n),c=!1,o()}}}function Bt(t){let e,n,l,r,c=t[10],o=[];for(let u=0;u<c.length;u+=1)o[u]=$e(Je(t,c,u));const i=u=>G(o[u],1,1,()=>{o[u]=null});return{c(){e=I("ul");for(let u=0;u<o.length;u+=1)o[u].c();f(e,"class","svelte-16s24r9")},m(u,a){Q(u,e,a);for(let h=0;h<o.length;h+=1)o[h].m(e,null);n=!0,l||(r=[V(e,"mouseout",t[50]),V(e,"blur",t[51])],l=!0)},p(u,a){if(a[0]&7425){c=u[10];let h;for(h=0;h<c.length;h+=1){const p=Je(u,c,h);o[h]?(o[h].p(p,a),P(o[h],1)):(o[h]=$e(p),o[h].c(),P(o[h],1),o[h].m(e,null))}for(Le(),h=c.length;h<o.length;h+=1)i(h);Ie()}},i(u){if(!n){for(let a=0;a<c.length;a+=1)P(o[a]);n=!0}},o(u){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)G(o[a]);n=!1},d(u){u&&q(e),_t(o,u),l=!1,te(r)}}}function At(t){let e,n;return{c(){e=I("div"),n=oe(t[5]),f(e,"class","no-results svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&32&&pe(n,l[5])},i:w,o:w,d(l){l&&q(e)}}}function zt(t){let e,n;return{c(){e=I("div"),n=oe(t[4]),f(e,"class","error svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&16&&pe(n,l[4])},i:w,o:w,d(l){l&&q(e)}}}function Dt(t){let e="",n;return{c(){n=oe(e)},m(l,r){Q(l,n,r)},p:w,i:w,o:w,d(l){l&&q(n)}}}function Fe(t){let e,n=t[59].place_type+"",l;return{c(){e=I("span"),l=oe(n),f(e,"class","svelte-16s24r9")},m(r,c){Q(r,e,c),y(e,l)},p(r,c){c[0]&1024&&n!==(n=r[59].place_type+"")&&pe(l,n)},d(r){r&&q(e)}}}function $e(t){let e,n,l,r,c,o,i=t[59].place_name.replace(/,.*/,"")+"",u,a,h,p,H,d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"",m,g,b,M,C,x;n=new xe({props:{displayIn:"list"}});let T=t[8]&&Fe(t);function E(){return t[48](t[61])}function v(){return t[49](t[59])}return{c(){e=I("li"),Me(n.$$.fragment),l=X(),r=I("span"),c=I("span"),o=I("span"),u=oe(i),a=X(),T&&T.c(),h=X(),p=I("span"),H=I("span"),m=oe(d),g=X(),f(o,"class","svelte-16s24r9"),f(c,"class","svelte-16s24r9"),f(r,"class","svelte-16s24r9"),f(H,"class","svelte-16s24r9"),f(p,"class","svelte-16s24r9"),f(e,"tabindex","0"),f(e,"data-selected",b=t[12]===t[61]),f(e,"class","svelte-16s24r9"),D(e,"selected",t[12]===t[61])},m(N,k){Q(N,e,k),he(n,e,null),y(e,l),y(e,r),y(r,c),y(c,o),y(o,u),y(c,a),T&&T.m(c,null),y(e,h),y(e,p),y(p,H),y(H,m),y(e,g),M=!0,C||(x=[V(e,"mouseover",E),V(e,"focus",v)],C=!0)},p(N,k){t=N,(!M||k[0]&1024)&&i!==(i=t[59].place_name.replace(/,.*/,"")+"")&&pe(u,i),t[8]?T?T.p(t,k):(T=Fe(t),T.c(),T.m(c,null)):T&&(T.d(1),T=null),(!M||k[0]&1024)&&d!==(d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"")&&pe(m,d),(!M||k[0]&4096&&b!==(b=t[12]===t[61]))&&f(e,"data-selected",b),(!M||k[0]&4096)&&D(e,"selected",t[12]===t[61])},i(N){M||(P(n.$$.fragment,N),M=!0)},o(N){G(n.$$.fragment,N),M=!1},d(N){N&&q(e),_e(n),T&&T.d(),C=!1,te(x)}}}function Nt(t){let e,n,l,r,c,o,i,u,a,h,p,H,d,m,g,b,M,C,x,T;r=new Ot({}),h=new St({});let E=t[16]&&Xe(),v=t[7]&&Ye(t);const N=t[39].default,k=ut(N,t,t[38],null),j=[Dt,zt,At,Bt],z=[];function Ce(_,O){var $,ee;return _[13]?_[15]?1:(($=_[10])==null?void 0:$.length)===0?2:_[13]&&((ee=_[10])==null?void 0:ee.length)?3:-1:0}return~(g=Ce(t))&&(b=z[g]=j[g](t)),{c(){e=I("form"),n=I("div"),l=I("button"),Me(r.$$.fragment),c=X(),o=I("input"),i=X(),u=I("div"),a=I("button"),Me(h.$$.fragment),p=X(),E&&E.c(),H=X(),v&&v.c(),d=X(),k&&k.c(),m=X(),b&&b.c(),f(l,"type","button"),f(l,"class","svelte-16s24r9"),f(o,"placeholder",t[3]),f(o,"aria-label",t[3]),f(o,"class","svelte-16s24r9"),f(a,"type","button"),f(a,"class","svelte-16s24r9"),D(a,"displayable",t[0]!==""),f(u,"class","clear-button-container svelte-16s24r9"),f(n,"class","input-group svelte-16s24r9"),f(e,"tabindex","0"),f(e,"class",M=Qe(t[2])+" svelte-16s24r9"),D(e,"can-collapse",t[6]&&t[0]==="")},m(_,O){Q(_,e,O),y(e,n),y(n,l),he(r,l,null),y(n,c),y(n,o),t[41](o),Ve(o,t[0]),y(n,i),y(n,u),y(u,a),he(h,a,null),y(u,p),E&&E.m(u,null),y(n,H),v&&v.m(n,null),y(n,d),k&&k.m(n,null),y(e,m),~g&&z[g].m(e,null),C=!0,x||(T=[V(l,"click",t[40]),V(o,"input",t[42]),V(o,"focus",t[43]),V(o,"blur",t[44]),V(o,"keydown",t[18]),V(o,"input",t[45]),V(a,"click",t[46]),V(e,"submit",gt(t[17]))],x=!0)},p(_,O){(!C||O[0]&8)&&f(o,"placeholder",_[3]),(!C||O[0]&8)&&f(o,"aria-label",_[3]),O[0]&1&&o.value!==_[0]&&Ve(o,_[0]),(!C||O[0]&1)&&D(a,"displayable",_[0]!==""),_[16]?E?O[0]&65536&&P(E,1):(E=Xe(),E.c(),P(E,1),E.m(u,null)):E&&(Le(),G(E,1,1,()=>{E=null}),Ie()),_[7]?v?(v.p(_,O),O[0]&128&&P(v,1)):(v=Ye(_),v.c(),P(v,1),v.m(n,d)):v&&(Le(),G(v,1,1,()=>{v=null}),Ie()),k&&k.p&&(!C||O[1]&128)&&dt(k,N,_,_[38],C?at(N,_[38],O,null):ht(_[38]),null);let $=g;g=Ce(_),g===$?~g&&z[g].p(_,O):(b&&(Le(),G(z[$],1,1,()=>{z[$]=null}),Ie()),~g?(b=z[g],b?b.p(_,O):(b=z[g]=j[g](_),b.c()),P(b,1),b.m(e,null)):b=null),(!C||O[0]&4&&M!==(M=Qe(_[2])+" svelte-16s24r9"))&&f(e,"class",M),(!C||O[0]&69)&&D(e,"can-collapse",_[6]&&_[0]==="")},i(_){C||(P(r.$$.fragment,_),P(h.$$.fragment,_),P(E),P(v),P(k,_),P(b),C=!0)},o(_){G(r.$$.fragment,_),G(h.$$.fragment,_),G(E),G(v),G(k,_),G(b),C=!1},d(_){_&&q(e),_e(r),t[41](null),_e(h),E&&E.d(),v&&v.d(),k&&k.d(_),~g&&z[g].d(),x=!1,te(T)}}}function qt(t,e,n){let l,{$$slots:r={},$$scope:c}=e,{class:o=void 0}=e,{mapController:i=void 0}=e,{apiKey:u}=e,{debounceSearch:a=200}=e,{placeholder:h="Search"}=e,{errorMessage:p="Searching failed"}=e,{noResultsMessage:H="No results found"}=e,{proximity:d=void 0}=e,{bbox:m=void 0}=e,{trackProximity:g=!0}=e,{minLength:b=2}=e,{language:M=void 0}=e,{showResultsWhileTyping:C=!0}=e,{zoom:x=16}=e,{flyTo:T=!0}=e,{collapsed:E=!1}=e,{clearOnBlur:v=!1}=e,{enableReverse:N=!1}=e,{filter:k=()=>!0}=e,{searchValue:j=""}=e,{reverseActive:z=!1}=e,{showPlaceType:Ce=!1}=e;function _(){le.focus()}function O(){le.blur()}function $(s,U=!0){n(0,j=s),U&&(n(12,A=-1),nt())}let ee=!1,R,K,B,et="",le,A=-1,fe,tt=[],ue,ze,De;const re=pt();bt(()=>{i&&(i.setProximityChangeHandler(void 0),i.setMapClickHandler(void 0),i.indicateReverse(!1),i.setSelectedMarker(-1),i.setMarkers(void 0,void 0))});function nt(){A>-1&&R?(n(11,B=R[A]),n(0,j=B.place_name.replace(/,.*/,"")),n(15,fe=void 0),n(36,K=void 0),n(12,A=-1)):j&<(j).then(()=>{n(36,K=R),n(11,B=void 0),Qt()}).catch(s=>n(15,fe=s))}async function lt(s){n(15,fe=void 0);const U=/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s),Y=new URLSearchParams;Y.set("key",u),M&&Y.set("language",String(M)),U||(m&&Y.set("bbox",m.join(",")),d&&Y.set("proximity",d.join(",")));const ae="https://api.maptiler.com/geocoding/"+encodeURIComponent(s)+".json?"+Y.toString();if(ae===et){n(10,R=tt);return}et=ae,ue==null||ue.abort(),n(16,ue=new AbortController);let ye;try{ye=await fetch(ae,{signal:ue.signal}).finally(()=>{n(16,ue=void 0)})}catch(be){if(be&&typeof be=="object"&&be.name==="AbortError")return;throw new Error}if(!ye.ok)throw new Error;const Te=await ye.json();re("response",{url:ae,featureCollection:Te}),n(10,R=Te.features.filter(k)),tt=R,U&&le.focus()}function Qt(){var U,Y,ae,ye,Te,be,st,ot;if(!(K!=null&&K.length)||!T)return;const s=[180,90,-180,-90];for(const se of K)s[0]=Math.min(s[0],(Y=(U=se.bbox)==null?void 0:U[0])!=null?Y:se.center[0]),s[1]=Math.min(s[1],(ye=(ae=se.bbox)==null?void 0:ae[1])!=null?ye:se.center[1]),s[2]=Math.max(s[2],(be=(Te=se.bbox)==null?void 0:Te[2])!=null?be:se.center[0]),s[3]=Math.max(s[3],(ot=(st=se.bbox)==null?void 0:st[3])!=null?ot:se.center[1]);i&&K.length>0&&(B&&s[0]===s[2]&&s[1]===s[3]?i.flyTo(B.center,x):i.fitBounds(s,50))}function Vt(s){n(1,z=!1),$(s[0].toFixed(6)+","+s[1].toFixed(6))}function Ut(s){if(!R)return;let U=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:0;U?(A===-1&&U===-1&&n(12,A=R.length),n(12,A+=U),A>=R.length&&n(12,A=-1),s.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(s.key)&&n(12,A=-1)}function rt(s=!0){if(C&&j.length>b){ze&&clearTimeout(ze);const U=j;ze=window.setTimeout(()=>{lt(U).catch(Y=>n(15,fe=Y))},s?a:0)}else n(10,R=void 0),n(15,fe=void 0)}const Wt=()=>le.focus();function Zt(s){je[s?"unshift":"push"](()=>{le=s,n(14,le)})}function xt(){j=this.value,n(0,j),n(9,ee),n(31,v)}const Jt=()=>n(9,ee=!0),Xt=()=>n(9,ee=!1),Yt=()=>rt(),Ft=()=>{n(0,j=""),le.focus()},$t=()=>n(1,z=!z),en=s=>n(12,A=s),tn=s=>{n(11,B=s),n(0,j=s.place_name.replace(/,.*/,"")),n(12,A=-1)},nn=()=>n(12,A=-1),ln=()=>{};return t.$$set=s=>{"class"in s&&n(2,o=s.class),"mapController"in s&&n(21,i=s.mapController),"apiKey"in s&&n(22,u=s.apiKey),"debounceSearch"in s&&n(23,a=s.debounceSearch),"placeholder"in s&&n(3,h=s.placeholder),"errorMessage"in s&&n(4,p=s.errorMessage),"noResultsMessage"in s&&n(5,H=s.noResultsMessage),"proximity"in s&&n(20,d=s.proximity),"bbox"in s&&n(24,m=s.bbox),"trackProximity"in s&&n(25,g=s.trackProximity),"minLength"in s&&n(26,b=s.minLength),"language"in s&&n(27,M=s.language),"showResultsWhileTyping"in s&&n(28,C=s.showResultsWhileTyping),"zoom"in s&&n(29,x=s.zoom),"flyTo"in s&&n(30,T=s.flyTo),"collapsed"in s&&n(6,E=s.collapsed),"clearOnBlur"in s&&n(31,v=s.clearOnBlur),"enableReverse"in s&&n(7,N=s.enableReverse),"filter"in s&&n(32,k=s.filter),"searchValue"in s&&n(0,j=s.searchValue),"reverseActive"in s&&n(1,z=s.reverseActive),"showPlaceType"in s&&n(8,Ce=s.showPlaceType),"$$scope"in s&&n(38,c=s.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&35651584&&i&&i.setProximityChangeHandler(g?s=>{n(20,d=s)}:void 0),t.$$.dirty[0]&33554432&&(g||n(20,d=void 0)),t.$$.dirty[0]&512|t.$$.dirty[1]&1&&setTimeout(()=>{n(13,De=ee),v&&!ee&&n(0,j="")}),t.$$.dirty[0]&1025&&(j||(n(11,B=void 0),n(10,R=void 0),n(15,fe=void 0),n(36,K=R))),t.$$.dirty[0]&1612711936&&i&&B&&T&&(!B.bbox||B.bbox[0]===B.bbox[2]&&B.bbox[1]===B.bbox[3]?i.flyTo(B.center,x):i.fitBounds(B.bbox,0),n(10,R=void 0),n(36,K=void 0),n(12,A=-1)),t.$$.dirty[0]&1024|t.$$.dirty[1]&32&&K!==R&&n(36,K=void 0),t.$$.dirty[0]&2099200|t.$$.dirty[1]&32&&i&&i.setMarkers(K,B),t.$$.dirty[0]&1&&n(12,A=-1),t.$$.dirty[0]&2101248&&(i==null||i.setSelectedMarker(A)),t.$$.dirty[0]&5120&&n(37,l=R==null?void 0:R[A]),t.$$.dirty[1]&64&&re("select",l),t.$$.dirty[0]&2048&&re("pick",B),t.$$.dirty[0]&9216&&re("optionsVisibilityChange",De&&!!R),t.$$.dirty[0]&1024&&re("featuresListed",R),t.$$.dirty[1]&32&&re("featuresMarked",K),t.$$.dirty[0]&2&&re("reverseToggle",z),t.$$.dirty[0]&1&&re("queryChange",j),t.$$.dirty[0]&2097154&&i&&i.indicateReverse(z),t.$$.dirty[0]&2097154&&i&&i.setMapClickHandler(z?Vt:void 0)},[j,z,o,h,p,H,E,N,Ce,ee,R,B,A,De,le,fe,ue,nt,Ut,rt,d,i,u,a,m,g,b,M,C,x,T,v,k,_,O,$,K,l,c,r,Wt,Zt,xt,Jt,Xt,Yt,Ft,$t,en,tn,nn,ln]}class Gt extends me{constructor(e){super(),ge(this,e,qt,Nt,de,{class:2,mapController:21,apiKey:22,debounceSearch:23,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:20,bbox:24,trackProximity:25,minLength:26,language:27,showResultsWhileTyping:28,zoom:29,flyTo:30,collapsed:6,clearOnBlur:31,enableReverse:7,filter:32,searchValue:0,reverseActive:1,showPlaceType:8,focus:33,blur:34,setQuery:35},null,[-1,-1])}get focus(){return this.$$.ctx[33]}get blur(){return this.$$.ctx[34]}get setQuery(){return this.$$.ctx[35]}}function Ht(t,e=!0,n=!0,l={},r={}){let c,o,i,u=[],a;const h=()=>{if(!c){i=void 0;return}let d;const m=t.getZoom()>10?[(d=t.getCenter().wrap()).lng,d.lat]:void 0;i!==m&&(i=m,c(m))},p=d=>{o==null||o([d.latlng.lng,d.latlng.lat])};return{setProximityChangeHandler(d){d?(c=d,t.on("moveend",h),h()):(t.off("moveend",h),c==null||c(void 0),c=void 0)},setMapClickHandler(d){o=d,o?t.on("click",p):t.off("click",p)},flyTo(d,m){t.flyTo(d,m,l)},fitBounds(d,m){t.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{...r,padding:[m,m]})},indicateReverse(d){t.getContainer().style.cursor=d?"crosshair":""},setMarkers(d,m){for(const g of u)g.remove();u.length=0;for(const g of m?[...d!=null?d:[],m]:d!=null?d:[]){let b;const M=[g.center[1],g.center[0]];if(g===m&&typeof e=="object")b=new J.Marker(M,e);else if(g!==m&&typeof n=="object")b=new J.Marker(M,n);else{const C=document.createElement("div");new xe({props:{displayIn:"leaflet"},target:C}),b=new J.Marker(M,{icon:new J.DivIcon({html:C,className:""})})}u.push(b.addTo(t))}},setSelectedMarker(d){var m,g;a&&((m=a.getElement())==null||m.classList.toggle("marker-selected",!1)),a=d>-1?u[d]:void 0,(g=a==null?void 0:a.getElement())==null||g.classList.toggle("marker-selected",!0)}}}class Kt extends J.Control{constructor(n){super();Ne(this,Z,void 0);Ne(this,ce,void 0);Pe(this,ce,n)}onAdd(n){const l=document.createElement("div");l.className="leaflet-ctrl-geocoder",J.DomEvent.disableClickPropagation(l),J.DomEvent.disableScrollPropagation(l);const{marker:r,showResultMarkers:c,flyTo:o,...i}=F(this,ce),u=typeof o=="boolean"?{}:o,a=Ht(n,r,c,u,u);Pe(this,Z,new Gt({target:l,props:{mapController:a,flyTo:o===void 0?!0:!!o,...i}}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])F(this,Z).$on(h,p=>n.fire(h.toLowerCase(),p.detail));return l}setOptions(n){var i;Pe(this,ce,n);const{marker:l,showResultMarkers:r,flyTo:c,...o}=F(this,ce);(i=F(this,Z))==null||i.$set(o)}setQuery(n,l=!0){var r;(r=F(this,Z))==null||r.setQuery(n,l)}setReverseMode(n){var l;(l=F(this,Z))==null||l.$set({reverseActive:n})}focus(){var n;(n=F(this,Z))==null||n.focus()}blur(){var n;(n=F(this,Z))==null||n.blur()}onRemove(){var n;(n=F(this,Z))==null||n.$destroy()}}Z=new WeakMap,ce=new WeakMap,S.GeocodingControl=Kt,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
var ct=(E,R,W)=>{if(!R.has(E))throw TypeError("Cannot "+W)};var F=(E,R,W)=>(ct(E,R,"read from private field"),W?W.call(E):R.get(E)),Ne=(E,R,W)=>{if(R.has(E))throw TypeError("Cannot add the same private member more than once");R instanceof WeakSet?R.add(E):R.set(E,W)},Pe=(E,R,W,J)=>(ct(E,R,"write to private field"),J?J.call(E,W):R.set(E,W),W);(function(E,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],R):(E=typeof globalThis<"u"?globalThis:E||self,R(E.leafletMaptilerGeocoder={},E.leaflet))})(this,function(E,R){var Z,ce;"use strict";function W(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,l.get?l:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const J=W(R);function w(){}function ft(t,e){for(const n in e)t[n]=e[n];return t}function qe(t){return t()}function Ge(){return Object.create(null)}function te(t){t.forEach(qe)}function He(t){return typeof t=="function"}function de(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ut(t){return Object.keys(t).length===0}function at(t,e,n,l){if(t){const r=Ke(t,e,n,l);return t[0](r)}}function Ke(t,e,n,l){return t[1]&&l?ft(n.ctx.slice(),t[1](l(e))):n.ctx}function dt(t,e,n,l){if(t[2]&&l){const r=t[2](l(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const c=[],s=Math.max(e.dirty.length,r.length);for(let i=0;i<s;i+=1)c[i]=e.dirty[i]|r[i];return c}return e.dirty|r}return e.dirty}function ht(t,e,n,l,r,c){if(r){const s=Ke(e,n,l,c);t.p(s,r)}}function _t(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let l=0;l<n;l++)e[l]=-1;return e}return-1}function Qe(t){return t==null?"":t}function y(t,e){t.appendChild(e)}function Q(t,e,n){t.insertBefore(e,n||null)}function q(t){t.parentNode.removeChild(t)}function gt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function I(t){return document.createElement(t)}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function se(t){return document.createTextNode(t)}function X(){return se(" ")}function V(t,e,n,l){return t.addEventListener(e,n,l),()=>t.removeEventListener(e,n,l)}function mt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function f(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function yt(t){return Array.from(t.childNodes)}function pe(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ve(t,e){t.value=e==null?"":e}function D(t,e,n){t.classList[n?"add":"remove"](e)}function bt(t,e,{bubbles:n=!1,cancelable:l=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,l,e),r}let ve;function we(t){ve=t}function Ue(){if(!ve)throw new Error("Function called outside component initialization");return ve}function pt(t){Ue().$$.on_destroy.push(t)}function vt(){const t=Ue();return(e,n,{cancelable:l=!1}={})=>{const r=t.$$.callbacks[e];if(r){const c=bt(e,n,{cancelable:l});return r.slice().forEach(s=>{s.call(t,c)}),!c.defaultPrevented}return!0}}const ke=[],je=[],Le=[],We=[],wt=Promise.resolve();let Oe=!1;function kt(){Oe||(Oe=!0,wt.then(Ze))}function Be(t){Le.push(t)}const Ae=new Set;let Ee=0;function Ze(){const t=ve;do{for(;Ee<ke.length;){const e=ke[Ee];Ee++,we(e),Mt(e.$$)}for(we(null),ke.length=0,Ee=0;je.length;)je.pop()();for(let e=0;e<Le.length;e+=1){const n=Le[e];Ae.has(n)||(Ae.add(n),n())}Le.length=0}while(ke.length);for(;We.length;)We.pop()();Oe=!1,Ae.clear(),we(t)}function Mt(t){if(t.fragment!==null){t.update(),te(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Be)}}const Se=new Set;let ie;function Re(){ie={r:0,c:[],p:ie}}function Ie(){ie.r||te(ie.c),ie=ie.p}function P(t,e){t&&t.i&&(Se.delete(t),t.i(e))}function G(t,e,n,l){if(t&&t.o){if(Se.has(t))return;Se.add(t),ie.c.push(()=>{Se.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Me(t){t&&t.c()}function he(t,e,n,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(e,n),l||Be(()=>{const s=t.$$.on_mount.map(qe).filter(He);t.$$.on_destroy?t.$$.on_destroy.push(...s):te(s),t.$$.on_mount=[]}),c.forEach(Be)}function _e(t,e){const n=t.$$;n.fragment!==null&&(te(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ct(t,e){t.$$.dirty[0]===-1&&(ke.push(t),kt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ge(t,e,n,l,r,c,s,i=[-1]){const u=ve;we(t);const a=t.$$={fragment:null,ctx:[],props:c,update:w,not_equal:r,bound:Ge(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Ge(),dirty:i,skip_bound:!1,root:e.target||u.$$.root};s&&s(a.root);let h=!1;if(a.ctx=n?n(t,e.props||{},(p,H,...d)=>{const m=d.length?d[0]:H;return a.ctx&&r(a.ctx[p],a.ctx[p]=m)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](m),h&&Ct(t,p)),H}):[],a.update(),h=!0,te(a.before_update),a.fragment=l?l(a.ctx):!1,e.target){if(e.hydrate){const p=yt(e.target);a.fragment&&a.fragment.l(p),p.forEach(q)}else a.fragment&&a.fragment.c();e.intro&&P(t.$$.fragment),he(t,e.target,e.anchor,e.customElement),Ze()}we(u)}class me{$destroy(){_e(this,1),this.$destroy=w}$on(e,n){if(!He(n))return w;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const r=l.indexOf(n);r!==-1&&l.splice(r,1)}}$set(e){this.$$set&&!ut(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const on="";function Tt(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"),f(e,"viewBox","0 0 1000 1000"),f(e,"width","18px"),f(e,"height","18px"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Lt extends me{constructor(e){super(),ge(this,e,null,Tt,de,{})}}const sn="";function Et(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),f(e,"viewBox","0 0 18 18"),f(e,"width","16"),f(e,"height","16"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class St extends me{constructor(e){super(),ge(this,e,null,Et,de,{})}}const cn="";function Rt(t){let e;return{c(){e=I("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',f(e,"class","svelte-7cmwmc")},m(n,l){Q(n,e,l)},p:w,i:w,o:w,d(n){n&&q(e)}}}class It extends me{constructor(e){super(),ge(this,e,null,Rt,de,{})}}const fn="";function Pt(t){let e,n,l;return{c(){e=ne("svg"),n=ne("path"),f(n,"stroke-width","4"),f(n,"fill-rule","evenodd"),f(n,"clip-rule","evenodd"),f(n,"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"),f(n,"class","svelte-656hh2"),f(e,"width",l=t[0]!=="list"?void 0:"20"),f(e,"viewBox","0 0 70 85"),f(e,"fill","none"),f(e,"class","svelte-656hh2"),D(e,"in-map",t[0]!=="list"),D(e,"for-maplibre",t[0]==="maplibre"),D(e,"for-leaflet",t[0]==="leaflet"),D(e,"list-icon",t[0]==="list")},m(r,c){Q(r,e,c),y(e,n)},p(r,[c]){c&1&&l!==(l=r[0]!=="list"?void 0:"20")&&f(e,"width",l),c&1&&D(e,"in-map",r[0]!=="list"),c&1&&D(e,"for-maplibre",r[0]==="maplibre"),c&1&&D(e,"for-leaflet",r[0]==="leaflet"),c&1&&D(e,"list-icon",r[0]==="list")},i:w,o:w,d(r){r&&q(e)}}}function jt(t,e,n){let{displayIn:l}=e;return t.$$set=r=>{"displayIn"in r&&n(0,l=r.displayIn)},[l]}class xe extends me{constructor(e){super(),ge(this,e,jt,Pt,de,{displayIn:0})}}const un="";function Ot(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),f(e,"viewBox","0 0 18 18"),f(e,"xml:space","preserve"),f(e,"width","20"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Bt extends me{constructor(e){super(),ge(this,e,null,Ot,de,{})}}const an="";function Je(t,e,n){const l=t.slice();return l[59]=e[n],l[61]=n,l}function Xe(t){let e,n;return e=new It({}),{c(){Me(e.$$.fragment)},m(l,r){he(e,l,r),n=!0},i(l){n||(P(e.$$.fragment,l),n=!0)},o(l){G(e.$$.fragment,l),n=!1},d(l){_e(e,l)}}}function Ye(t){let e,n,l,r,c,s;return n=new Lt({}),{c(){e=I("button"),Me(n.$$.fragment),f(e,"type","button"),f(e,"title",l=t[7]===!0?"toggle reverse geocoding":t[7]),f(e,"class","svelte-16s24r9"),D(e,"active",t[1])},m(i,u){Q(i,e,u),he(n,e,null),r=!0,c||(s=V(e,"click",t[47]),c=!0)},p(i,u){(!r||u[0]&128&&l!==(l=i[7]===!0?"toggle reverse geocoding":i[7]))&&f(e,"title",l),(!r||u[0]&2)&&D(e,"active",i[1])},i(i){r||(P(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&q(e),_e(n),c=!1,s()}}}function At(t){let e,n,l,r,c=t[10],s=[];for(let u=0;u<c.length;u+=1)s[u]=$e(Je(t,c,u));const i=u=>G(s[u],1,1,()=>{s[u]=null});return{c(){e=I("ul");for(let u=0;u<s.length;u+=1)s[u].c();f(e,"class","svelte-16s24r9")},m(u,a){Q(u,e,a);for(let h=0;h<s.length;h+=1)s[h].m(e,null);n=!0,l||(r=[V(e,"mouseout",t[50]),V(e,"blur",t[51])],l=!0)},p(u,a){if(a[0]&7425){c=u[10];let h;for(h=0;h<c.length;h+=1){const p=Je(u,c,h);s[h]?(s[h].p(p,a),P(s[h],1)):(s[h]=$e(p),s[h].c(),P(s[h],1),s[h].m(e,null))}for(Re(),h=c.length;h<s.length;h+=1)i(h);Ie()}},i(u){if(!n){for(let a=0;a<c.length;a+=1)P(s[a]);n=!0}},o(u){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)G(s[a]);n=!1},d(u){u&&q(e),gt(s,u),l=!1,te(r)}}}function zt(t){let e,n;return{c(){e=I("div"),n=se(t[5]),f(e,"class","no-results svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&32&&pe(n,l[5])},i:w,o:w,d(l){l&&q(e)}}}function Dt(t){let e,n;return{c(){e=I("div"),n=se(t[4]),f(e,"class","error svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&16&&pe(n,l[4])},i:w,o:w,d(l){l&&q(e)}}}function Nt(t){let e="",n;return{c(){n=se(e)},m(l,r){Q(l,n,r)},p:w,i:w,o:w,d(l){l&&q(n)}}}function Fe(t){let e,n=t[59].place_type+"",l;return{c(){e=I("span"),l=se(n),f(e,"class","svelte-16s24r9")},m(r,c){Q(r,e,c),y(e,l)},p(r,c){c[0]&1024&&n!==(n=r[59].place_type+"")&&pe(l,n)},d(r){r&&q(e)}}}function $e(t){let e,n,l,r,c,s,i=t[59].place_name.replace(/,.*/,"")+"",u,a,h,p,H,d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"",m,g,b,M,C,x;n=new xe({props:{displayIn:"list"}});let T=t[8]&&Fe(t);function L(){return t[48](t[61])}function v(){return t[49](t[59])}return{c(){e=I("li"),Me(n.$$.fragment),l=X(),r=I("span"),c=I("span"),s=I("span"),u=se(i),a=X(),T&&T.c(),h=X(),p=I("span"),H=I("span"),m=se(d),g=X(),f(s,"class","svelte-16s24r9"),f(c,"class","svelte-16s24r9"),f(r,"class","svelte-16s24r9"),f(H,"class","svelte-16s24r9"),f(p,"class","svelte-16s24r9"),f(e,"tabindex","0"),f(e,"data-selected",b=t[12]===t[61]),f(e,"class","svelte-16s24r9"),D(e,"selected",t[12]===t[61])},m(N,k){Q(N,e,k),he(n,e,null),y(e,l),y(e,r),y(r,c),y(c,s),y(s,u),y(c,a),T&&T.m(c,null),y(e,h),y(e,p),y(p,H),y(H,m),y(e,g),M=!0,C||(x=[V(e,"mouseover",L),V(e,"focus",v)],C=!0)},p(N,k){t=N,(!M||k[0]&1024)&&i!==(i=t[59].place_name.replace(/,.*/,"")+"")&&pe(u,i),t[8]?T?T.p(t,k):(T=Fe(t),T.c(),T.m(c,null)):T&&(T.d(1),T=null),(!M||k[0]&1024)&&d!==(d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"")&&pe(m,d),(!M||k[0]&4096&&b!==(b=t[12]===t[61]))&&f(e,"data-selected",b),(!M||k[0]&4096)&&D(e,"selected",t[12]===t[61])},i(N){M||(P(n.$$.fragment,N),M=!0)},o(N){G(n.$$.fragment,N),M=!1},d(N){N&&q(e),_e(n),T&&T.d(),C=!1,te(x)}}}function qt(t){let e,n,l,r,c,s,i,u,a,h,p,H,d,m,g,b,M,C,x,T;r=new Bt({}),h=new St({});let L=t[16]&&Xe(),v=t[7]&&Ye(t);const N=t[39].default,k=at(N,t,t[38],null),j=[Nt,Dt,zt,At],z=[];function Ce(_,O){var $,ee;return _[13]?_[15]?1:(($=_[10])==null?void 0:$.length)===0?2:_[13]&&((ee=_[10])==null?void 0:ee.length)?3:-1:0}return~(g=Ce(t))&&(b=z[g]=j[g](t)),{c(){e=I("form"),n=I("div"),l=I("button"),Me(r.$$.fragment),c=X(),s=I("input"),i=X(),u=I("div"),a=I("button"),Me(h.$$.fragment),p=X(),L&&L.c(),H=X(),v&&v.c(),d=X(),k&&k.c(),m=X(),b&&b.c(),f(l,"type","button"),f(l,"class","svelte-16s24r9"),f(s,"placeholder",t[3]),f(s,"aria-label",t[3]),f(s,"class","svelte-16s24r9"),f(a,"type","button"),f(a,"class","svelte-16s24r9"),D(a,"displayable",t[0]!==""),f(u,"class","clear-button-container svelte-16s24r9"),f(n,"class","input-group svelte-16s24r9"),f(e,"tabindex","0"),f(e,"class",M=Qe(t[2])+" svelte-16s24r9"),D(e,"can-collapse",t[6]&&t[0]==="")},m(_,O){Q(_,e,O),y(e,n),y(n,l),he(r,l,null),y(n,c),y(n,s),t[41](s),Ve(s,t[0]),y(n,i),y(n,u),y(u,a),he(h,a,null),y(u,p),L&&L.m(u,null),y(n,H),v&&v.m(n,null),y(n,d),k&&k.m(n,null),y(e,m),~g&&z[g].m(e,null),C=!0,x||(T=[V(l,"click",t[40]),V(s,"input",t[42]),V(s,"focus",t[43]),V(s,"blur",t[44]),V(s,"keydown",t[18]),V(s,"input",t[45]),V(a,"click",t[46]),V(e,"submit",mt(t[17]))],x=!0)},p(_,O){(!C||O[0]&8)&&f(s,"placeholder",_[3]),(!C||O[0]&8)&&f(s,"aria-label",_[3]),O[0]&1&&s.value!==_[0]&&Ve(s,_[0]),(!C||O[0]&1)&&D(a,"displayable",_[0]!==""),_[16]?L?O[0]&65536&&P(L,1):(L=Xe(),L.c(),P(L,1),L.m(u,null)):L&&(Re(),G(L,1,1,()=>{L=null}),Ie()),_[7]?v?(v.p(_,O),O[0]&128&&P(v,1)):(v=Ye(_),v.c(),P(v,1),v.m(n,d)):v&&(Re(),G(v,1,1,()=>{v=null}),Ie()),k&&k.p&&(!C||O[1]&128)&&ht(k,N,_,_[38],C?dt(N,_[38],O,null):_t(_[38]),null);let $=g;g=Ce(_),g===$?~g&&z[g].p(_,O):(b&&(Re(),G(z[$],1,1,()=>{z[$]=null}),Ie()),~g?(b=z[g],b?b.p(_,O):(b=z[g]=j[g](_),b.c()),P(b,1),b.m(e,null)):b=null),(!C||O[0]&4&&M!==(M=Qe(_[2])+" svelte-16s24r9"))&&f(e,"class",M),(!C||O[0]&69)&&D(e,"can-collapse",_[6]&&_[0]==="")},i(_){C||(P(r.$$.fragment,_),P(h.$$.fragment,_),P(L),P(v),P(k,_),P(b),C=!0)},o(_){G(r.$$.fragment,_),G(h.$$.fragment,_),G(L),G(v),G(k,_),G(b),C=!1},d(_){_&&q(e),_e(r),t[41](null),_e(h),L&&L.d(),v&&v.d(),k&&k.d(_),~g&&z[g].d(),x=!1,te(T)}}}function Gt(t,e,n){let l,{$$slots:r={},$$scope:c}=e,{class:s=void 0}=e,{mapController:i=void 0}=e,{apiKey:u}=e,{debounceSearch:a=200}=e,{placeholder:h="Search"}=e,{errorMessage:p="Searching failed"}=e,{noResultsMessage:H="No results found"}=e,{proximity:d=void 0}=e,{bbox:m=void 0}=e,{trackProximity:g=!0}=e,{minLength:b=2}=e,{language:M=void 0}=e,{showResultsWhileTyping:C=!0}=e,{zoom:x=16}=e,{flyTo:T=!0}=e,{collapsed:L=!1}=e,{clearOnBlur:v=!1}=e,{enableReverse:N=!1}=e,{filter:k=()=>!0}=e,{searchValue:j=""}=e,{reverseActive:z=!1}=e,{showPlaceType:Ce=!1}=e;function _(){le.focus()}function O(){le.blur()}function $(o,U=!0){n(0,j=o),U&&(n(12,A=-1),lt())}let ee=!1,S,K,B,tt="",le,A=-1,fe,nt=[],ue,ze,De;const re=vt();pt(()=>{i&&(i.setProximityChangeHandler(void 0),i.setMapClickHandler(void 0),i.indicateReverse(!1),i.setSelectedMarker(-1),i.setMarkers(void 0,void 0))});function lt(){A>-1&&S?(n(11,B=S[A]),n(0,j=B.place_name.replace(/,.*/,"")),n(15,fe=void 0),n(36,K=void 0),n(12,A=-1)):j&&rt(j).then(()=>{n(36,K=S),n(11,B=void 0),Vt()}).catch(o=>n(15,fe=o))}async function rt(o){n(15,fe=void 0);const U=/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(o),Y=new URLSearchParams;Y.set("key",u),M&&Y.set("language",String(M)),U||(m&&Y.set("bbox",m.join(",")),d&&Y.set("proximity",d.join(",")));const ae="https://api.maptiler.com/geocoding/"+encodeURIComponent(o)+".json?"+Y.toString();if(ae===tt){n(10,S=nt);return}tt=ae,ue==null||ue.abort(),n(16,ue=new AbortController);let ye;try{ye=await fetch(ae,{signal:ue.signal}).finally(()=>{n(16,ue=void 0)})}catch(be){if(be&&typeof be=="object"&&be.name==="AbortError")return;throw new Error}if(!ye.ok)throw new Error;const Te=await ye.json();re("response",{url:ae,featureCollection:Te}),n(10,S=Te.features.filter(k)),nt=S,U&&le.focus()}function Vt(){var U,Y,ae,ye,Te,be,st,it;if(!(K!=null&&K.length)||!T)return;const o=[180,90,-180,-90];for(const oe of K)o[0]=Math.min(o[0],(Y=(U=oe.bbox)==null?void 0:U[0])!=null?Y:oe.center[0]),o[1]=Math.min(o[1],(ye=(ae=oe.bbox)==null?void 0:ae[1])!=null?ye:oe.center[1]),o[2]=Math.max(o[2],(be=(Te=oe.bbox)==null?void 0:Te[2])!=null?be:oe.center[0]),o[3]=Math.max(o[3],(it=(st=oe.bbox)==null?void 0:st[3])!=null?it:oe.center[1]);i&&K.length>0&&(B&&o[0]===o[2]&&o[1]===o[3]?i.flyTo(B.center,x):i.fitBounds(o,50))}function Ut(o){n(1,z=!1),$(o[0].toFixed(6)+","+o[1].toFixed(6))}function Wt(o){if(!S)return;let U=o.key==="ArrowDown"?1:o.key==="ArrowUp"?-1:0;U?(A===-1&&U===-1&&n(12,A=S.length),n(12,A+=U),A>=S.length&&n(12,A=-1),o.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(o.key)&&n(12,A=-1)}function ot(o=!0){if(C&&j.length>b){ze&&clearTimeout(ze);const U=j;ze=window.setTimeout(()=>{rt(U).catch(Y=>n(15,fe=Y))},o?a:0)}else n(10,S=void 0),n(15,fe=void 0)}const Zt=()=>le.focus();function xt(o){je[o?"unshift":"push"](()=>{le=o,n(14,le)})}function Jt(){j=this.value,n(0,j),n(9,ee),n(31,v)}const Xt=()=>n(9,ee=!0),Yt=()=>n(9,ee=!1),Ft=()=>ot(),$t=()=>{n(0,j=""),le.focus()},en=()=>n(1,z=!z),tn=o=>n(12,A=o),nn=o=>{n(11,B=o),n(0,j=o.place_name.replace(/,.*/,"")),n(12,A=-1)},ln=()=>n(12,A=-1),rn=()=>{};return t.$$set=o=>{"class"in o&&n(2,s=o.class),"mapController"in o&&n(21,i=o.mapController),"apiKey"in o&&n(22,u=o.apiKey),"debounceSearch"in o&&n(23,a=o.debounceSearch),"placeholder"in o&&n(3,h=o.placeholder),"errorMessage"in o&&n(4,p=o.errorMessage),"noResultsMessage"in o&&n(5,H=o.noResultsMessage),"proximity"in o&&n(20,d=o.proximity),"bbox"in o&&n(24,m=o.bbox),"trackProximity"in o&&n(25,g=o.trackProximity),"minLength"in o&&n(26,b=o.minLength),"language"in o&&n(27,M=o.language),"showResultsWhileTyping"in o&&n(28,C=o.showResultsWhileTyping),"zoom"in o&&n(29,x=o.zoom),"flyTo"in o&&n(30,T=o.flyTo),"collapsed"in o&&n(6,L=o.collapsed),"clearOnBlur"in o&&n(31,v=o.clearOnBlur),"enableReverse"in o&&n(7,N=o.enableReverse),"filter"in o&&n(32,k=o.filter),"searchValue"in o&&n(0,j=o.searchValue),"reverseActive"in o&&n(1,z=o.reverseActive),"showPlaceType"in o&&n(8,Ce=o.showPlaceType),"$$scope"in o&&n(38,c=o.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&35651584&&i&&i.setProximityChangeHandler(g?o=>{n(20,d=o)}:void 0),t.$$.dirty[0]&33554432&&(g||n(20,d=void 0)),t.$$.dirty[0]&512|t.$$.dirty[1]&1&&setTimeout(()=>{n(13,De=ee),v&&!ee&&n(0,j="")}),t.$$.dirty[0]&1025&&(j||(n(11,B=void 0),n(10,S=void 0),n(15,fe=void 0),n(36,K=S))),t.$$.dirty[0]&1612711936&&i&&B&&T&&(!B.bbox||B.bbox[0]===B.bbox[2]&&B.bbox[1]===B.bbox[3]?i.flyTo(B.center,x):i.fitBounds(B.bbox,0),n(10,S=void 0),n(36,K=void 0),n(12,A=-1)),t.$$.dirty[0]&1024|t.$$.dirty[1]&32&&K!==S&&n(36,K=void 0),t.$$.dirty[0]&2099200|t.$$.dirty[1]&32&&i&&i.setMarkers(K,B),t.$$.dirty[0]&1&&n(12,A=-1),t.$$.dirty[0]&2101248&&(i==null||i.setSelectedMarker(A)),t.$$.dirty[0]&5120&&n(37,l=S==null?void 0:S[A]),t.$$.dirty[1]&64&&re("select",l),t.$$.dirty[0]&2048&&re("pick",B),t.$$.dirty[0]&9216&&re("optionsVisibilityChange",De&&!!S),t.$$.dirty[0]&1024&&re("featuresListed",S),t.$$.dirty[1]&32&&re("featuresMarked",K),t.$$.dirty[0]&2&&re("reverseToggle",z),t.$$.dirty[0]&1&&re("queryChange",j),t.$$.dirty[0]&2097154&&i&&i.indicateReverse(z),t.$$.dirty[0]&2097154&&i&&i.setMapClickHandler(z?Ut:void 0)},[j,z,s,h,p,H,L,N,Ce,ee,S,B,A,De,le,fe,ue,lt,Wt,ot,d,i,u,a,m,g,b,M,C,x,T,v,k,_,O,$,K,l,c,r,Zt,xt,Jt,Xt,Yt,Ft,$t,en,tn,nn,ln,rn]}class Ht extends me{constructor(e){super(),ge(this,e,Gt,qt,de,{class:2,mapController:21,apiKey:22,debounceSearch:23,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:20,bbox:24,trackProximity:25,minLength:26,language:27,showResultsWhileTyping:28,zoom:29,flyTo:30,collapsed:6,clearOnBlur:31,enableReverse:7,filter:32,searchValue:0,reverseActive:1,showPlaceType:8,focus:33,blur:34,setQuery:35},null,[-1,-1])}get focus(){return this.$$.ctx[33]}get blur(){return this.$$.ctx[34]}get setQuery(){return this.$$.ctx[35]}}function Kt(t,e=!0,n=!0,l={},r={}){let c,s,i,u=[],a;const h=()=>{if(!c){i=void 0;return}let d;const m=t.getZoom()>10?[(d=t.getCenter().wrap()).lng,d.lat]:void 0;i!==m&&(i=m,c(m))},p=d=>{s==null||s([d.latlng.lng,d.latlng.lat])};return{setProximityChangeHandler(d){d?(c=d,t.on("moveend",h),h()):(t.off("moveend",h),c==null||c(void 0),c=void 0)},setMapClickHandler(d){s=d,s?t.on("click",p):t.off("click",p)},flyTo(d,m){t.flyTo(d,m,l)},fitBounds(d,m){t.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{...r,padding:[m,m]})},indicateReverse(d){t.getContainer().style.cursor=d?"crosshair":""},setMarkers(d,m){for(const g of u)g.remove();u.length=0;for(const g of m?[...d!=null?d:[],m]:d!=null?d:[]){let b;const M=[g.center[1],g.center[0]];if(g===m&&typeof e=="object")b=new J.Marker(M,e);else if(g!==m&&typeof n=="object")b=new J.Marker(M,n);else{const C=document.createElement("div");new xe({props:{displayIn:"leaflet"},target:C}),b=new J.Marker(M,{icon:new J.DivIcon({html:C,className:""})})}u.push(b.addTo(t))}},setSelectedMarker(d){var m,g;a&&((m=a.getElement())==null||m.classList.toggle("marker-selected",!1)),a=d>-1?u[d]:void 0,(g=a==null?void 0:a.getElement())==null||g.classList.toggle("marker-selected",!0)}}}class et extends J.Control{constructor(n){super();Ne(this,Z,void 0);Ne(this,ce,void 0);Pe(this,ce,n)}onAdd(n){const l=document.createElement("div");l.className="leaflet-ctrl-geocoder",J.DomEvent.disableClickPropagation(l),J.DomEvent.disableScrollPropagation(l);const{marker:r,showResultMarkers:c,flyTo:s,...i}=F(this,ce),u=typeof s=="boolean"?{}:s,a=Kt(n,r,c,u,u);Pe(this,Z,new Ht({target:l,props:{mapController:a,flyTo:s===void 0?!0:!!s,...i}}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])F(this,Z).$on(h,p=>n.fire(h.toLowerCase(),p.detail));return l}setOptions(n){var i;Pe(this,ce,n);const{marker:l,showResultMarkers:r,flyTo:c,...s}=F(this,ce);(i=F(this,Z))==null||i.$set(s)}setQuery(n,l=!0){var r;(r=F(this,Z))==null||r.setQuery(n,l)}setReverseMode(n){var l;(l=F(this,Z))==null||l.$set({reverseActive:n})}focus(){var n;(n=F(this,Z))==null||n.focus()}blur(){var n;(n=F(this,Z))==null||n.blur()}onRemove(){var n;(n=F(this,Z))==null||n.$destroy()}}Z=new WeakMap,ce=new WeakMap;function Qt(...t){return new et(...t)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Qt),E.GeocodingControl=et,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as L from "leaflet";
|
|
2
2
|
import type { ControlOptions } from "./types";
|
|
3
|
-
export type { Feature } from "./types";
|
|
4
3
|
declare type LeafletControlOptions = ControlOptions & L.ControlOptions & {
|
|
5
4
|
/**
|
|
6
5
|
* If `true`, a [Marker](https://leafletjs.com/reference.html#marker) will be added to the map at the location of the user-selected result using a default set of Marker options.
|
|
@@ -38,3 +37,4 @@ export declare class GeocodingControl extends L.Control {
|
|
|
38
37
|
blur(): void;
|
|
39
38
|
onRemove(): void;
|
|
40
39
|
}
|
|
40
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Map, type IControl, type MarkerOptions, type FlyToOptions, type FitBoundsOptions, Evented } from "maplibre-gl";
|
|
2
2
|
import type maplibregl from "maplibre-gl";
|
|
3
3
|
import type { ControlOptions } from "./types";
|
|
4
|
-
export type { Feature } from "./types";
|
|
5
4
|
declare type MapLibreGL = typeof maplibregl;
|
|
6
5
|
declare type MapLibreControlOptions = ControlOptions & {
|
|
7
6
|
/**
|
|
@@ -47,3 +46,4 @@ export declare class GeocodingControl extends Evented implements IControl {
|
|
|
47
46
|
blur(): void;
|
|
48
47
|
onRemove(): void;
|
|
49
48
|
}
|
|
49
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/geocoding-control",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"svelte-preprocess": "^4.10.7",
|
|
42
42
|
"tslib": "^2.4.1",
|
|
43
43
|
"typescript": "^4.8.4",
|
|
44
|
-
"vite": "^3.2.
|
|
44
|
+
"vite": "^3.2.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"leaflet": "^1.9.2",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as L from "leaflet";
|
|
2
2
|
import GeocodingControlComponent from "./GeocodingControl.svelte";
|
|
3
3
|
import { createLeafletMapController } from "./leafletMapController";
|
|
4
|
-
import type { ControlOptions
|
|
5
|
-
|
|
6
|
-
export type { Feature } from "./types";
|
|
4
|
+
import type { ControlOptions } from "./types";
|
|
7
5
|
|
|
8
6
|
type LeafletControlOptions = ControlOptions &
|
|
9
7
|
L.ControlOptions & {
|
|
@@ -121,3 +119,17 @@ export class GeocodingControl extends L.Control {
|
|
|
121
119
|
(this.#gc as any)?.$destroy();
|
|
122
120
|
}
|
|
123
121
|
}
|
|
122
|
+
|
|
123
|
+
function createControl(
|
|
124
|
+
...params: ConstructorParameters<typeof GeocodingControl>
|
|
125
|
+
) {
|
|
126
|
+
return new GeocodingControl(...params);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (
|
|
130
|
+
window.L &&
|
|
131
|
+
typeof window.L === "object" &&
|
|
132
|
+
typeof window.L.control === "function"
|
|
133
|
+
) {
|
|
134
|
+
(window.L.control as any).maptilerGeocoding = createControl;
|
|
135
|
+
}
|
|
@@ -8,11 +8,9 @@ import {
|
|
|
8
8
|
} from "maplibre-gl";
|
|
9
9
|
import type maplibregl from "maplibre-gl";
|
|
10
10
|
import GeocodingControlComponent from "./GeocodingControl.svelte";
|
|
11
|
-
import type { ControlOptions
|
|
11
|
+
import type { ControlOptions } from "./types";
|
|
12
12
|
import { createMaplibreMapController } from "./maplibreMapController";
|
|
13
13
|
|
|
14
|
-
export type { Feature } from "./types";
|
|
15
|
-
|
|
16
14
|
type MapLibreGL = typeof maplibregl;
|
|
17
15
|
|
|
18
16
|
type MapLibreControlOptions = ControlOptions & {
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as L from "leaflet";
|
|
2
|
-
import type { MapController } from "./types";
|
|
3
|
-
export declare function createLeafletMapController(map: L.Map, marker?: boolean | L.MarkerOptions, showResultMarkers?: boolean | L.MarkerOptions, flyToOptions?: L.ZoomPanOptions, flyToBounds?: L.FitBoundsOptions): MapController;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type MapLibreGL from "maplibre-gl";
|
|
2
|
-
import type { FitBoundsOptions, Map, FlyToOptions } from "maplibre-gl";
|
|
3
|
-
import type { MapController } from "./types";
|
|
4
|
-
export declare function createMaplibreMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions): MapController;
|