@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/leaflet.public.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css as I, LitElement as M, svg as R, html as m, unsafeCSS as ce, nothing as J } from "lit";
|
|
2
|
-
import { customElement as
|
|
2
|
+
import { customElement as O, property as p, state as b, query as Ae } from "lit/decorators.js";
|
|
3
3
|
import { convert as We } from "geo-coordinates-parser";
|
|
4
4
|
import { classMap as A } from "lit/directives/class-map.js";
|
|
5
5
|
import { repeat as Ve } from "lit/directives/repeat.js";
|
|
@@ -34,7 +34,7 @@ ee.styles = I`
|
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
36
|
ee = ot([
|
|
37
|
-
|
|
37
|
+
O("maptiler-geocode-clear-icon")
|
|
38
38
|
], ee);
|
|
39
39
|
var rt = Object.getOwnPropertyDescriptor, at = (t, e, i, r) => {
|
|
40
40
|
for (var o = r > 1 ? void 0 : r ? rt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
@@ -59,7 +59,7 @@ te.styles = I`
|
|
|
59
59
|
}
|
|
60
60
|
`;
|
|
61
61
|
te = at([
|
|
62
|
-
|
|
62
|
+
O("maptiler-geocode-fail-icon")
|
|
63
63
|
], te);
|
|
64
64
|
var nt = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
|
|
65
65
|
for (var o = r > 1 ? void 0 : r ? nt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
@@ -106,7 +106,7 @@ ie.styles = I`
|
|
|
106
106
|
}
|
|
107
107
|
`;
|
|
108
108
|
ie = lt([
|
|
109
|
-
|
|
109
|
+
O("maptiler-geocode-loading-icon")
|
|
110
110
|
], ie);
|
|
111
111
|
var ct = Object.getOwnPropertyDescriptor, ht = (t, e, i, r) => {
|
|
112
112
|
for (var o = r > 1 ? void 0 : r ? ct(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
@@ -131,7 +131,7 @@ se.styles = I`
|
|
|
131
131
|
}
|
|
132
132
|
`;
|
|
133
133
|
se = ht([
|
|
134
|
-
|
|
134
|
+
O("maptiler-geocode-reverse-geocoding-icon")
|
|
135
135
|
], se);
|
|
136
136
|
var pt = Object.getOwnPropertyDescriptor, dt = (t, e, i, r) => {
|
|
137
137
|
for (var o = r > 1 ? void 0 : r ? pt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
|
|
@@ -170,7 +170,7 @@ oe.styles = I`
|
|
|
170
170
|
}
|
|
171
171
|
`;
|
|
172
172
|
oe = dt([
|
|
173
|
-
|
|
173
|
+
O("maptiler-geocode-search-icon")
|
|
174
174
|
], oe);
|
|
175
175
|
function ut(t, e, i) {
|
|
176
176
|
const r = e[1], o = e[0], s = r - o;
|
|
@@ -245,8 +245,8 @@ var gt = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, $e = (t) =
|
|
|
245
245
|
(a = t[s]) && (o = (r ? a(e, i, o) : a(o)) || o);
|
|
246
246
|
return r && o && gt(e, i, o), o;
|
|
247
247
|
}, Le = (t, e, i) => e.has(t) || $e("Cannot " + i), f = (t, e, i) => (Le(t, e, "read from private field"), i ? i.call(t) : e.get(t)), vt = (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) => (Le(t, e, "access private method"), i), d, N, G, g, Ie, Me, he, re;
|
|
248
|
-
const
|
|
249
|
-
let
|
|
248
|
+
const Oe = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Ce = Oe ? "@2x" : "", F = Oe ? 2 : 1;
|
|
249
|
+
let C, Te, _ = class extends M {
|
|
250
250
|
constructor() {
|
|
251
251
|
super(...arguments), vt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
|
|
252
252
|
}
|
|
@@ -263,15 +263,15 @@ let O, Te, _ = class extends M {
|
|
|
263
263
|
class=${this.itemStyle}
|
|
264
264
|
@click=${() => this.dispatchEvent(new CustomEvent("select"))}
|
|
265
265
|
>
|
|
266
|
-
${
|
|
266
|
+
${C && this.spriteIcon ? m`
|
|
267
267
|
<div
|
|
268
268
|
class="sprite-icon"
|
|
269
269
|
style=${Ne({
|
|
270
270
|
width: `${this.spriteIcon.width / F}px`,
|
|
271
271
|
height: `${this.spriteIcon.height / F}px`,
|
|
272
|
-
backgroundImage: `url(${this.iconsBaseUrl}sprite${
|
|
272
|
+
backgroundImage: `url(${this.iconsBaseUrl}sprite${Ce}.png)`,
|
|
273
273
|
backgroundPosition: `-${this.spriteIcon.x / F}px -${this.spriteIcon.y / F}px`,
|
|
274
|
-
backgroundSize: `${
|
|
274
|
+
backgroundSize: `${C.width / F}px ${C.height / F}px`
|
|
275
275
|
})}
|
|
276
276
|
title=${f(this, d, g)}
|
|
277
277
|
/>
|
|
@@ -301,23 +301,23 @@ g = function() {
|
|
|
301
301
|
return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
|
|
302
302
|
};
|
|
303
303
|
Ie = function() {
|
|
304
|
-
Te ??= fetch(`${this.iconsBaseUrl}sprite${
|
|
305
|
-
|
|
304
|
+
Te ??= fetch(`${this.iconsBaseUrl}sprite${Ce}.json`).then((t) => t.json()).then((t) => {
|
|
305
|
+
C = t;
|
|
306
306
|
}).catch(() => {
|
|
307
|
-
|
|
307
|
+
C = null;
|
|
308
308
|
});
|
|
309
309
|
};
|
|
310
310
|
Me = function() {
|
|
311
311
|
this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, d, he).call(this);
|
|
312
312
|
};
|
|
313
313
|
he = function() {
|
|
314
|
-
|
|
314
|
+
C !== void 0 ? E(this, d, re).call(this) : (E(this, d, Ie).call(this), Te?.then(() => {
|
|
315
315
|
E(this, d, re).call(this);
|
|
316
316
|
}));
|
|
317
317
|
};
|
|
318
318
|
re = function() {
|
|
319
319
|
do {
|
|
320
|
-
if (this.index--, this.category = f(this, d, N)?.[this.index], this.spriteIcon = this.category ?
|
|
320
|
+
if (this.index--, this.category = f(this, d, N)?.[this.index], this.spriteIcon = this.category ? C?.icons[this.category] : void 0, this.spriteIcon)
|
|
321
321
|
break;
|
|
322
322
|
this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
|
|
323
323
|
} while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
|
|
@@ -353,7 +353,7 @@ $([
|
|
|
353
353
|
b()
|
|
354
354
|
], _.prototype, "index", 2);
|
|
355
355
|
_ = $([
|
|
356
|
-
|
|
356
|
+
O("maptiler-geocoder-feature-item")
|
|
357
357
|
], _);
|
|
358
358
|
const xt = "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}";
|
|
359
359
|
var bt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Fe = (t) => {
|
|
@@ -526,7 +526,7 @@ let l = class extends M {
|
|
|
526
526
|
h(this, n, Ge).call(this, t);
|
|
527
527
|
}}
|
|
528
528
|
.missingIconsCache=${x(this, ae)}
|
|
529
|
-
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.
|
|
529
|
+
.iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.5/icons/"}
|
|
530
530
|
>
|
|
531
531
|
${t.place_name}
|
|
532
532
|
</maptiler-geocoder-feature-item>
|
|
@@ -833,7 +833,7 @@ c([
|
|
|
833
833
|
b()
|
|
834
834
|
], l.prototype, "focusedDelayed", 2);
|
|
835
835
|
l = c([
|
|
836
|
-
|
|
836
|
+
O("maptiler-geocoder")
|
|
837
837
|
], l);
|
|
838
838
|
const kt = [
|
|
839
839
|
"adjustUrl",
|
|
@@ -899,7 +899,7 @@ le.styles = I`
|
|
|
899
899
|
${ce(_t)}
|
|
900
900
|
`;
|
|
901
901
|
le = Lt([
|
|
902
|
-
|
|
902
|
+
O("maptiler-geocode-marker")
|
|
903
903
|
], le);
|
|
904
904
|
function ke(t) {
|
|
905
905
|
const e = tt(
|
|
@@ -988,6 +988,9 @@ class jt extends Re {
|
|
|
988
988
|
onRemove() {
|
|
989
989
|
this.#b(), this.#M(), this.#e = void 0, this.#t = void 0;
|
|
990
990
|
}
|
|
991
|
+
getOptions() {
|
|
992
|
+
return { ...this.options };
|
|
993
|
+
}
|
|
991
994
|
setOptions(e) {
|
|
992
995
|
Object.assign(this.options, e), this.#m();
|
|
993
996
|
}
|
|
@@ -1218,7 +1221,7 @@ class jt extends Re {
|
|
|
1218
1221
|
}
|
|
1219
1222
|
#I() {
|
|
1220
1223
|
this.#e && (this.#s = new Je(void 0, {
|
|
1221
|
-
style: this.#
|
|
1224
|
+
style: this.#O(),
|
|
1222
1225
|
interactive: !1
|
|
1223
1226
|
}).addTo(this.#e));
|
|
1224
1227
|
}
|
|
@@ -1228,7 +1231,7 @@ class jt extends Re {
|
|
|
1228
1231
|
#p(e, i) {
|
|
1229
1232
|
return typeof i != "object" && (i = { icon: new Xe({ html: this.#e?.getContainer().ownerDocument.createElement("maptiler-geocode-marker"), iconAnchor: [12.3, 30], className: "" }) }), new et(e, i);
|
|
1230
1233
|
}
|
|
1231
|
-
#
|
|
1234
|
+
#O() {
|
|
1232
1235
|
const { fullGeometryStyle: e } = this.options;
|
|
1233
1236
|
if (e === !0 || e === void 0) return Mt;
|
|
1234
1237
|
if (!(e === !1 || e === null))
|