@maptiler/geocoding-control 3.0.0-rc.6 → 3.0.0-rc.8
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/check-version.js +69 -0
- package/dist/check-version.d.ts +1 -0
- package/dist/index.js +188 -178
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +55 -50
- package/dist/index.umd.js.map +1 -1
- package/dist/leaflet.public.js +313 -303
- package/dist/leaflet.public.js.map +1 -1
- package/dist/leaflet.public.umd.js +51 -46
- package/dist/leaflet.public.umd.js.map +1 -1
- package/dist/maplibregl.js +188 -178
- package/dist/maplibregl.js.map +1 -1
- package/dist/maplibregl.umd.js +50 -45
- package/dist/maplibregl.umd.js.map +1 -1
- package/dist/maptilersdk.js +243 -233
- package/dist/maptilersdk.js.map +1 -1
- package/dist/maptilersdk.umd.js +62 -57
- package/dist/maptilersdk.umd.js.map +1 -1
- package/dist/openlayers.public.js +225 -214
- package/dist/openlayers.public.js.map +1 -1
- package/dist/openlayers.public.umd.js +51 -46
- package/dist/openlayers.public.umd.js.map +1 -1
- package/dist/src/components/clear-icon.d.ts +1 -0
- package/dist/src/components/fail-icon.d.ts +1 -0
- package/dist/src/components/loading-icon.d.ts +1 -0
- package/dist/src/components/marker.d.ts +1 -0
- package/dist/src/components/reverse-geocoding-icon.d.ts +1 -0
- package/dist/src/components/search-icon.d.ts +1 -0
- package/dist/src/controls/maplibregl-control.d.ts +2 -7
- package/dist/src/controls/maplibregl-events.d.ts +2 -3
- package/dist/src/controls/maplibregl-options.d.ts +1 -9
- package/dist/src/geocoder/geocoder-feature-item.d.ts +1 -0
- package/dist/src/geocoder/geocoder.d.ts +5 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/leaflet.public.d.ts +1 -0
- package/dist/src/maplibregl.d.ts +1 -0
- package/dist/src/maptilersdk.d.ts +1 -0
- package/dist/src/openlayers.public.d.ts +1 -0
- package/package.json +20 -10
package/dist/maptilersdk.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { css as I, LitElement as
|
|
2
|
-
import { customElement as
|
|
1
|
+
import { css as I, LitElement as F, svg as z, html as m, unsafeCSS as ce, nothing as J } from "lit";
|
|
2
|
+
import { customElement as O, property as p, state as b, query as De } from "lit/decorators.js";
|
|
3
3
|
import { convert as Ve } from "geo-coordinates-parser";
|
|
4
4
|
import { classMap as A } from "lit/directives/class-map.js";
|
|
5
5
|
import { repeat as qe } from "lit/directives/repeat.js";
|
|
6
6
|
import "@turf/clone";
|
|
7
7
|
import { styleMap as Ne } from "lit/directives/style-map.js";
|
|
8
8
|
import { config as Ze } from "@maptiler/sdk";
|
|
9
|
-
import { featureCollection as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import { featureCollection as D, polygon as Ke, feature as Qe } from "@turf/helpers";
|
|
10
|
+
import _e from "@turf/union";
|
|
11
|
+
import H from "maplibre-gl";
|
|
12
|
+
import be from "@turf/bbox";
|
|
13
13
|
import Ye from "@turf/difference";
|
|
14
14
|
import He from "@turf/flatten";
|
|
15
15
|
var Je = Object.getOwnPropertyDescriptor, Xe = (t, e, i, a) => {
|
|
@@ -17,7 +17,7 @@ var Je = Object.getOwnPropertyDescriptor, Xe = (t, e, i, a) => {
|
|
|
17
17
|
(r = t[o]) && (s = r(s) || s);
|
|
18
18
|
return s;
|
|
19
19
|
};
|
|
20
|
-
let
|
|
20
|
+
let X = class extends F {
|
|
21
21
|
render() {
|
|
22
22
|
return z`
|
|
23
23
|
<svg viewBox="0 0 14 14" width="13" height="13">
|
|
@@ -28,21 +28,21 @@ let ee = class extends O {
|
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
X.styles = I`
|
|
32
32
|
svg {
|
|
33
33
|
display: block;
|
|
34
34
|
fill: var(--color-icon-button);
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
],
|
|
37
|
+
X = Xe([
|
|
38
|
+
O("maptiler-geocode-clear-icon")
|
|
39
|
+
], X);
|
|
40
40
|
var et = Object.getOwnPropertyDescriptor, tt = (t, e, i, a) => {
|
|
41
41
|
for (var s = a > 1 ? void 0 : a ? et(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
42
42
|
(r = t[o]) && (s = r(s) || s);
|
|
43
43
|
return s;
|
|
44
44
|
};
|
|
45
|
-
let
|
|
45
|
+
let ee = class extends F {
|
|
46
46
|
render() {
|
|
47
47
|
return z`
|
|
48
48
|
<svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -53,21 +53,21 @@ let te = class extends O {
|
|
|
53
53
|
`;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
ee.styles = I`
|
|
57
57
|
svg {
|
|
58
58
|
display: block;
|
|
59
59
|
fill: #e15042;
|
|
60
60
|
}
|
|
61
61
|
`;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
],
|
|
62
|
+
ee = tt([
|
|
63
|
+
O("maptiler-geocode-fail-icon")
|
|
64
|
+
], ee);
|
|
65
65
|
var it = Object.getOwnPropertyDescriptor, st = (t, e, i, a) => {
|
|
66
66
|
for (var s = a > 1 ? void 0 : a ? it(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
67
67
|
(r = t[o]) && (s = r(s) || s);
|
|
68
68
|
return s;
|
|
69
69
|
};
|
|
70
|
-
let
|
|
70
|
+
let te = class extends F {
|
|
71
71
|
render() {
|
|
72
72
|
return m`
|
|
73
73
|
<div>
|
|
@@ -79,7 +79,7 @@ let ie = class extends O {
|
|
|
79
79
|
`;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
te.styles = I`
|
|
83
83
|
div {
|
|
84
84
|
position: absolute;
|
|
85
85
|
left: 50%;
|
|
@@ -106,15 +106,15 @@ ie.styles = I`
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
`;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
109
|
+
te = st([
|
|
110
|
+
O("maptiler-geocode-loading-icon")
|
|
111
|
+
], te);
|
|
112
112
|
var rt = Object.getOwnPropertyDescriptor, ot = (t, e, i, a) => {
|
|
113
113
|
for (var s = a > 1 ? void 0 : a ? rt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
114
114
|
(r = t[o]) && (s = r(s) || s);
|
|
115
115
|
return s;
|
|
116
116
|
};
|
|
117
|
-
let
|
|
117
|
+
let ie = class extends F {
|
|
118
118
|
render() {
|
|
119
119
|
return z`
|
|
120
120
|
<svg viewBox="0 0 60.006 21.412" width="14" height="20">
|
|
@@ -125,21 +125,21 @@ let se = class extends O {
|
|
|
125
125
|
`;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
|
|
128
|
+
ie.styles = I`
|
|
129
129
|
svg {
|
|
130
130
|
display: block;
|
|
131
131
|
fill: var(--color-icon-button);
|
|
132
132
|
}
|
|
133
133
|
`;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
],
|
|
134
|
+
ie = ot([
|
|
135
|
+
O("maptiler-geocode-reverse-geocoding-icon")
|
|
136
|
+
], ie);
|
|
137
137
|
var at = Object.getOwnPropertyDescriptor, lt = (t, e, i, a) => {
|
|
138
138
|
for (var s = a > 1 ? void 0 : a ? at(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
139
139
|
(r = t[o]) && (s = r(s) || s);
|
|
140
140
|
return s;
|
|
141
141
|
};
|
|
142
|
-
let
|
|
142
|
+
let se = class extends F {
|
|
143
143
|
render() {
|
|
144
144
|
return z`
|
|
145
145
|
<svg
|
|
@@ -154,7 +154,7 @@ let re = class extends O {
|
|
|
154
154
|
`;
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
|
|
157
|
+
se.styles = I`
|
|
158
158
|
circle {
|
|
159
159
|
stroke-width: 1.875;
|
|
160
160
|
fill: none;
|
|
@@ -170,27 +170,27 @@ re.styles = I`
|
|
|
170
170
|
stroke: var(--color-icon-button);
|
|
171
171
|
}
|
|
172
172
|
`;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
],
|
|
173
|
+
se = lt([
|
|
174
|
+
O("maptiler-geocode-search-icon")
|
|
175
|
+
], se);
|
|
176
176
|
function nt(t, e, i) {
|
|
177
177
|
const a = e[1], s = e[0], o = a - s;
|
|
178
178
|
return t === a && i ? t : ((t - s) % o + o) % o + s;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function V(t) {
|
|
181
181
|
const e = [...t];
|
|
182
182
|
return e[2] < e[0] && (Math.abs((e[0] + e[2] + 360) / 2) > Math.abs((e[0] - 360 + e[2]) / 2) ? e[0] -= 360 : e[2] += 360), e;
|
|
183
183
|
}
|
|
184
|
-
let
|
|
184
|
+
let P;
|
|
185
185
|
async function ct(t, e, i) {
|
|
186
186
|
for (const a of e ?? [])
|
|
187
187
|
if (!(t && (a.minZoom != null && a.minZoom > t[0] || a.maxZoom != null && a.maxZoom < t[0]))) {
|
|
188
188
|
if (a.type === "fixed")
|
|
189
189
|
return a.coordinates.join(",");
|
|
190
190
|
if (a.type === "client-geolocation")
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
return
|
|
191
|
+
if (P && a.cachedLocationExpiry && P.time + a.cachedLocationExpiry > Date.now()) {
|
|
192
|
+
if (P.coords)
|
|
193
|
+
return P.coords;
|
|
194
194
|
} else {
|
|
195
195
|
let s;
|
|
196
196
|
try {
|
|
@@ -209,7 +209,7 @@ async function ct(t, e, i) {
|
|
|
209
209
|
}), s;
|
|
210
210
|
} catch {
|
|
211
211
|
} finally {
|
|
212
|
-
a.cachedLocationExpiry && (
|
|
212
|
+
a.cachedLocationExpiry && (P = {
|
|
213
213
|
time: Date.now(),
|
|
214
214
|
coords: s
|
|
215
215
|
});
|
|
@@ -224,20 +224,20 @@ async function ct(t, e, i) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
const ht = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
|
|
227
|
-
var pt = Object.defineProperty, dt = Object.getOwnPropertyDescriptor,
|
|
227
|
+
var pt = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, $e = (t) => {
|
|
228
228
|
throw TypeError(t);
|
|
229
|
-
},
|
|
229
|
+
}, _ = (t, e, i, a) => {
|
|
230
230
|
for (var s = a > 1 ? void 0 : a ? dt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
231
231
|
(r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
|
|
232
232
|
return a && s && pt(e, i, s), s;
|
|
233
|
-
},
|
|
234
|
-
const
|
|
235
|
-
let
|
|
233
|
+
}, Ie = (t, e, i) => e.has(t) || $e("Cannot " + i), f = (t, e, i) => (Ie(t, e, "read from private field"), i ? i.call(t) : e.get(t)), ut = (t, e, i) => e.has(t) ? $e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), C = (t, e, i) => (Ie(t, e, "access private method"), i), d, q, G, g, Fe, Oe, he, re;
|
|
234
|
+
const Me = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Te = Me ? "@2x" : "", S = Me ? 2 : 1;
|
|
235
|
+
let T, Se, k = class extends F {
|
|
236
236
|
constructor() {
|
|
237
237
|
super(...arguments), ut(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
|
|
238
238
|
}
|
|
239
239
|
willUpdate(t) {
|
|
240
|
-
t.has("feature") && f(this, d,
|
|
240
|
+
t.has("feature") && f(this, d, q) && (this.index = f(this, d, q).length, C(this, d, he).call(this));
|
|
241
241
|
}
|
|
242
242
|
render() {
|
|
243
243
|
return m`
|
|
@@ -249,25 +249,25 @@ let F, Ce, w = class extends O {
|
|
|
249
249
|
class=${this.itemStyle}
|
|
250
250
|
@click=${() => this.dispatchEvent(new CustomEvent("select"))}
|
|
251
251
|
>
|
|
252
|
-
${
|
|
252
|
+
${T && this.spriteIcon ? m`
|
|
253
253
|
<div
|
|
254
254
|
class="sprite-icon"
|
|
255
255
|
style=${Ne({
|
|
256
256
|
width: `${this.spriteIcon.width / S}px`,
|
|
257
257
|
height: `${this.spriteIcon.height / S}px`,
|
|
258
|
-
backgroundImage: `url(${this.iconsBaseUrl}sprite${
|
|
258
|
+
backgroundImage: `url(${this.iconsBaseUrl}sprite${Te}.png)`,
|
|
259
259
|
backgroundPosition: `-${this.spriteIcon.x / S}px -${this.spriteIcon.y / S}px`,
|
|
260
|
-
backgroundSize: `${
|
|
260
|
+
backgroundSize: `${T.width / S}px ${T.height / S}px`
|
|
261
261
|
})}
|
|
262
262
|
title=${f(this, d, g)}
|
|
263
263
|
/>
|
|
264
|
-
` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, d, g)} @error=${
|
|
264
|
+
` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, d, g)} @error=${C(this, d, Oe)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : f(this, d, G) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> `}
|
|
265
265
|
|
|
266
266
|
<span class="texts">
|
|
267
267
|
<span>
|
|
268
268
|
<span class="primary"> ${f(this, d, G) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
|
|
269
269
|
|
|
270
|
-
${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !f(this, d, G) ? m` <span class="secondary"> ${f(this, d, g)} </span> ` :
|
|
270
|
+
${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !f(this, d, G) ? m` <span class="secondary"> ${f(this, d, g)} </span> ` : J}
|
|
271
271
|
</span>
|
|
272
272
|
|
|
273
273
|
<span class="line2"> ${f(this, d, G) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
|
|
@@ -277,7 +277,7 @@ let F, Ce, w = class extends O {
|
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
279
|
d = /* @__PURE__ */ new WeakSet();
|
|
280
|
-
|
|
280
|
+
q = function() {
|
|
281
281
|
return this.feature?.properties?.categories;
|
|
282
282
|
};
|
|
283
283
|
G = function() {
|
|
@@ -286,75 +286,75 @@ G = function() {
|
|
|
286
286
|
g = function() {
|
|
287
287
|
return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
|
|
288
288
|
};
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
Fe = function() {
|
|
290
|
+
Se ??= fetch(`${this.iconsBaseUrl}sprite${Te}.json`).then((t) => t.json()).then((t) => {
|
|
291
|
+
T = t;
|
|
292
292
|
}).catch(() => {
|
|
293
|
-
|
|
293
|
+
T = null;
|
|
294
294
|
});
|
|
295
295
|
};
|
|
296
|
-
|
|
297
|
-
this.imageUrl && this.missingIconsCache.add(this.imageUrl),
|
|
296
|
+
Oe = function() {
|
|
297
|
+
this.imageUrl && this.missingIconsCache.add(this.imageUrl), C(this, d, he).call(this);
|
|
298
298
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
he = function() {
|
|
300
|
+
T !== void 0 ? C(this, d, re).call(this) : (C(this, d, Fe).call(this), Se?.then(() => {
|
|
301
|
+
C(this, d, re).call(this);
|
|
302
302
|
}));
|
|
303
303
|
};
|
|
304
|
-
|
|
304
|
+
re = function() {
|
|
305
305
|
do {
|
|
306
|
-
if (this.index--, this.category = f(this, d,
|
|
306
|
+
if (this.index--, this.category = f(this, d, q)?.[this.index], this.spriteIcon = this.category ? T?.icons[this.category] : void 0, this.spriteIcon)
|
|
307
307
|
break;
|
|
308
308
|
this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
|
|
309
309
|
} while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
k.styles = I`
|
|
312
312
|
${ce(ht)}
|
|
313
313
|
`;
|
|
314
|
-
|
|
314
|
+
_([
|
|
315
315
|
p({ type: Object })
|
|
316
|
-
],
|
|
317
|
-
|
|
316
|
+
], k.prototype, "feature", 2);
|
|
317
|
+
_([
|
|
318
318
|
p({ type: String })
|
|
319
|
-
],
|
|
320
|
-
|
|
319
|
+
], k.prototype, "itemStyle", 2);
|
|
320
|
+
_([
|
|
321
321
|
p({ type: String })
|
|
322
|
-
],
|
|
323
|
-
|
|
322
|
+
], k.prototype, "showPlaceType", 2);
|
|
323
|
+
_([
|
|
324
324
|
p({ attribute: !1 })
|
|
325
|
-
],
|
|
326
|
-
|
|
325
|
+
], k.prototype, "missingIconsCache", 2);
|
|
326
|
+
_([
|
|
327
327
|
p({ type: String })
|
|
328
|
-
],
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
],
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
],
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
],
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
],
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
],
|
|
328
|
+
], k.prototype, "iconsBaseUrl", 2);
|
|
329
|
+
_([
|
|
330
|
+
b()
|
|
331
|
+
], k.prototype, "category", 2);
|
|
332
|
+
_([
|
|
333
|
+
b()
|
|
334
|
+
], k.prototype, "imageUrl", 2);
|
|
335
|
+
_([
|
|
336
|
+
b()
|
|
337
|
+
], k.prototype, "spriteIcon", 2);
|
|
338
|
+
_([
|
|
339
|
+
b()
|
|
340
|
+
], k.prototype, "index", 2);
|
|
341
|
+
k = _([
|
|
342
|
+
O("maptiler-geocoder-feature-item")
|
|
343
|
+
], k);
|
|
344
344
|
const ft = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
|
|
345
|
-
var mt = Object.defineProperty, gt = Object.getOwnPropertyDescriptor,
|
|
345
|
+
var mt = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, Ce = (t) => {
|
|
346
346
|
throw TypeError(t);
|
|
347
347
|
}, c = (t, e, i, a) => {
|
|
348
348
|
for (var s = a > 1 ? void 0 : a ? gt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
|
|
349
349
|
(r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
|
|
350
350
|
return a && s && mt(e, i, s), s;
|
|
351
|
-
},
|
|
352
|
-
let n = class extends
|
|
351
|
+
}, pe = (t, e, i) => e.has(t) || Ce("Cannot " + i), w = (t, e, i) => (pe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), U = (t, e, i) => e.has(t) ? Ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), oe = (t, e, i, a) => (pe(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (pe(t, e, "access private method"), i), N, B, ae, R, l, Z, Ee, de, x, ue, K, fe, me, $, ge, Q, Pe, le, Ue, Ge, Be, Re, ze, je, Ae;
|
|
352
|
+
let n = class extends F {
|
|
353
353
|
constructor() {
|
|
354
|
-
super(...arguments),
|
|
354
|
+
super(...arguments), U(this, l), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.isFeatureListVisible = !1, this.isFeatureListInteractedWith = !1, U(this, N, !1), U(this, B), U(this, ae, /* @__PURE__ */ new Set()), U(this, R);
|
|
355
355
|
}
|
|
356
356
|
firstUpdated() {
|
|
357
|
-
|
|
357
|
+
oe(this, N, !0);
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
360
|
* Set the options of this instance.
|
|
@@ -373,7 +373,7 @@ let n = class extends O {
|
|
|
373
373
|
* @param value text to set
|
|
374
374
|
*/
|
|
375
375
|
setQuery(t) {
|
|
376
|
-
h(this, l,
|
|
376
|
+
h(this, l, me).call(this, t, { external: !0 }), h(this, l, fe).call(this);
|
|
377
377
|
}
|
|
378
378
|
/**
|
|
379
379
|
* Set the content of search input box and immediately submit it.
|
|
@@ -381,7 +381,7 @@ let n = class extends O {
|
|
|
381
381
|
* @param value text to set and submit
|
|
382
382
|
*/
|
|
383
383
|
submitQuery(t) {
|
|
384
|
-
h(this, l,
|
|
384
|
+
h(this, l, ge).call(this, t, { external: !0 });
|
|
385
385
|
}
|
|
386
386
|
/**
|
|
387
387
|
* Clear search result list.
|
|
@@ -411,27 +411,25 @@ let n = class extends O {
|
|
|
411
411
|
}
|
|
412
412
|
/** @internal */
|
|
413
413
|
handleMapChange(t) {
|
|
414
|
-
|
|
414
|
+
oe(this, R, t);
|
|
415
415
|
}
|
|
416
416
|
/** @internal */
|
|
417
417
|
handleMapClick(t) {
|
|
418
|
-
this.reverseActive && h(this, l,
|
|
418
|
+
this.reverseActive && h(this, l, Pe).call(this, t);
|
|
419
419
|
}
|
|
420
420
|
willUpdate(t) {
|
|
421
|
-
t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) &&
|
|
422
|
-
this.focusedDelayed = this.focused, this.clearOnBlur && !this.focused && (this.searchValue = "");
|
|
423
|
-
}, 100), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, x).call(this, "select", { feature: b(this, l, Q) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
|
|
421
|
+
t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && w(this, l, de) && (h(this, l, $).call(this), this.error = void 0), ["focused", "listIsInteractedWith"].some((e) => t.has(e)) && this.clearOnBlur && !this.focused && !this.isFeatureListInteractedWith && (this.searchValue = ""), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, x).call(this, "select", { feature: w(this, l, Z) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, Q).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
|
|
424
422
|
() => {
|
|
425
423
|
h(this, l, x).call(this, "pick", { feature: this.picked });
|
|
426
424
|
},
|
|
427
425
|
(e) => {
|
|
428
426
|
e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, l, x).call(this, "pick", { feature: this.picked }));
|
|
429
427
|
}
|
|
430
|
-
), ["listFeatures", "
|
|
428
|
+
), ["listFeatures", "focused", "isFeatureListInteractedWith", "keepListOpen"].some((e) => t.has(e)) && (this.isFeatureListVisible = !!this.listFeatures?.length && (this.focused || this.isFeatureListInteractedWith || this.keepListOpen)), ["isFeatureListVisible"].some((e) => t.has(e)) && (this.isFeatureListVisible ? h(this, l, x).call(this, "featuresshow") : h(this, l, x).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, l, x).call(this, "reversetoggle", { reverse: this.reverseActive });
|
|
431
429
|
}
|
|
432
430
|
render() {
|
|
433
431
|
return m`
|
|
434
|
-
<form @submit=${h(this, l,
|
|
432
|
+
<form @submit=${h(this, l, ue)} class=${A({ "can-collapse": this.collapsed && this.searchValue === "" })}>
|
|
435
433
|
<div class="input-group">
|
|
436
434
|
<button
|
|
437
435
|
class="search-button"
|
|
@@ -449,14 +447,14 @@ let n = class extends O {
|
|
|
449
447
|
@blur=${() => this.focused = !1}
|
|
450
448
|
@click=${() => this.focused = !0}
|
|
451
449
|
@keydown=${h(this, l, le)}
|
|
452
|
-
@input=${h(this, l,
|
|
450
|
+
@input=${h(this, l, Ue)}
|
|
453
451
|
@change=${() => this.picked = void 0}
|
|
454
452
|
placeholder=${this.placeholder ?? "Search"}
|
|
455
453
|
aria-label=${this.placeholder ?? "Search"}
|
|
456
454
|
/>
|
|
457
455
|
|
|
458
456
|
<div class="clear-button-container ${A({ displayable: this.searchValue !== "" })}">
|
|
459
|
-
${
|
|
457
|
+
${w(this, l, Ee) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
|
|
460
458
|
<button type="button" @click=${h(this, l, Ae)} title=${this.clearButtonTitle ?? "clear"}>
|
|
461
459
|
<maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
|
|
462
460
|
</button>
|
|
@@ -472,7 +470,7 @@ let n = class extends O {
|
|
|
472
470
|
>
|
|
473
471
|
<maptiler-geocode-reverse-geocoding-icon></maptiler-geocode-reverse-geocoding-icon>
|
|
474
472
|
</button>
|
|
475
|
-
` :
|
|
473
|
+
` : J}
|
|
476
474
|
|
|
477
475
|
<!-- <slot /> -->
|
|
478
476
|
</div>
|
|
@@ -487,7 +485,7 @@ let n = class extends O {
|
|
|
487
485
|
<maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
|
|
488
486
|
</button>
|
|
489
487
|
</div>
|
|
490
|
-
` : !this.
|
|
488
|
+
` : !this.focused && !this.isFeatureListInteractedWith && !this.keepListOpen || this.listFeatures === void 0 ? J : this.listFeatures.length === 0 ? m`
|
|
491
489
|
<div class="no-results">
|
|
492
490
|
<maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
|
|
493
491
|
|
|
@@ -496,7 +494,14 @@ let n = class extends O {
|
|
|
496
494
|
</div>
|
|
497
495
|
</div>
|
|
498
496
|
` : m`
|
|
499
|
-
<ul
|
|
497
|
+
<ul
|
|
498
|
+
class="options ${A({ "open-on-top": this.openListOnTop })}"
|
|
499
|
+
@pointerleave=${h(this, l, Re)}
|
|
500
|
+
@pointerdown=${h(this, l, ze)}
|
|
501
|
+
@pointerup=${h(this, l, je)}
|
|
502
|
+
@keydown=${h(this, l, le)}
|
|
503
|
+
role="listbox"
|
|
504
|
+
>
|
|
500
505
|
${qe(
|
|
501
506
|
this.listFeatures,
|
|
502
507
|
(t) => t.id + (t.address ? "," + t.address : ""),
|
|
@@ -505,17 +510,15 @@ let n = class extends O {
|
|
|
505
510
|
.feature=${t}
|
|
506
511
|
.showPlaceType=${this.showPlaceType ?? "if-needed"}
|
|
507
512
|
itemStyle=${this.selectedItemIndex === e ? "selected" : this.picked?.id === t.id ? "picked" : "default"}
|
|
508
|
-
@
|
|
509
|
-
h(this, l,
|
|
513
|
+
@pointerenter=${() => {
|
|
514
|
+
h(this, l, Be).call(this, e);
|
|
510
515
|
}}
|
|
511
516
|
@select=${() => {
|
|
512
|
-
h(this, l,
|
|
517
|
+
h(this, l, Ge).call(this, t);
|
|
513
518
|
}}
|
|
514
|
-
.missingIconsCache=${
|
|
515
|
-
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.
|
|
516
|
-
|
|
517
|
-
${t.place_name}
|
|
518
|
-
</maptiler-geocoder-feature-item>
|
|
519
|
+
.missingIconsCache=${w(this, ae)}
|
|
520
|
+
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.8/icons/"}
|
|
521
|
+
/>
|
|
519
522
|
`
|
|
520
523
|
)}
|
|
521
524
|
</ul>
|
|
@@ -524,26 +527,22 @@ let n = class extends O {
|
|
|
524
527
|
`;
|
|
525
528
|
}
|
|
526
529
|
};
|
|
527
|
-
|
|
528
|
-
V = /* @__PURE__ */ new WeakMap();
|
|
530
|
+
N = /* @__PURE__ */ new WeakMap();
|
|
529
531
|
B = /* @__PURE__ */ new WeakMap();
|
|
530
532
|
ae = /* @__PURE__ */ new WeakMap();
|
|
531
533
|
R = /* @__PURE__ */ new WeakMap();
|
|
532
534
|
l = /* @__PURE__ */ new WeakSet();
|
|
533
|
-
|
|
535
|
+
Z = function() {
|
|
534
536
|
return this.listFeatures?.[this.selectedItemIndex];
|
|
535
537
|
};
|
|
536
|
-
|
|
537
|
-
return !!this.listFeatures?.length && (this.focusedDelayed || this.keepListOpen);
|
|
538
|
-
};
|
|
539
|
-
Ue = function() {
|
|
538
|
+
Ee = function() {
|
|
540
539
|
return this.abortController !== void 0;
|
|
541
540
|
};
|
|
542
|
-
|
|
541
|
+
de = function() {
|
|
543
542
|
return this.searchValue.length < (this.minLength ?? 2);
|
|
544
543
|
};
|
|
545
544
|
x = function(t, ...[e]) {
|
|
546
|
-
|
|
545
|
+
w(this, N) && this.dispatchEvent(
|
|
547
546
|
new CustomEvent(t, {
|
|
548
547
|
bubbles: !0,
|
|
549
548
|
composed: !0,
|
|
@@ -551,30 +550,30 @@ x = function(t, ...[e]) {
|
|
|
551
550
|
})
|
|
552
551
|
);
|
|
553
552
|
};
|
|
554
|
-
|
|
555
|
-
t?.preventDefault(), this.focused = !1, clearTimeout(
|
|
553
|
+
ue = function(t, { external: e = !1 } = {}) {
|
|
554
|
+
t?.preventDefault(), this.focused = !1, clearTimeout(w(this, B)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, l, Q).call(this, this.searchValue, { exact: !0, external: e }).then(() => {
|
|
556
555
|
this.picked = void 0;
|
|
557
|
-
}).catch((
|
|
556
|
+
}).catch((i) => this.error = i);
|
|
558
557
|
};
|
|
559
|
-
|
|
558
|
+
K = function(t) {
|
|
560
559
|
try {
|
|
561
560
|
return Ve(t, 6);
|
|
562
561
|
} catch {
|
|
563
562
|
return !1;
|
|
564
563
|
}
|
|
565
564
|
};
|
|
566
|
-
|
|
565
|
+
fe = function() {
|
|
567
566
|
setTimeout(() => {
|
|
568
567
|
this.input.focus(), this.focused = !0, this.input.select();
|
|
569
568
|
});
|
|
570
569
|
};
|
|
571
|
-
|
|
572
|
-
if (this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l,
|
|
573
|
-
if (clearTimeout(
|
|
570
|
+
me = function(t, { external: e = !1 } = {}) {
|
|
571
|
+
if (this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, K).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
|
|
572
|
+
if (clearTimeout(w(this, B)), w(this, l, de))
|
|
574
573
|
return;
|
|
575
574
|
const i = this.searchValue;
|
|
576
|
-
|
|
577
|
-
h(this, l,
|
|
575
|
+
oe(this, B, window.setTimeout(() => {
|
|
576
|
+
h(this, l, Q).call(this, i, { external: e }).catch((a) => this.error = a);
|
|
578
577
|
}, this.debounceSearch ?? 200));
|
|
579
578
|
} else
|
|
580
579
|
h(this, l, $).call(this);
|
|
@@ -582,37 +581,37 @@ ge = function(t, { external: e = !1 } = {}) {
|
|
|
582
581
|
$ = function() {
|
|
583
582
|
this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, l, x).call(this, "featuresclear"));
|
|
584
583
|
};
|
|
585
|
-
|
|
586
|
-
this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l,
|
|
584
|
+
ge = function(t, { external: e = !1 } = {}) {
|
|
585
|
+
this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, K).call(this, t) }), this.selectedItemIndex = -1, h(this, l, ue).call(this, void 0, { external: e });
|
|
587
586
|
};
|
|
588
|
-
|
|
587
|
+
Q = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
|
|
589
588
|
this.error = void 0, this.abortController?.abort();
|
|
590
589
|
const s = new AbortController();
|
|
591
590
|
this.abortController = s;
|
|
592
591
|
try {
|
|
593
|
-
const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", r = h(this, l,
|
|
592
|
+
const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", r = h(this, l, K).call(this, t), u = new URL(o + "/" + encodeURIComponent(r ? `${r.decimalLongitude},${r.decimalLatitude}` : t) + ".json"), y = u.searchParams;
|
|
594
593
|
this.language !== void 0 && y.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
|
|
595
|
-
const [
|
|
596
|
-
let
|
|
597
|
-
(v) => typeof v == "string" ? v :
|
|
594
|
+
const [M] = w(this, R) ?? [void 0];
|
|
595
|
+
let L = (!r || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
|
|
596
|
+
(v) => typeof v == "string" ? v : M === void 0 || (v[0] ?? 0) <= M && M < (v[1] ?? 1 / 0) ? v[2] : void 0
|
|
598
597
|
).filter((v) => v !== void 0);
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
if (
|
|
602
|
-
const v = this.proximity ?? [{ type: "server-geolocation" }],
|
|
603
|
-
|
|
598
|
+
L && (L = [...new Set(L)], y.set("types", L.join(",")));
|
|
599
|
+
const ye = !r || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
|
|
600
|
+
if (ye && y.set("excludeTypes", String(ye)), this.bbox && y.set("bbox", this.bbox.map((v) => v.toFixed(6)).join(",")), this.country && y.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && y.set("worldview", this.worldview), !e && !r) {
|
|
601
|
+
const v = this.proximity ?? [{ type: "server-geolocation" }], xe = await ct(w(this, R), v, s);
|
|
602
|
+
xe && y.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && y.set("autocomplete", "false"), y.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
|
|
604
603
|
}
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
const
|
|
604
|
+
const ve = this.limit ?? 5, Y = this.reverseGeocodingLimit ?? ve;
|
|
605
|
+
Y > 1 && L?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), r ? (Y === 1 || this.exhaustiveReverseGeocoding || L?.length === 1) && y.set("limit", String(Y)) : y.set("limit", String(ve)), this.apiKey && y.set("key", this.apiKey), this.adjustUrl?.(u);
|
|
606
|
+
const We = u.searchParams.get("types") === "" && u.searchParams.get("excludeTypes") !== "true", j = u.toString();
|
|
608
607
|
if (j === this.lastSearchUrl) {
|
|
609
|
-
e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.listFeatures[this.selectedItemIndex]?.id !==
|
|
608
|
+
e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.listFeatures[this.selectedItemIndex]?.id !== w(this, l, Z)?.id && (this.selectedItemIndex = -1));
|
|
610
609
|
return;
|
|
611
610
|
}
|
|
612
611
|
h(this, l, x).call(this, "request", { urlObj: u }), this.lastSearchUrl = j;
|
|
613
|
-
let
|
|
614
|
-
if (
|
|
615
|
-
|
|
612
|
+
let E;
|
|
613
|
+
if (We)
|
|
614
|
+
E = { type: "FeatureCollection", features: [] };
|
|
616
615
|
else {
|
|
617
616
|
const v = await fetch(j, {
|
|
618
617
|
signal: s.signal,
|
|
@@ -620,15 +619,15 @@ H = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
|
|
|
620
619
|
});
|
|
621
620
|
if (!v.ok)
|
|
622
621
|
throw new Error(await v.text());
|
|
623
|
-
|
|
622
|
+
E = await v.json();
|
|
624
623
|
}
|
|
625
|
-
h(this, l, x).call(this, "response", { url: j, featureCollection:
|
|
624
|
+
h(this, l, x).call(this, "response", { url: j, featureCollection: E }), e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = E.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = E.features.filter(this.filter ?? (() => !0)), r && this.listFeatures.unshift({
|
|
626
625
|
type: "Feature",
|
|
627
626
|
properties: {},
|
|
628
627
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
629
628
|
id: `reverse_${r.decimalLongitude}_${r.decimalLatitude}`,
|
|
630
|
-
|
|
631
|
-
|
|
629
|
+
place_name: `${r.decimalLatitude}, ${r.decimalLongitude}`,
|
|
630
|
+
text: r.toCoordinateFormat("DMS"),
|
|
632
631
|
/* eslint-enable @typescript-eslint/restrict-template-expressions */
|
|
633
632
|
place_type: ["reverse"],
|
|
634
633
|
place_type_name: ["reverse"],
|
|
@@ -638,7 +637,7 @@ H = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
|
|
|
638
637
|
type: "Point",
|
|
639
638
|
coordinates: [r.decimalLongitude, r.decimalLatitude]
|
|
640
639
|
}
|
|
641
|
-
}), h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !==
|
|
640
|
+
}), h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== w(this, l, Z)?.id && (this.selectedItemIndex = -1), r && this.input.focus());
|
|
642
641
|
} catch (o) {
|
|
643
642
|
if (o && typeof o == "object" && "name" in o && o.name === "AbortError")
|
|
644
643
|
return;
|
|
@@ -647,8 +646,8 @@ H = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
|
|
|
647
646
|
s === this.abortController && (this.abortController = void 0);
|
|
648
647
|
}
|
|
649
648
|
};
|
|
650
|
-
|
|
651
|
-
this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l,
|
|
649
|
+
Pe = function(t) {
|
|
650
|
+
this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ge).call(this, `${t[1].toFixed(6)}, ${nt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, fe).call(this);
|
|
652
651
|
};
|
|
653
652
|
le = function(t) {
|
|
654
653
|
if (!this.listFeatures)
|
|
@@ -656,17 +655,25 @@ le = function(t) {
|
|
|
656
655
|
const e = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
|
|
657
656
|
e && (this.input.focus(), this.focused = !0, t.preventDefault(), this.picked && this.selectedItemIndex === -1 && (this.selectedItemIndex = this.listFeatures.findIndex((i) => i.id === this.picked?.id)), this.selectedItemIndex === (this.picked || this.selectFirst !== !1 ? 0 : -1) && e === -1 && (this.selectedItemIndex = this.listFeatures.length), this.selectedItemIndex += e, this.selectedItemIndex >= this.listFeatures.length && (this.selectedItemIndex = -1), this.selectedItemIndex < 0 && (this.picked || this.selectFirst !== !1) && (this.selectedItemIndex = 0));
|
|
658
657
|
};
|
|
659
|
-
|
|
660
|
-
h(this, l,
|
|
658
|
+
Ue = function(t) {
|
|
659
|
+
h(this, l, me).call(this, t.target.value);
|
|
661
660
|
};
|
|
662
|
-
|
|
661
|
+
Ge = function(t) {
|
|
663
662
|
(!this.picked || this.picked.id !== t.id) && (this.picked = t, this.searchValue = t.place_name);
|
|
664
663
|
};
|
|
665
|
-
|
|
664
|
+
Be = function(t) {
|
|
666
665
|
this.selectedItemIndex = t;
|
|
667
666
|
};
|
|
667
|
+
Re = function() {
|
|
668
|
+
(!this.selectFirst || this.picked) && (this.selectedItemIndex = -1), this.isFeatureListInteractedWith && (this.isFeatureListInteractedWith = !1);
|
|
669
|
+
};
|
|
670
|
+
ze = function() {
|
|
671
|
+
this.isFeatureListInteractedWith = !0;
|
|
672
|
+
};
|
|
668
673
|
je = function() {
|
|
669
|
-
(
|
|
674
|
+
setTimeout(() => {
|
|
675
|
+
this.isFeatureListInteractedWith = !1;
|
|
676
|
+
});
|
|
670
677
|
};
|
|
671
678
|
Ae = function() {
|
|
672
679
|
this.searchValue = "", h(this, l, x).call(this, "queryclear"), this.picked = void 0, this.input.focus();
|
|
@@ -786,40 +793,43 @@ c([
|
|
|
786
793
|
p({ type: String })
|
|
787
794
|
], n.prototype, "worldview", 2);
|
|
788
795
|
c([
|
|
789
|
-
|
|
796
|
+
De("input")
|
|
790
797
|
], n.prototype, "input", 2);
|
|
791
798
|
c([
|
|
792
|
-
|
|
799
|
+
b()
|
|
793
800
|
], n.prototype, "searchValue", 2);
|
|
794
801
|
c([
|
|
795
|
-
|
|
802
|
+
b()
|
|
796
803
|
], n.prototype, "listFeatures", 2);
|
|
797
804
|
c([
|
|
798
|
-
|
|
805
|
+
b()
|
|
799
806
|
], n.prototype, "selectedItemIndex", 2);
|
|
800
807
|
c([
|
|
801
|
-
|
|
808
|
+
b()
|
|
802
809
|
], n.prototype, "picked", 2);
|
|
803
810
|
c([
|
|
804
|
-
|
|
811
|
+
b()
|
|
805
812
|
], n.prototype, "cachedFeatures", 2);
|
|
806
813
|
c([
|
|
807
|
-
|
|
814
|
+
b()
|
|
808
815
|
], n.prototype, "lastSearchUrl", 2);
|
|
809
816
|
c([
|
|
810
|
-
|
|
817
|
+
b()
|
|
811
818
|
], n.prototype, "error", 2);
|
|
812
819
|
c([
|
|
813
|
-
|
|
820
|
+
b()
|
|
814
821
|
], n.prototype, "abortController", 2);
|
|
815
822
|
c([
|
|
816
|
-
|
|
823
|
+
b()
|
|
817
824
|
], n.prototype, "focused", 2);
|
|
818
825
|
c([
|
|
819
|
-
|
|
820
|
-
], n.prototype, "
|
|
826
|
+
b()
|
|
827
|
+
], n.prototype, "isFeatureListVisible", 2);
|
|
828
|
+
c([
|
|
829
|
+
b()
|
|
830
|
+
], n.prototype, "isFeatureListInteractedWith", 2);
|
|
821
831
|
n = c([
|
|
822
|
-
|
|
832
|
+
O("maptiler-geocoder")
|
|
823
833
|
], n);
|
|
824
834
|
const yt = [
|
|
825
835
|
"adjustUrl",
|
|
@@ -865,7 +875,7 @@ var xt = Object.getOwnPropertyDescriptor, bt = (t, e, i, a) => {
|
|
|
865
875
|
(r = t[o]) && (s = r(s) || s);
|
|
866
876
|
return s;
|
|
867
877
|
};
|
|
868
|
-
let ne = class extends
|
|
878
|
+
let ne = class extends F {
|
|
869
879
|
render() {
|
|
870
880
|
return z`
|
|
871
881
|
<svg
|
|
@@ -885,12 +895,12 @@ ne.styles = I`
|
|
|
885
895
|
${ce(vt)}
|
|
886
896
|
`;
|
|
887
897
|
ne = bt([
|
|
888
|
-
|
|
898
|
+
O("maptiler-geocode-marker")
|
|
889
899
|
], ne);
|
|
890
|
-
const
|
|
900
|
+
const wt = "@maptiler/geocoding-control", kt = "3.0.0-rc.8";
|
|
891
901
|
function we(t) {
|
|
892
902
|
const e = Ye(
|
|
893
|
-
|
|
903
|
+
D([
|
|
894
904
|
Ke([
|
|
895
905
|
[
|
|
896
906
|
[180, 90],
|
|
@@ -906,22 +916,22 @@ function we(t) {
|
|
|
906
916
|
if (!e)
|
|
907
917
|
return;
|
|
908
918
|
e.properties = { isMask: !0 };
|
|
909
|
-
const i =
|
|
919
|
+
const i = V(be(t)), a = (i[2] - i[0]) / 360 / 1e3, s = i[0] < -180, o = i[2] > 180, r = He(t);
|
|
910
920
|
if (r.features.length > 1 && (s || o))
|
|
911
921
|
for (const u of r.features) {
|
|
912
|
-
const y =
|
|
922
|
+
const y = V(be(u));
|
|
913
923
|
if (o && y[0] < -180 + a)
|
|
914
|
-
for (const
|
|
915
|
-
for (const
|
|
916
|
-
|
|
924
|
+
for (const M of u.geometry.coordinates)
|
|
925
|
+
for (const L of M)
|
|
926
|
+
L[0] += 360 - a;
|
|
917
927
|
if (s && y[2] > 180 - a)
|
|
918
|
-
for (const
|
|
919
|
-
for (const
|
|
920
|
-
|
|
928
|
+
for (const M of u.geometry.coordinates)
|
|
929
|
+
for (const L of M)
|
|
930
|
+
L[0] -= 360 - a;
|
|
921
931
|
}
|
|
922
|
-
return
|
|
932
|
+
return D([r.features.length < 2 ? t : _e(r) ?? t, e]);
|
|
923
933
|
}
|
|
924
|
-
const
|
|
934
|
+
const Lt = {
|
|
925
935
|
continental_marine: 4,
|
|
926
936
|
country: 4,
|
|
927
937
|
major_landform: 8,
|
|
@@ -945,7 +955,7 @@ const _t = {
|
|
|
945
955
|
"poi.restaurant": 18,
|
|
946
956
|
"poi.aerodrome": 13
|
|
947
957
|
// TODO add many more
|
|
948
|
-
},
|
|
958
|
+
}, _t = {
|
|
949
959
|
fill: {
|
|
950
960
|
paint: {
|
|
951
961
|
"fill-color": "#000",
|
|
@@ -964,8 +974,8 @@ const _t = {
|
|
|
964
974
|
},
|
|
965
975
|
filter: ["!", ["has", "isMask"]]
|
|
966
976
|
}
|
|
967
|
-
},
|
|
968
|
-
class
|
|
977
|
+
}, W = "mtlr-gc-full-geom", ke = "mtlr-gc-full-geom-fill", Le = "mtlr-gc-full-geom-line";
|
|
978
|
+
class $t extends H.Evented {
|
|
969
979
|
#e = {};
|
|
970
980
|
#t;
|
|
971
981
|
#i;
|
|
@@ -974,13 +984,13 @@ class Mt extends $t {
|
|
|
974
984
|
}
|
|
975
985
|
/** @internal Not to be called directly */
|
|
976
986
|
onAdd(e) {
|
|
977
|
-
this.#t = e, this.#i = e._container.ownerDocument.createElement("maptiler-geocoder"), this.#i.classList.add("maplibregl-geocoder"), this.#v(), this.#
|
|
987
|
+
this.#t = e, this.#i = e._container.ownerDocument.createElement("maptiler-geocoder"), this.#i.classList.add("maplibregl-geocoder"), this.#v(), this.#k();
|
|
978
988
|
const i = e._container.ownerDocument.createElement("div");
|
|
979
989
|
return i.classList.add("maplibregl-ctrl-geocoder", "maplibregl-ctrl", "maplibregl-ctrl-group"), i.style.position = "relative", i.style.zIndex = "3", i.appendChild(this.#i), setTimeout(() => this.#i?.setOptions({ openListOnTop: i.matches(".maplibregl-ctrl-bottom-left *, .maplibregl-ctrl-bottom-right *") })), i;
|
|
980
990
|
}
|
|
981
991
|
/** @internal Not to be called directly */
|
|
982
992
|
onRemove() {
|
|
983
|
-
this.#
|
|
993
|
+
this.#L(), this.#t = void 0, this.#i = void 0;
|
|
984
994
|
}
|
|
985
995
|
getOptions() {
|
|
986
996
|
return { ...this.#e };
|
|
@@ -1028,10 +1038,10 @@ class Mt extends $t {
|
|
|
1028
1038
|
},
|
|
1029
1039
|
querychange: (e) => {
|
|
1030
1040
|
const i = e.detail.reverseCoords;
|
|
1031
|
-
this.#
|
|
1041
|
+
this.#w(i ? [i.decimalLongitude, i.decimalLatitude] : void 0), this.#s("querychange", e.detail);
|
|
1032
1042
|
},
|
|
1033
1043
|
queryclear: () => {
|
|
1034
|
-
this.#
|
|
1044
|
+
this.#w(void 0), this.#s("queryclear");
|
|
1035
1045
|
},
|
|
1036
1046
|
request: (e) => {
|
|
1037
1047
|
this.#s("request", e.detail);
|
|
@@ -1041,11 +1051,11 @@ class Mt extends $t {
|
|
|
1041
1051
|
},
|
|
1042
1052
|
select: (e) => {
|
|
1043
1053
|
const i = e.detail.feature;
|
|
1044
|
-
i && this.#d && this.#e.flyToSelected && this.#x(i.center, this.#h(i)), this.#o && i && this.#
|
|
1054
|
+
i && this.#d && this.#e.flyToSelected && this.#x(i.center, this.#h(i)), this.#o && i && this.#O(i), this.#s("select", e.detail);
|
|
1045
1055
|
},
|
|
1046
1056
|
pick: (e) => {
|
|
1047
1057
|
const i = e.detail.feature;
|
|
1048
|
-
i && i.id !== this.#m && this.#d && (this.#
|
|
1058
|
+
i && i.id !== this.#m && this.#d && (this.#_(i), this.#p(this.#o, i)), this.#m = i?.id, this.#s("pick", e.detail);
|
|
1049
1059
|
},
|
|
1050
1060
|
featuresshow: () => {
|
|
1051
1061
|
this.#s("featuresshow");
|
|
@@ -1084,7 +1094,7 @@ class Mt extends $t {
|
|
|
1084
1094
|
#v() {
|
|
1085
1095
|
this.#i && (this.#i.setOptions(this.#e), this.#i.fetchFullGeometryOnPick = this.#e.pickedResultStyle !== "marker-only");
|
|
1086
1096
|
}
|
|
1087
|
-
#
|
|
1097
|
+
#k() {
|
|
1088
1098
|
if (!(!this.#i || !this.#t)) {
|
|
1089
1099
|
for (const [e, i] of Object.entries(this.#g))
|
|
1090
1100
|
this.#i.addEventListener(e, i);
|
|
@@ -1092,7 +1102,7 @@ class Mt extends $t {
|
|
|
1092
1102
|
this.#t.on(e, i);
|
|
1093
1103
|
}
|
|
1094
1104
|
}
|
|
1095
|
-
#
|
|
1105
|
+
#L() {
|
|
1096
1106
|
if (!(!this.#i || !this.#t)) {
|
|
1097
1107
|
for (const [e, i] of Object.entries(this.#g))
|
|
1098
1108
|
this.#i.removeEventListener(e, i);
|
|
@@ -1103,8 +1113,8 @@ class Mt extends $t {
|
|
|
1103
1113
|
#s(e, i) {
|
|
1104
1114
|
return super.fire({ type: e, ...i ?? {} });
|
|
1105
1115
|
}
|
|
1106
|
-
#
|
|
1107
|
-
e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(
|
|
1116
|
+
#_(e) {
|
|
1117
|
+
e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(V(e.bbox), 50, this.#h(e));
|
|
1108
1118
|
}
|
|
1109
1119
|
#$({ detail: { features: e, external: i } }) {
|
|
1110
1120
|
if (!e || e.length === 0 || !this.#d || this.#e.flyToFeatures === !1 || this.#e.flyToFeatures === "never" || !i && (this.#e.flyToFeatures === void 0 || this.#e.flyToFeatures === "external"))
|
|
@@ -1113,12 +1123,12 @@ class Mt extends $t {
|
|
|
1113
1123
|
(r, u) => a || !u.matching_text ? [Math.min(r[0], u.bbox[0]), Math.min(r[1], u.bbox[1]), Math.max(r[2], u.bbox[2]), Math.max(r[3], u.bbox[3])] : r,
|
|
1114
1124
|
[180, 90, -180, -90]
|
|
1115
1125
|
), o = e.map((r) => this.#h(r)).filter((r) => r !== void 0).reduce((r, u) => r === void 0 ? u : Math.max(r, u), void 0);
|
|
1116
|
-
this.#b(
|
|
1126
|
+
this.#b(V(s), 50, o);
|
|
1117
1127
|
}
|
|
1118
1128
|
#h(e) {
|
|
1119
1129
|
if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
|
|
1120
1130
|
return;
|
|
1121
|
-
const i = e.id.replace(/\..*/, ""), a = this.#e.zoom ??
|
|
1131
|
+
const i = e.id.replace(/\..*/, ""), a = this.#e.zoom ?? Lt;
|
|
1122
1132
|
return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((s, o) => {
|
|
1123
1133
|
const r = a[i + "." + o];
|
|
1124
1134
|
return s === void 0 ? r : r === void 0 ? s : Math.max(s, r);
|
|
@@ -1130,7 +1140,7 @@ class Mt extends $t {
|
|
|
1130
1140
|
get #I() {
|
|
1131
1141
|
return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
|
|
1132
1142
|
}
|
|
1133
|
-
get #
|
|
1143
|
+
get #F() {
|
|
1134
1144
|
return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
|
|
1135
1145
|
}
|
|
1136
1146
|
#x(e, i) {
|
|
@@ -1142,10 +1152,10 @@ class Mt extends $t {
|
|
|
1142
1152
|
[e[0], e[1]],
|
|
1143
1153
|
[e[2], e[3]]
|
|
1144
1154
|
],
|
|
1145
|
-
{ padding: i, ...a ? { maxZoom: a } : {}, ...this.#
|
|
1155
|
+
{ padding: i, ...a ? { maxZoom: a } : {}, ...this.#F }
|
|
1146
1156
|
);
|
|
1147
1157
|
}
|
|
1148
|
-
#
|
|
1158
|
+
#w(e) {
|
|
1149
1159
|
if (!(this.#e.marker === !1 || this.#e.marker === null || !this.#t)) {
|
|
1150
1160
|
if (!e) {
|
|
1151
1161
|
this.#r?.remove(), this.#r = void 0;
|
|
@@ -1170,7 +1180,7 @@ class Mt extends $t {
|
|
|
1170
1180
|
(o) => o.type === "Polygon" || o.type === "MultiPolygon"
|
|
1171
1181
|
);
|
|
1172
1182
|
if (s.length > 0) {
|
|
1173
|
-
const o =
|
|
1183
|
+
const o = _e(D(s.map((r) => Qe(r))));
|
|
1174
1184
|
if (o) {
|
|
1175
1185
|
const r = we({ ...i, geometry: o.geometry });
|
|
1176
1186
|
r && this.#n(r);
|
|
@@ -1198,7 +1208,7 @@ class Mt extends $t {
|
|
|
1198
1208
|
continue;
|
|
1199
1209
|
} else
|
|
1200
1210
|
o = this.#f(this.#e.showResultMarkers).setLngLat(s.center).setPopup(
|
|
1201
|
-
new
|
|
1211
|
+
new H.Popup({
|
|
1202
1212
|
offset: [1, -27],
|
|
1203
1213
|
closeButton: !1,
|
|
1204
1214
|
closeOnMove: !0,
|
|
@@ -1215,7 +1225,7 @@ class Mt extends $t {
|
|
|
1215
1225
|
}), r.classList.toggle("marker-fuzzy", !!s.matching_text), this.#l.set(s, o);
|
|
1216
1226
|
}
|
|
1217
1227
|
}
|
|
1218
|
-
#
|
|
1228
|
+
#O(e) {
|
|
1219
1229
|
this.#c?.getElement().classList.toggle("marker-selected", !1), this.#c = void 0, this.#e.markerOnSelected !== !1 && (this.#c = this.#l.get(e), this.#c?.getElement().classList.toggle("marker-selected", !0));
|
|
1220
1230
|
}
|
|
1221
1231
|
#u() {
|
|
@@ -1225,43 +1235,43 @@ class Mt extends $t {
|
|
|
1225
1235
|
});
|
|
1226
1236
|
return;
|
|
1227
1237
|
}
|
|
1228
|
-
const e = this.#
|
|
1229
|
-
!e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ??
|
|
1238
|
+
const e = this.#M(), i = this.#t.getSource(W);
|
|
1239
|
+
!e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ?? D([])) : this.#a && this.#t.addSource(W, {
|
|
1230
1240
|
type: "geojson",
|
|
1231
1241
|
data: this.#a
|
|
1232
|
-
}), !this.#t.getLayer(
|
|
1242
|
+
}), !this.#t.getLayer(ke) && e.fill && this.#t.addLayer({
|
|
1233
1243
|
...e.fill,
|
|
1234
|
-
id:
|
|
1244
|
+
id: ke,
|
|
1235
1245
|
type: "fill",
|
|
1236
|
-
source:
|
|
1246
|
+
source: W
|
|
1237
1247
|
}), !this.#t.getLayer(Le) && e.line && this.#t.addLayer({
|
|
1238
1248
|
...e.line,
|
|
1239
1249
|
id: Le,
|
|
1240
1250
|
type: "line",
|
|
1241
|
-
source:
|
|
1251
|
+
source: W
|
|
1242
1252
|
}));
|
|
1243
1253
|
}
|
|
1244
1254
|
#n(e) {
|
|
1245
1255
|
this.#a = e, this.#u();
|
|
1246
1256
|
}
|
|
1247
1257
|
#f(e) {
|
|
1248
|
-
return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new
|
|
1258
|
+
return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new H.Marker(e);
|
|
1249
1259
|
}
|
|
1250
|
-
#
|
|
1260
|
+
#M() {
|
|
1251
1261
|
const { fullGeometryStyle: e } = this.#e;
|
|
1252
|
-
if (e === !0 || e === void 0) return
|
|
1262
|
+
if (e === !0 || e === void 0) return _t;
|
|
1253
1263
|
if (!(e === !1 || e === null))
|
|
1254
1264
|
return e;
|
|
1255
1265
|
}
|
|
1256
1266
|
}
|
|
1257
|
-
class
|
|
1267
|
+
class jt extends $t {
|
|
1258
1268
|
#e;
|
|
1259
1269
|
constructor(e = {}) {
|
|
1260
1270
|
super(e);
|
|
1261
1271
|
}
|
|
1262
1272
|
/** @internal Not to be called directly */
|
|
1263
1273
|
onAdd(e) {
|
|
1264
|
-
this.#e = e, e.telemetry.registerModule(
|
|
1274
|
+
this.#e = e, e.telemetry.registerModule(wt, kt);
|
|
1265
1275
|
const i = this.getOptions(), { primaryLanguage: a, apiKey: s } = e.getSdkConfig();
|
|
1266
1276
|
if (i.apiKey === void 0 && this.setOptions({ apiKey: s }), i.language === void 0) {
|
|
1267
1277
|
const r = a.code?.match(/^([a-z]{2,3})($|_|-)/);
|
|
@@ -1287,19 +1297,19 @@ class Wt extends Mt {
|
|
|
1287
1297
|
}
|
|
1288
1298
|
}
|
|
1289
1299
|
export {
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1300
|
+
_t as DEFAULT_GEOMETRY_STYLE,
|
|
1301
|
+
jt as GeocodingControl,
|
|
1302
|
+
X as MaptilerGeocodeClearIconElement,
|
|
1303
|
+
ee as MaptilerGeocodeFailIconElement,
|
|
1304
|
+
te as MaptilerGeocodeLoadingIconElement,
|
|
1295
1305
|
ne as MaptilerGeocodeMarkerElement,
|
|
1296
|
-
|
|
1297
|
-
|
|
1306
|
+
ie as MaptilerGeocodeReverseGeocodingIconElement,
|
|
1307
|
+
se as MaptilerGeocodeSearchIconElement,
|
|
1298
1308
|
n as MaptilerGeocoderElement,
|
|
1299
|
-
|
|
1300
|
-
|
|
1309
|
+
jt as MaptilerGeocodingControl,
|
|
1310
|
+
ke as RESULT_LAYER_FILL,
|
|
1301
1311
|
Le as RESULT_LAYER_LINE,
|
|
1302
|
-
|
|
1303
|
-
|
|
1312
|
+
W as RESULT_SOURCE,
|
|
1313
|
+
Lt as ZOOM_DEFAULTS
|
|
1304
1314
|
};
|
|
1305
1315
|
//# sourceMappingURL=maptilersdk.js.map
|