@maptiler/geocoding-control 3.0.0-rc.3 → 3.0.0-rc.5
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 +0 -2
- package/dist/index.js +1 -1
- package/dist/index.umd.js +9 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/leaflet.public.js +25 -22
- package/dist/leaflet.public.js.map +1 -1
- package/dist/leaflet.public.umd.js +6 -6
- package/dist/leaflet.public.umd.js.map +1 -1
- package/dist/maplibregl.js +40 -45
- package/dist/maplibregl.js.map +1 -1
- package/dist/maplibregl.umd.js +23 -23
- package/dist/maplibregl.umd.js.map +1 -1
- package/dist/maptilersdk.js +143 -122
- package/dist/maptilersdk.js.map +1 -1
- package/dist/maptilersdk.umd.js +45 -45
- package/dist/maptilersdk.umd.js.map +1 -1
- package/dist/openlayers.public.js +135 -131
- package/dist/openlayers.public.js.map +1 -1
- package/dist/openlayers.public.umd.js +28 -28
- package/dist/openlayers.public.umd.js.map +1 -1
- package/dist/src/controls/base-control.d.ts +4 -0
- package/dist/src/controls/leaflet-control.d.ts +1 -0
- package/dist/src/controls/leaflet-events.d.ts +55 -26
- package/dist/src/controls/maplibregl-control.d.ts +1 -0
- package/dist/src/controls/maplibregl-events.d.ts +54 -25
- package/dist/src/controls/maptilersdk-control.d.ts +17 -0
- package/dist/src/controls/maptilersdk-events.d.ts +72 -2
- package/dist/src/controls/maptilersdk-options.d.ts +10 -0
- package/dist/src/controls/openlayers-control.d.ts +5 -4
- package/dist/src/controls/openlayers-events.d.ts +55 -25
- package/dist/src/geocoder/geocoder-events.d.ts +40 -27
- package/dist/src/geocoder/geocoder-options.d.ts +1 -3
- package/dist/src/leaflet.public.d.ts +1 -1
- package/dist/src/maplibregl.d.ts +1 -1
- package/dist/src/maptilersdk.d.ts +1 -1
- package/dist/src/openlayers.public.d.ts +1 -1
- package/package.json +3 -2
package/dist/maptilersdk.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { css as I, LitElement as
|
|
2
|
-
import { customElement as
|
|
1
|
+
import { css as I, LitElement as O, svg as z, html as m, unsafeCSS as ce, nothing as X } from "lit";
|
|
2
|
+
import { customElement as M, property as p, state as b, query as De } from "lit/decorators.js";
|
|
3
3
|
import { convert as We } from "geo-coordinates-parser";
|
|
4
|
-
import { classMap as
|
|
4
|
+
import { classMap as A } from "lit/directives/class-map.js";
|
|
5
5
|
import { repeat as Ve } from "lit/directives/repeat.js";
|
|
6
6
|
import "@turf/clone";
|
|
7
7
|
import { styleMap as qe } from "lit/directives/style-map.js";
|
|
8
|
-
import {
|
|
8
|
+
import { config as Ne } from "@maptiler/sdk";
|
|
9
|
+
import { featureCollection as q, polygon as Ze, feature as Ke } from "@turf/helpers";
|
|
9
10
|
import Le from "@turf/union";
|
|
10
11
|
import he from "maplibre-gl";
|
|
11
12
|
import be from "@turf/bbox";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
var
|
|
15
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
13
|
+
import Qe from "@turf/difference";
|
|
14
|
+
import Ye from "@turf/flatten";
|
|
15
|
+
var He = Object.getOwnPropertyDescriptor, Je = (t, e, i, o) => {
|
|
16
|
+
for (var r = o > 1 ? void 0 : o ? He(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
16
17
|
(a = t[s]) && (r = a(r) || r);
|
|
17
18
|
return r;
|
|
18
19
|
};
|
|
19
|
-
let ee = class extends
|
|
20
|
+
let ee = class extends O {
|
|
20
21
|
render() {
|
|
21
22
|
return z`
|
|
22
23
|
<svg viewBox="0 0 14 14" width="13" height="13">
|
|
@@ -33,15 +34,15 @@ ee.styles = I`
|
|
|
33
34
|
fill: var(--color-icon-button);
|
|
34
35
|
}
|
|
35
36
|
`;
|
|
36
|
-
ee =
|
|
37
|
-
|
|
37
|
+
ee = Je([
|
|
38
|
+
M("maptiler-geocode-clear-icon")
|
|
38
39
|
], ee);
|
|
39
|
-
var
|
|
40
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
40
|
+
var Xe = Object.getOwnPropertyDescriptor, et = (t, e, i, o) => {
|
|
41
|
+
for (var r = o > 1 ? void 0 : o ? Xe(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
41
42
|
(a = t[s]) && (r = a(r) || r);
|
|
42
43
|
return r;
|
|
43
44
|
};
|
|
44
|
-
let te = class extends
|
|
45
|
+
let te = class extends O {
|
|
45
46
|
render() {
|
|
46
47
|
return z`
|
|
47
48
|
<svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -58,15 +59,15 @@ te.styles = I`
|
|
|
58
59
|
fill: #e15042;
|
|
59
60
|
}
|
|
60
61
|
`;
|
|
61
|
-
te =
|
|
62
|
-
|
|
62
|
+
te = et([
|
|
63
|
+
M("maptiler-geocode-fail-icon")
|
|
63
64
|
], te);
|
|
64
|
-
var
|
|
65
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
65
|
+
var tt = Object.getOwnPropertyDescriptor, it = (t, e, i, o) => {
|
|
66
|
+
for (var r = o > 1 ? void 0 : o ? tt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
66
67
|
(a = t[s]) && (r = a(r) || r);
|
|
67
68
|
return r;
|
|
68
69
|
};
|
|
69
|
-
let ie = class extends
|
|
70
|
+
let ie = class extends O {
|
|
70
71
|
render() {
|
|
71
72
|
return m`
|
|
72
73
|
<div>
|
|
@@ -105,15 +106,15 @@ ie.styles = I`
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
`;
|
|
108
|
-
ie =
|
|
109
|
-
|
|
109
|
+
ie = it([
|
|
110
|
+
M("maptiler-geocode-loading-icon")
|
|
110
111
|
], ie);
|
|
111
|
-
var
|
|
112
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
112
|
+
var st = Object.getOwnPropertyDescriptor, rt = (t, e, i, o) => {
|
|
113
|
+
for (var r = o > 1 ? void 0 : o ? st(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
113
114
|
(a = t[s]) && (r = a(r) || r);
|
|
114
115
|
return r;
|
|
115
116
|
};
|
|
116
|
-
let se = class extends
|
|
117
|
+
let se = class extends O {
|
|
117
118
|
render() {
|
|
118
119
|
return z`
|
|
119
120
|
<svg viewBox="0 0 60.006 21.412" width="14" height="20">
|
|
@@ -130,15 +131,15 @@ se.styles = I`
|
|
|
130
131
|
fill: var(--color-icon-button);
|
|
131
132
|
}
|
|
132
133
|
`;
|
|
133
|
-
se =
|
|
134
|
-
|
|
134
|
+
se = rt([
|
|
135
|
+
M("maptiler-geocode-reverse-geocoding-icon")
|
|
135
136
|
], se);
|
|
136
|
-
var
|
|
137
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
137
|
+
var ot = Object.getOwnPropertyDescriptor, at = (t, e, i, o) => {
|
|
138
|
+
for (var r = o > 1 ? void 0 : o ? ot(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
138
139
|
(a = t[s]) && (r = a(r) || r);
|
|
139
140
|
return r;
|
|
140
141
|
};
|
|
141
|
-
let re = class extends
|
|
142
|
+
let re = class extends O {
|
|
142
143
|
render() {
|
|
143
144
|
return z`
|
|
144
145
|
<svg
|
|
@@ -169,19 +170,19 @@ re.styles = I`
|
|
|
169
170
|
stroke: var(--color-icon-button);
|
|
170
171
|
}
|
|
171
172
|
`;
|
|
172
|
-
re =
|
|
173
|
-
|
|
173
|
+
re = at([
|
|
174
|
+
M("maptiler-geocode-search-icon")
|
|
174
175
|
], re);
|
|
175
|
-
function
|
|
176
|
+
function lt(t, e, i) {
|
|
176
177
|
const o = e[1], r = e[0], s = o - r;
|
|
177
178
|
return t === o && i ? t : ((t - r) % s + s) % s + r;
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function N(t) {
|
|
180
181
|
const e = [...t];
|
|
181
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;
|
|
182
183
|
}
|
|
183
184
|
let U;
|
|
184
|
-
async function
|
|
185
|
+
async function nt(t, e, i) {
|
|
185
186
|
for (const o of e ?? [])
|
|
186
187
|
if (!(t && (o.minZoom != null && o.minZoom > t[0] || o.maxZoom != null && o.maxZoom < t[0]))) {
|
|
187
188
|
if (o.type === "fixed")
|
|
@@ -222,21 +223,21 @@ async function lt(t, e, i) {
|
|
|
222
223
|
return t[1].toFixed(6) + "," + t[2].toFixed(6);
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
|
-
const
|
|
226
|
-
var
|
|
226
|
+
const ct = ".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 ht = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, $e = (t) => {
|
|
227
228
|
throw TypeError(t);
|
|
228
229
|
}, _ = (t, e, i, o) => {
|
|
229
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
230
|
+
for (var r = o > 1 ? void 0 : o ? pt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
230
231
|
(a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
|
|
231
|
-
return o && r &&
|
|
232
|
-
}, Ie = (t, e, i) => e.has(t) || $e("Cannot " + i), u = (t, e, i) => (Ie(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
232
|
+
return o && r && ht(e, i, r), r;
|
|
233
|
+
}, Ie = (t, e, i) => e.has(t) || $e("Cannot " + i), u = (t, e, i) => (Ie(t, e, "read from private field"), i ? i.call(t) : e.get(t)), dt = (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), E = (t, e, i) => (Ie(t, e, "access private method"), i), d, Z, G, g, Oe, Me, pe, oe;
|
|
233
234
|
const Te = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Se = Te ? "@2x" : "", C = Te ? 2 : 1;
|
|
234
|
-
let T, Ce, k = class extends
|
|
235
|
+
let T, Ce, k = class extends O {
|
|
235
236
|
constructor() {
|
|
236
|
-
super(...arguments),
|
|
237
|
+
super(...arguments), dt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
|
|
237
238
|
}
|
|
238
239
|
willUpdate(t) {
|
|
239
|
-
t.has("feature") && u(this, d,
|
|
240
|
+
t.has("feature") && u(this, d, Z) && (this.index = u(this, d, Z).length, E(this, d, pe).call(this));
|
|
240
241
|
}
|
|
241
242
|
render() {
|
|
242
243
|
return m`
|
|
@@ -260,7 +261,7 @@ let T, Ce, k = class extends M {
|
|
|
260
261
|
})}
|
|
261
262
|
title=${u(this, d, g)}
|
|
262
263
|
/>
|
|
263
|
-
` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${u(this, d, g)} @error=${E(this, d,
|
|
264
|
+
` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${u(this, d, g)} @error=${E(this, d, Me)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : u(this, d, G) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> `}
|
|
264
265
|
|
|
265
266
|
<span class="texts">
|
|
266
267
|
<span>
|
|
@@ -276,7 +277,7 @@ let T, Ce, k = class extends M {
|
|
|
276
277
|
}
|
|
277
278
|
};
|
|
278
279
|
d = /* @__PURE__ */ new WeakSet();
|
|
279
|
-
|
|
280
|
+
Z = function() {
|
|
280
281
|
return this.feature?.properties?.categories;
|
|
281
282
|
};
|
|
282
283
|
G = function() {
|
|
@@ -285,30 +286,30 @@ G = function() {
|
|
|
285
286
|
g = function() {
|
|
286
287
|
return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
|
|
287
288
|
};
|
|
288
|
-
|
|
289
|
+
Oe = function() {
|
|
289
290
|
Ce ??= fetch(`${this.iconsBaseUrl}sprite${Se}.json`).then((t) => t.json()).then((t) => {
|
|
290
291
|
T = t;
|
|
291
292
|
}).catch(() => {
|
|
292
293
|
T = null;
|
|
293
294
|
});
|
|
294
295
|
};
|
|
295
|
-
|
|
296
|
+
Me = function() {
|
|
296
297
|
this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, d, pe).call(this);
|
|
297
298
|
};
|
|
298
299
|
pe = function() {
|
|
299
|
-
T !== void 0 ? E(this, d, oe).call(this) : (E(this, d,
|
|
300
|
+
T !== void 0 ? E(this, d, oe).call(this) : (E(this, d, Oe).call(this), Ce?.then(() => {
|
|
300
301
|
E(this, d, oe).call(this);
|
|
301
302
|
}));
|
|
302
303
|
};
|
|
303
304
|
oe = function() {
|
|
304
305
|
do {
|
|
305
|
-
if (this.index--, this.category = u(this, d,
|
|
306
|
+
if (this.index--, this.category = u(this, d, Z)?.[this.index], this.spriteIcon = this.category ? T?.icons[this.category] : void 0, this.spriteIcon)
|
|
306
307
|
break;
|
|
307
308
|
this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
|
|
308
309
|
} while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
|
|
309
310
|
};
|
|
310
311
|
k.styles = I`
|
|
311
|
-
${ce(
|
|
312
|
+
${ce(ct)}
|
|
312
313
|
`;
|
|
313
314
|
_([
|
|
314
315
|
p({ type: Object })
|
|
@@ -338,22 +339,22 @@ _([
|
|
|
338
339
|
b()
|
|
339
340
|
], k.prototype, "index", 2);
|
|
340
341
|
k = _([
|
|
341
|
-
|
|
342
|
+
M("maptiler-geocoder-feature-item")
|
|
342
343
|
], k);
|
|
343
|
-
const
|
|
344
|
-
var
|
|
344
|
+
const ut = "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 ft = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, Fe = (t) => {
|
|
345
346
|
throw TypeError(t);
|
|
346
347
|
}, c = (t, e, i, o) => {
|
|
347
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
348
|
+
for (var r = o > 1 ? void 0 : o ? mt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
348
349
|
(a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
|
|
349
|
-
return o && r &&
|
|
350
|
-
}, de = (t, e, i) => e.has(t) || Fe("Cannot " + i), x = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), F = (t, e, i) => e.has(t) ? Fe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, o) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i),
|
|
351
|
-
let n = class extends
|
|
350
|
+
return o && r && ft(e, i, r), r;
|
|
351
|
+
}, de = (t, e, i) => e.has(t) || Fe("Cannot " + i), x = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), F = (t, e, i) => e.has(t) ? Fe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, o) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), K, V, B, ae, R, l, Q, Ee, Pe, ue, v, fe, Y, me, ge, $, ye, H, Ue, le, Ge, Be, Re, ze, je;
|
|
352
|
+
let n = class extends O {
|
|
352
353
|
constructor() {
|
|
353
|
-
super(...arguments), F(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.focusedDelayed = !1, F(this,
|
|
354
|
+
super(...arguments), F(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.focusedDelayed = !1, F(this, K, !1), F(this, V, !1), F(this, B), F(this, ae, /* @__PURE__ */ new Set()), F(this, R);
|
|
354
355
|
}
|
|
355
356
|
firstUpdated() {
|
|
356
|
-
W(this,
|
|
357
|
+
W(this, K, !0);
|
|
357
358
|
}
|
|
358
359
|
/**
|
|
359
360
|
* Set the options of this instance.
|
|
@@ -363,7 +364,7 @@ let n = class extends M {
|
|
|
363
364
|
setOptions(t) {
|
|
364
365
|
const e = { ...t };
|
|
365
366
|
for (const i of Object.keys(e))
|
|
366
|
-
|
|
367
|
+
gt.includes(i) || delete e[i];
|
|
367
368
|
Object.assign(this, e);
|
|
368
369
|
}
|
|
369
370
|
/**
|
|
@@ -430,7 +431,7 @@ let n = class extends M {
|
|
|
430
431
|
}
|
|
431
432
|
render() {
|
|
432
433
|
return m`
|
|
433
|
-
<form @submit=${h(this, l, fe)} class=${
|
|
434
|
+
<form @submit=${h(this, l, fe)} class=${A({ "can-collapse": this.collapsed && this.searchValue === "" })}>
|
|
434
435
|
<div class="input-group">
|
|
435
436
|
<button
|
|
436
437
|
class="search-button"
|
|
@@ -454,7 +455,7 @@ let n = class extends M {
|
|
|
454
455
|
aria-label=${this.placeholder ?? "Search"}
|
|
455
456
|
/>
|
|
456
457
|
|
|
457
|
-
<div class="clear-button-container ${
|
|
458
|
+
<div class="clear-button-container ${A({ displayable: this.searchValue !== "" })}">
|
|
458
459
|
${x(this, l, Pe) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
|
|
459
460
|
<button type="button" @click=${h(this, l, je)} title=${this.clearButtonTitle ?? "clear"}>
|
|
460
461
|
<maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
|
|
@@ -465,7 +466,7 @@ let n = class extends M {
|
|
|
465
466
|
${this.enableReverse === "button" ? m`
|
|
466
467
|
<button
|
|
467
468
|
type="button"
|
|
468
|
-
class=${
|
|
469
|
+
class=${A({ active: this.reverseActive })}
|
|
469
470
|
title=${this.reverseButtonTitle ?? "toggle reverse geocoding"}
|
|
470
471
|
@click=${() => this.reverseActive = !this.reverseActive}
|
|
471
472
|
>
|
|
@@ -495,7 +496,7 @@ let n = class extends M {
|
|
|
495
496
|
</div>
|
|
496
497
|
</div>
|
|
497
498
|
` : m`
|
|
498
|
-
<ul class="options ${
|
|
499
|
+
<ul class="options ${A({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, l, ze)} @keydown=${h(this, l, le)} role="listbox">
|
|
499
500
|
${Ve(
|
|
500
501
|
this.listFeatures,
|
|
501
502
|
(t) => t.id + (t.address ? "," + t.address : ""),
|
|
@@ -511,7 +512,7 @@ let n = class extends M {
|
|
|
511
512
|
h(this, l, Be).call(this, t);
|
|
512
513
|
}}
|
|
513
514
|
.missingIconsCache=${x(this, ae)}
|
|
514
|
-
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.
|
|
515
|
+
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.5/icons/"}
|
|
515
516
|
>
|
|
516
517
|
${t.place_name}
|
|
517
518
|
</maptiler-geocoder-feature-item>
|
|
@@ -523,7 +524,7 @@ let n = class extends M {
|
|
|
523
524
|
`;
|
|
524
525
|
}
|
|
525
526
|
};
|
|
526
|
-
|
|
527
|
+
K = /* @__PURE__ */ new WeakMap();
|
|
527
528
|
V = /* @__PURE__ */ new WeakMap();
|
|
528
529
|
B = /* @__PURE__ */ new WeakMap();
|
|
529
530
|
ae = /* @__PURE__ */ new WeakMap();
|
|
@@ -542,7 +543,7 @@ ue = function() {
|
|
|
542
543
|
return this.searchValue.length < (this.minLength ?? 2);
|
|
543
544
|
};
|
|
544
545
|
v = function(t, ...[e]) {
|
|
545
|
-
x(this,
|
|
546
|
+
x(this, K) && this.dispatchEvent(
|
|
546
547
|
new CustomEvent(t, {
|
|
547
548
|
bubbles: !0,
|
|
548
549
|
composed: !0,
|
|
@@ -598,19 +599,19 @@ H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
|
|
|
598
599
|
w && (w = [...new Set(w)], f.set("types", w.join(",")));
|
|
599
600
|
const S = !s || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
|
|
600
601
|
if (S && f.set("excludeTypes", String(S)), this.bbox && f.set("bbox", this.bbox.map((y) => y.toFixed(6)).join(",")), this.country && f.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && f.set("worldview", this.worldview), !e && !s) {
|
|
601
|
-
const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await
|
|
602
|
+
const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await nt(x(this, R), y, o);
|
|
602
603
|
xe && f.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && f.set("autocomplete", "false"), f.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
|
|
603
604
|
}
|
|
604
605
|
const ve = this.limit ?? 5, J = this.reverseGeocodingLimit ?? ve;
|
|
605
606
|
J > 1 && w?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), s ? (J === 1 || this.exhaustiveReverseGeocoding || w?.length === 1) && f.set("limit", String(J)) : f.set("limit", String(ve)), this.apiKey && f.set("key", this.apiKey), this.adjustUrl?.(a);
|
|
606
|
-
const
|
|
607
|
+
const Ae = a.searchParams.get("types") === "" && a.searchParams.get("excludeTypes") !== "true", j = a.toString();
|
|
607
608
|
if (j === this.lastSearchUrl) {
|
|
608
609
|
e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, v).call(this, "featureslisted", { features: this.listFeatures }), this.listFeatures[this.selectedItemIndex]?.id !== x(this, l, Q)?.id && (this.selectedItemIndex = -1));
|
|
609
610
|
return;
|
|
610
611
|
}
|
|
611
612
|
h(this, l, v).call(this, "request", { urlObj: a }), this.lastSearchUrl = j;
|
|
612
613
|
let P;
|
|
613
|
-
if (
|
|
614
|
+
if (Ae)
|
|
614
615
|
P = { type: "FeatureCollection", features: [] };
|
|
615
616
|
else {
|
|
616
617
|
const y = await fetch(j, {
|
|
@@ -647,7 +648,7 @@ H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
|
|
|
647
648
|
}
|
|
648
649
|
};
|
|
649
650
|
Ue = function(t) {
|
|
650
|
-
this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${
|
|
651
|
+
this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${lt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, me).call(this);
|
|
651
652
|
};
|
|
652
653
|
le = function(t) {
|
|
653
654
|
if (!this.listFeatures)
|
|
@@ -671,7 +672,7 @@ je = function() {
|
|
|
671
672
|
this.searchValue = "", h(this, l, v).call(this, "queryclear"), this.picked = void 0, this.input.focus();
|
|
672
673
|
};
|
|
673
674
|
n.styles = I`
|
|
674
|
-
${ce(
|
|
675
|
+
${ce(ut)}
|
|
675
676
|
`;
|
|
676
677
|
c([
|
|
677
678
|
p({ attribute: !1 })
|
|
@@ -785,7 +786,7 @@ c([
|
|
|
785
786
|
p({ type: String })
|
|
786
787
|
], n.prototype, "worldview", 2);
|
|
787
788
|
c([
|
|
788
|
-
|
|
789
|
+
De("input")
|
|
789
790
|
], n.prototype, "input", 2);
|
|
790
791
|
c([
|
|
791
792
|
b()
|
|
@@ -818,9 +819,9 @@ c([
|
|
|
818
819
|
b()
|
|
819
820
|
], n.prototype, "focusedDelayed", 2);
|
|
820
821
|
n = c([
|
|
821
|
-
|
|
822
|
+
M("maptiler-geocoder")
|
|
822
823
|
], n);
|
|
823
|
-
const
|
|
824
|
+
const gt = [
|
|
824
825
|
"adjustUrl",
|
|
825
826
|
"apiKey",
|
|
826
827
|
"apiUrl",
|
|
@@ -858,13 +859,13 @@ const mt = [
|
|
|
858
859
|
"types",
|
|
859
860
|
"reverseGeocodingTypes",
|
|
860
861
|
"worldview"
|
|
861
|
-
],
|
|
862
|
-
var
|
|
863
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
862
|
+
], yt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
|
|
863
|
+
var vt = Object.getOwnPropertyDescriptor, xt = (t, e, i, o) => {
|
|
864
|
+
for (var r = o > 1 ? void 0 : o ? vt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
864
865
|
(a = t[s]) && (r = a(r) || r);
|
|
865
866
|
return r;
|
|
866
867
|
};
|
|
867
|
-
let ne = class extends
|
|
868
|
+
let ne = class extends O {
|
|
868
869
|
render() {
|
|
869
870
|
return z`
|
|
870
871
|
<svg
|
|
@@ -881,15 +882,16 @@ let ne = class extends M {
|
|
|
881
882
|
}
|
|
882
883
|
};
|
|
883
884
|
ne.styles = I`
|
|
884
|
-
${ce(
|
|
885
|
+
${ce(yt)}
|
|
885
886
|
`;
|
|
886
|
-
ne =
|
|
887
|
-
|
|
887
|
+
ne = xt([
|
|
888
|
+
M("maptiler-geocode-marker")
|
|
888
889
|
], ne);
|
|
890
|
+
const bt = "@maptiler/geocoding-control", kt = "3.0.0-rc.5";
|
|
889
891
|
function ke(t) {
|
|
890
|
-
const e =
|
|
892
|
+
const e = Qe(
|
|
891
893
|
q([
|
|
892
|
-
|
|
894
|
+
Ze([
|
|
893
895
|
[
|
|
894
896
|
[180, 90],
|
|
895
897
|
[-180, 90],
|
|
@@ -904,10 +906,10 @@ function ke(t) {
|
|
|
904
906
|
if (!e)
|
|
905
907
|
return;
|
|
906
908
|
e.properties = { isMask: !0 };
|
|
907
|
-
const i =
|
|
909
|
+
const i = N(be(t)), o = (i[2] - i[0]) / 360 / 1e3, r = i[0] < -180, s = i[2] > 180, a = Ye(t);
|
|
908
910
|
if (a.features.length > 1 && (r || s))
|
|
909
911
|
for (const f of a.features) {
|
|
910
|
-
const L =
|
|
912
|
+
const L = N(be(f));
|
|
911
913
|
if (s && L[0] < -180 + o)
|
|
912
914
|
for (const w of f.geometry.coordinates)
|
|
913
915
|
for (const S of w)
|
|
@@ -919,7 +921,7 @@ function ke(t) {
|
|
|
919
921
|
}
|
|
920
922
|
return q([a.features.length < 2 ? t : Le(a) ?? t, e]);
|
|
921
923
|
}
|
|
922
|
-
const
|
|
924
|
+
const wt = {
|
|
923
925
|
continental_marine: 4,
|
|
924
926
|
country: 4,
|
|
925
927
|
major_landform: 8,
|
|
@@ -943,7 +945,7 @@ const xt = {
|
|
|
943
945
|
"poi.restaurant": 18,
|
|
944
946
|
"poi.aerodrome": 13
|
|
945
947
|
// TODO add many more
|
|
946
|
-
},
|
|
948
|
+
}, _t = {
|
|
947
949
|
fill: {
|
|
948
950
|
paint: {
|
|
949
951
|
"fill-color": "#000",
|
|
@@ -962,25 +964,17 @@ const xt = {
|
|
|
962
964
|
},
|
|
963
965
|
filter: ["!", ["has", "isMask"]]
|
|
964
966
|
}
|
|
965
|
-
},
|
|
966
|
-
class
|
|
967
|
-
#e;
|
|
967
|
+
}, D = "mtlr-gc-full-geom", we = "mtlr-gc-full-geom-fill", _e = "mtlr-gc-full-geom-line", Lt = he.Evented, $t = he.Marker, It = he.Popup;
|
|
968
|
+
class Ot extends Lt {
|
|
969
|
+
#e = {};
|
|
968
970
|
#t;
|
|
969
971
|
#i;
|
|
970
972
|
constructor(e = {}) {
|
|
971
|
-
super(), this
|
|
973
|
+
super(), this.setOptions(e);
|
|
972
974
|
}
|
|
973
975
|
/** @internal Not to be called directly */
|
|
974
976
|
onAdd(e) {
|
|
975
|
-
|
|
976
|
-
const { primaryLanguage: o, apiKey: r } = e.getSdkConfig();
|
|
977
|
-
if (this.#e.apiKey === void 0 && (this.#e.apiKey = r), this.#e.language === void 0) {
|
|
978
|
-
const s = o.code?.match(/^([a-z]{2,3})($|_|-)/);
|
|
979
|
-
s && (this.#e.language = s[1]);
|
|
980
|
-
}
|
|
981
|
-
this.#i.classList.add("maptiler-geocoder");
|
|
982
|
-
}
|
|
983
|
-
this.#v(), this.#w();
|
|
977
|
+
this.#t = e, this.#i = e._container.ownerDocument.createElement("maptiler-geocoder"), this.#i.classList.add("maplibregl-geocoder"), this.#v(), this.#w();
|
|
984
978
|
const i = e._container.ownerDocument.createElement("div");
|
|
985
979
|
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;
|
|
986
980
|
}
|
|
@@ -988,6 +982,9 @@ class Lt extends kt {
|
|
|
988
982
|
onRemove() {
|
|
989
983
|
this.#_(), this.#t = void 0, this.#i = void 0;
|
|
990
984
|
}
|
|
985
|
+
getOptions() {
|
|
986
|
+
return { ...this.#e };
|
|
987
|
+
}
|
|
991
988
|
setOptions(e) {
|
|
992
989
|
Object.assign(this.#e, e), this.#v();
|
|
993
990
|
}
|
|
@@ -1044,7 +1041,7 @@ class Lt extends kt {
|
|
|
1044
1041
|
},
|
|
1045
1042
|
select: (e) => {
|
|
1046
1043
|
const i = e.detail.feature;
|
|
1047
|
-
i && this.#d && this.#e.flyToSelected && this.#x(i.center, this.#h(i)), this.#o && i && this.#
|
|
1044
|
+
i && this.#d && this.#e.flyToSelected && this.#x(i.center, this.#h(i)), this.#o && i && this.#M(i), this.#s("select", e.detail);
|
|
1048
1045
|
},
|
|
1049
1046
|
pick: (e) => {
|
|
1050
1047
|
const i = e.detail.feature;
|
|
@@ -1107,7 +1104,7 @@ class Lt extends kt {
|
|
|
1107
1104
|
return super.fire({ type: e, ...i ?? {} });
|
|
1108
1105
|
}
|
|
1109
1106
|
#L(e) {
|
|
1110
|
-
e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(
|
|
1107
|
+
e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(N(e.bbox), 50, this.#h(e));
|
|
1111
1108
|
}
|
|
1112
1109
|
#$(e) {
|
|
1113
1110
|
if (!e || e.length === 0 || !this.#d) return;
|
|
@@ -1115,12 +1112,12 @@ class Lt extends kt {
|
|
|
1115
1112
|
(s, a) => i || !a.matching_text ? [Math.min(s[0], a.bbox[0]), Math.min(s[1], a.bbox[1]), Math.max(s[2], a.bbox[2]), Math.max(s[3], a.bbox[3])] : s,
|
|
1116
1113
|
[180, 90, -180, -90]
|
|
1117
1114
|
), r = e.map((s) => this.#h(s)).filter((s) => s !== void 0).reduce((s, a) => s === void 0 ? a : Math.max(s, a), void 0);
|
|
1118
|
-
this.#b(
|
|
1115
|
+
this.#b(N(o), 50, r);
|
|
1119
1116
|
}
|
|
1120
1117
|
#h(e) {
|
|
1121
1118
|
if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
|
|
1122
1119
|
return;
|
|
1123
|
-
const i = e.id.replace(/\..*/, ""), o = this.#e.zoom ??
|
|
1120
|
+
const i = e.id.replace(/\..*/, ""), o = this.#e.zoom ?? wt;
|
|
1124
1121
|
return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((r, s) => {
|
|
1125
1122
|
const a = o[i + "." + s];
|
|
1126
1123
|
return r === void 0 ? a : a === void 0 ? r : Math.max(r, a);
|
|
@@ -1132,7 +1129,7 @@ class Lt extends kt {
|
|
|
1132
1129
|
get #I() {
|
|
1133
1130
|
return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
|
|
1134
1131
|
}
|
|
1135
|
-
get #
|
|
1132
|
+
get #O() {
|
|
1136
1133
|
return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
|
|
1137
1134
|
}
|
|
1138
1135
|
#x(e, i) {
|
|
@@ -1144,7 +1141,7 @@ class Lt extends kt {
|
|
|
1144
1141
|
[e[0], e[1]],
|
|
1145
1142
|
[e[2], e[3]]
|
|
1146
1143
|
],
|
|
1147
|
-
{ padding: i, ...o ? { maxZoom: o } : {}, ...this.#
|
|
1144
|
+
{ padding: i, ...o ? { maxZoom: o } : {}, ...this.#O }
|
|
1148
1145
|
);
|
|
1149
1146
|
}
|
|
1150
1147
|
#k(e) {
|
|
@@ -1172,7 +1169,7 @@ class Lt extends kt {
|
|
|
1172
1169
|
(s) => s.type === "Polygon" || s.type === "MultiPolygon"
|
|
1173
1170
|
);
|
|
1174
1171
|
if (r.length > 0) {
|
|
1175
|
-
const s = Le(q(r.map((a) =>
|
|
1172
|
+
const s = Le(q(r.map((a) => Ke(a))));
|
|
1176
1173
|
if (s) {
|
|
1177
1174
|
const a = ke({ ...i, geometry: s.geometry });
|
|
1178
1175
|
a && this.#n(a);
|
|
@@ -1200,7 +1197,7 @@ class Lt extends kt {
|
|
|
1200
1197
|
continue;
|
|
1201
1198
|
} else
|
|
1202
1199
|
s = this.#f(this.#e.showResultMarkers).setLngLat(r.center).setPopup(
|
|
1203
|
-
new
|
|
1200
|
+
new It({
|
|
1204
1201
|
offset: [1, -27],
|
|
1205
1202
|
closeButton: !1,
|
|
1206
1203
|
closeOnMove: !0,
|
|
@@ -1217,7 +1214,7 @@ class Lt extends kt {
|
|
|
1217
1214
|
}), a.classList.toggle("marker-fuzzy", !!r.matching_text), this.#l.set(r, s);
|
|
1218
1215
|
}
|
|
1219
1216
|
}
|
|
1220
|
-
#
|
|
1217
|
+
#M(e) {
|
|
1221
1218
|
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));
|
|
1222
1219
|
}
|
|
1223
1220
|
#u() {
|
|
@@ -1227,46 +1224,70 @@ class Lt extends kt {
|
|
|
1227
1224
|
});
|
|
1228
1225
|
return;
|
|
1229
1226
|
}
|
|
1230
|
-
const e = this.#T(), i = this.#t.getSource(
|
|
1231
|
-
!e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ?? q([])) : this.#a && this.#t.addSource(
|
|
1227
|
+
const e = this.#T(), i = this.#t.getSource(D);
|
|
1228
|
+
!e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ?? q([])) : this.#a && this.#t.addSource(D, {
|
|
1232
1229
|
type: "geojson",
|
|
1233
1230
|
data: this.#a
|
|
1234
1231
|
}), !this.#t.getLayer(we) && e.fill && this.#t.addLayer({
|
|
1235
1232
|
...e.fill,
|
|
1236
1233
|
id: we,
|
|
1237
1234
|
type: "fill",
|
|
1238
|
-
source:
|
|
1235
|
+
source: D
|
|
1239
1236
|
}), !this.#t.getLayer(_e) && e.line && this.#t.addLayer({
|
|
1240
1237
|
...e.line,
|
|
1241
1238
|
id: _e,
|
|
1242
1239
|
type: "line",
|
|
1243
|
-
source:
|
|
1240
|
+
source: D
|
|
1244
1241
|
}));
|
|
1245
1242
|
}
|
|
1246
1243
|
#n(e) {
|
|
1247
1244
|
this.#a = e, this.#u();
|
|
1248
1245
|
}
|
|
1249
1246
|
#f(e) {
|
|
1250
|
-
return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new
|
|
1247
|
+
return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new $t(e);
|
|
1251
1248
|
}
|
|
1252
1249
|
#T() {
|
|
1253
1250
|
const { fullGeometryStyle: e } = this.#e;
|
|
1254
|
-
if (e === !0 || e === void 0) return
|
|
1251
|
+
if (e === !0 || e === void 0) return _t;
|
|
1255
1252
|
if (!(e === !1 || e === null))
|
|
1256
1253
|
return e;
|
|
1257
1254
|
}
|
|
1258
1255
|
}
|
|
1259
|
-
class
|
|
1256
|
+
class Dt extends Ot {
|
|
1257
|
+
#e;
|
|
1260
1258
|
constructor(e = {}) {
|
|
1261
1259
|
super(e);
|
|
1262
1260
|
}
|
|
1261
|
+
/** @internal Not to be called directly */
|
|
1262
|
+
onAdd(e) {
|
|
1263
|
+
this.#e = e, e.telemetry.registerModule(bt, kt);
|
|
1264
|
+
const i = this.getOptions(), { primaryLanguage: o, apiKey: r } = e.getSdkConfig();
|
|
1265
|
+
if (i.apiKey === void 0 && this.setOptions({ apiKey: r }), i.language === void 0) {
|
|
1266
|
+
const a = o.code?.match(/^([a-z]{2,3})($|_|-)/);
|
|
1267
|
+
a && this.setOptions({ language: a[1] });
|
|
1268
|
+
}
|
|
1269
|
+
const s = super.onAdd(e);
|
|
1270
|
+
return s.classList.add("maptiler-ctrl-geocoder"), s.querySelector("maptiler-geocoder")?.classList.add("maptiler-geocoder"), s;
|
|
1271
|
+
}
|
|
1272
|
+
/** @internal Not to be called directly */
|
|
1273
|
+
onRemove() {
|
|
1274
|
+
super.onRemove(), this.#e = void 0;
|
|
1275
|
+
}
|
|
1263
1276
|
setOptions(e) {
|
|
1264
|
-
|
|
1277
|
+
const i = e.adjustUrl;
|
|
1278
|
+
super.setOptions({
|
|
1279
|
+
...e,
|
|
1280
|
+
adjustUrl: (o) => {
|
|
1281
|
+
i?.(o);
|
|
1282
|
+
const r = this.getOptions();
|
|
1283
|
+
(Ne.session ? e.session !== !1 : e.session === !0) && this.#e && (!r.apiUrl || new URL(r.apiUrl).host === new URL("https://api.maptiler.com/geocoding").host) && o.searchParams.append("mtsid", this.#e.getMaptilerSessionId());
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1265
1286
|
}
|
|
1266
1287
|
}
|
|
1267
1288
|
export {
|
|
1268
|
-
|
|
1269
|
-
|
|
1289
|
+
_t as DEFAULT_GEOMETRY_STYLE,
|
|
1290
|
+
Dt as GeocodingControl,
|
|
1270
1291
|
ee as MaptilerGeocodeClearIconElement,
|
|
1271
1292
|
te as MaptilerGeocodeFailIconElement,
|
|
1272
1293
|
ie as MaptilerGeocodeLoadingIconElement,
|
|
@@ -1274,10 +1295,10 @@ export {
|
|
|
1274
1295
|
se as MaptilerGeocodeReverseGeocodingIconElement,
|
|
1275
1296
|
re as MaptilerGeocodeSearchIconElement,
|
|
1276
1297
|
n as MaptilerGeocoderElement,
|
|
1277
|
-
|
|
1298
|
+
Dt as MaptilerGeocodingControl,
|
|
1278
1299
|
we as RESULT_LAYER_FILL,
|
|
1279
1300
|
_e as RESULT_LAYER_LINE,
|
|
1280
|
-
|
|
1281
|
-
|
|
1301
|
+
D as RESULT_SOURCE,
|
|
1302
|
+
wt as ZOOM_DEFAULTS
|
|
1282
1303
|
};
|
|
1283
1304
|
//# sourceMappingURL=maptilersdk.js.map
|