@maptiler/geocoding-control 3.0.0-rc.4 → 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.
@@ -1,5 +1,5 @@
1
1
  import { css as M, LitElement as S, svg as A, html as m, unsafeCSS as he, nothing as ee } from "lit";
2
- import { customElement as F, property as d, state as b, query as qe } from "lit/decorators.js";
2
+ import { customElement as O, property as d, state as b, query as qe } from "lit/decorators.js";
3
3
  import { convert as Ze } from "geo-coordinates-parser";
4
4
  import { classMap as V } from "lit/directives/class-map.js";
5
5
  import { repeat as Ne } from "lit/directives/repeat.js";
@@ -7,22 +7,23 @@ import "@turf/clone";
7
7
  import { styleMap as Qe } from "lit/directives/style-map.js";
8
8
  import { Feature as $ } from "ol";
9
9
  import { Control as Ke } from "ol/control";
10
- import { Point as X, Polygon as be, MultiPolygon as we, GeometryCollection as Ye, LineString as ke, MultiLineString as _e } from "ol/geom";
11
- import He from "ol/layer/Vector";
12
- import { transformExtent as Je, getUserProjection as Xe, fromLonLat as et, toLonLat as tt } from "ol/proj";
13
- import it from "ol/source/Vector";
10
+ import Ye from "ol/events/Event";
11
+ import { Point as X, Polygon as be, MultiPolygon as we, GeometryCollection as He, LineString as ke, MultiLineString as _e } from "ol/geom";
12
+ import Je from "ol/layer/Vector";
13
+ import { transformExtent as Xe, getUserProjection as et, fromLonLat as tt, toLonLat as it } from "ol/proj";
14
+ import st from "ol/source/Vector";
14
15
  import $e from "@turf/bbox";
15
- import st from "@turf/difference";
16
- import rt from "@turf/flatten";
17
- import { featureCollection as Le, polygon as ot } from "@turf/helpers";
18
- import at from "@turf/union";
16
+ import rt from "@turf/difference";
17
+ import ot from "@turf/flatten";
18
+ import { featureCollection as Le, polygon as at } from "@turf/helpers";
19
+ import nt from "@turf/union";
19
20
  import Ie from "ol/style/Fill";
20
- import nt from "ol/style/Icon";
21
+ import lt from "ol/style/Icon";
21
22
  import Me from "ol/style/Stroke";
22
- import lt from "ol/style/Style";
23
- import ct from "ol/style/Text";
24
- var ht = Object.getOwnPropertyDescriptor, dt = (t, e, i, o) => {
25
- for (var r = o > 1 ? void 0 : o ? ht(e, i) : e, s = t.length - 1, a; s >= 0; s--)
23
+ import ct from "ol/style/Style";
24
+ import ht from "ol/style/Text";
25
+ var dt = Object.getOwnPropertyDescriptor, pt = (t, e, i, o) => {
26
+ for (var r = o > 1 ? void 0 : o ? dt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
26
27
  (a = t[s]) && (r = a(r) || r);
27
28
  return r;
28
29
  };
@@ -43,11 +44,11 @@ te.styles = M`
43
44
  fill: var(--color-icon-button);
44
45
  }
45
46
  `;
46
- te = dt([
47
- F("maptiler-geocode-clear-icon")
47
+ te = pt([
48
+ O("maptiler-geocode-clear-icon")
48
49
  ], te);
49
- var pt = Object.getOwnPropertyDescriptor, ut = (t, e, i, o) => {
50
- for (var r = o > 1 ? void 0 : o ? pt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
50
+ var ut = Object.getOwnPropertyDescriptor, ft = (t, e, i, o) => {
51
+ for (var r = o > 1 ? void 0 : o ? ut(e, i) : e, s = t.length - 1, a; s >= 0; s--)
51
52
  (a = t[s]) && (r = a(r) || r);
52
53
  return r;
53
54
  };
@@ -68,11 +69,11 @@ ie.styles = M`
68
69
  fill: #e15042;
69
70
  }
70
71
  `;
71
- ie = ut([
72
- F("maptiler-geocode-fail-icon")
72
+ ie = ft([
73
+ O("maptiler-geocode-fail-icon")
73
74
  ], ie);
74
- var ft = Object.getOwnPropertyDescriptor, mt = (t, e, i, o) => {
75
- for (var r = o > 1 ? void 0 : o ? ft(e, i) : e, s = t.length - 1, a; s >= 0; s--)
75
+ var mt = Object.getOwnPropertyDescriptor, gt = (t, e, i, o) => {
76
+ for (var r = o > 1 ? void 0 : o ? mt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
76
77
  (a = t[s]) && (r = a(r) || r);
77
78
  return r;
78
79
  };
@@ -115,11 +116,11 @@ se.styles = M`
115
116
  }
116
117
  }
117
118
  `;
118
- se = mt([
119
- F("maptiler-geocode-loading-icon")
119
+ se = gt([
120
+ O("maptiler-geocode-loading-icon")
120
121
  ], se);
121
- var gt = Object.getOwnPropertyDescriptor, yt = (t, e, i, o) => {
122
- for (var r = o > 1 ? void 0 : o ? gt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
122
+ var yt = Object.getOwnPropertyDescriptor, vt = (t, e, i, o) => {
123
+ for (var r = o > 1 ? void 0 : o ? yt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
123
124
  (a = t[s]) && (r = a(r) || r);
124
125
  return r;
125
126
  };
@@ -140,11 +141,11 @@ re.styles = M`
140
141
  fill: var(--color-icon-button);
141
142
  }
142
143
  `;
143
- re = yt([
144
- F("maptiler-geocode-reverse-geocoding-icon")
144
+ re = vt([
145
+ O("maptiler-geocode-reverse-geocoding-icon")
145
146
  ], re);
146
- var vt = Object.getOwnPropertyDescriptor, xt = (t, e, i, o) => {
147
- for (var r = o > 1 ? void 0 : o ? vt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
147
+ var xt = Object.getOwnPropertyDescriptor, bt = (t, e, i, o) => {
148
+ for (var r = o > 1 ? void 0 : o ? xt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
148
149
  (a = t[s]) && (r = a(r) || r);
149
150
  return r;
150
151
  };
@@ -179,10 +180,10 @@ oe.styles = M`
179
180
  stroke: var(--color-icon-button);
180
181
  }
181
182
  `;
182
- oe = xt([
183
- F("maptiler-geocode-search-icon")
183
+ oe = bt([
184
+ O("maptiler-geocode-search-icon")
184
185
  ], oe);
185
- function bt(t, e, i) {
186
+ function wt(t, e, i) {
186
187
  const o = e[1], r = e[0], s = o - r;
187
188
  return t === o && i ? t : ((t - r) % s + s) % s + r;
188
189
  }
@@ -191,7 +192,7 @@ function Z(t) {
191
192
  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;
192
193
  }
193
194
  let G;
194
- async function wt(t, e, i) {
195
+ async function kt(t, e, i) {
195
196
  for (const o of e ?? [])
196
197
  if (!(t && (o.minZoom != null && o.minZoom > t[0] || o.maxZoom != null && o.maxZoom < t[0]))) {
197
198
  if (o.type === "fixed")
@@ -232,18 +233,18 @@ async function wt(t, e, i) {
232
233
  return t[1].toFixed(6) + "," + t[2].toFixed(6);
233
234
  }
234
235
  }
235
- const kt = ".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)}}";
236
- var _t = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, Se = (t) => {
236
+ const _t = ".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)}}";
237
+ var $t = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Se = (t) => {
237
238
  throw TypeError(t);
238
239
  }, _ = (t, e, i, o) => {
239
- for (var r = o > 1 ? void 0 : o ? $t(e, i) : e, s = t.length - 1, a; s >= 0; s--)
240
+ for (var r = o > 1 ? void 0 : o ? Lt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
240
241
  (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
241
- return o && r && _t(e, i, r), r;
242
- }, Fe = (t, e, i) => e.has(t) || Se("Cannot " + i), u = (t, e, i) => (Fe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Lt = (t, e, i) => e.has(t) ? Se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), U = (t, e, i) => (Fe(t, e, "access private method"), i), p, N, z, g, Oe, Ce, de, ae;
242
+ return o && r && $t(e, i, r), r;
243
+ }, Oe = (t, e, i) => e.has(t) || Se("Cannot " + i), u = (t, e, i) => (Oe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), It = (t, e, i) => e.has(t) ? Se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), U = (t, e, i) => (Oe(t, e, "access private method"), i), p, N, z, g, Fe, Ce, de, ae;
243
244
  const Te = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Pe = Te ? "@2x" : "", P = Te ? 2 : 1;
244
245
  let C, Ee, w = class extends S {
245
246
  constructor() {
246
- super(...arguments), Lt(this, p), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
247
+ super(...arguments), It(this, p), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
247
248
  }
248
249
  willUpdate(t) {
249
250
  t.has("feature") && u(this, p, N) && (this.index = u(this, p, N).length, U(this, p, de).call(this));
@@ -295,7 +296,7 @@ z = function() {
295
296
  g = function() {
296
297
  return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
297
298
  };
298
- Oe = function() {
299
+ Fe = function() {
299
300
  Ee ??= fetch(`${this.iconsBaseUrl}sprite${Pe}.json`).then((t) => t.json()).then((t) => {
300
301
  C = t;
301
302
  }).catch(() => {
@@ -306,7 +307,7 @@ Ce = function() {
306
307
  this.imageUrl && this.missingIconsCache.add(this.imageUrl), U(this, p, de).call(this);
307
308
  };
308
309
  de = function() {
309
- C !== void 0 ? U(this, p, ae).call(this) : (U(this, p, Oe).call(this), Ee?.then(() => {
310
+ C !== void 0 ? U(this, p, ae).call(this) : (U(this, p, Fe).call(this), Ee?.then(() => {
310
311
  U(this, p, ae).call(this);
311
312
  }));
312
313
  };
@@ -318,7 +319,7 @@ ae = function() {
318
319
  } while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
319
320
  };
320
321
  w.styles = M`
321
- ${he(kt)}
322
+ ${he(_t)}
322
323
  `;
323
324
  _([
324
325
  d({ type: Object })
@@ -348,15 +349,15 @@ _([
348
349
  b()
349
350
  ], w.prototype, "index", 2);
350
351
  w = _([
351
- F("maptiler-geocoder-feature-item")
352
+ O("maptiler-geocoder-feature-item")
352
353
  ], w);
353
- const It = "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}";
354
- var Mt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Ue = (t) => {
354
+ const Mt = "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}";
355
+ var St = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, Ue = (t) => {
355
356
  throw TypeError(t);
356
357
  }, c = (t, e, i, o) => {
357
- for (var r = o > 1 ? void 0 : o ? St(e, i) : e, s = t.length - 1, a; s >= 0; s--)
358
+ for (var r = o > 1 ? void 0 : o ? Ot(e, i) : e, s = t.length - 1, a; s >= 0; s--)
358
359
  (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
359
- return o && r && Mt(e, i, r), r;
360
+ return o && r && St(e, i, r), r;
360
361
  }, pe = (t, e, i) => e.has(t) || Ue("Cannot " + i), x = (t, e, i) => (pe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), E = (t, e, i) => e.has(t) ? Ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, o) => (pe(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (pe(t, e, "access private method"), i), Q, q, j, ne, R, n, K, Be, Ge, ue, v, fe, Y, me, ge, I, ye, H, ze, le, je, Re, Ae, De, Ve;
361
362
  let l = class extends S {
362
363
  constructor() {
@@ -521,7 +522,7 @@ let l = class extends S {
521
522
  h(this, n, Re).call(this, t);
522
523
  }}
523
524
  .missingIconsCache=${x(this, ne)}
524
- .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.4/icons/"}
525
+ .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.5/icons/"}
525
526
  >
526
527
  ${t.place_name}
527
528
  </maptiler-geocoder-feature-item>
@@ -608,7 +609,7 @@ H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
608
609
  k && (k = [...new Set(k)], f.set("types", k.join(",")));
609
610
  const T = !s || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
610
611
  if (T && f.set("excludeTypes", String(T)), 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) {
611
- const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await wt(x(this, R), y, o);
612
+ const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await kt(x(this, R), y, o);
612
613
  xe && f.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && f.set("autocomplete", "false"), f.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
613
614
  }
614
615
  const ve = this.limit ?? 5, J = this.reverseGeocodingLimit ?? ve;
@@ -657,7 +658,7 @@ H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
657
658
  }
658
659
  };
659
660
  ze = function(t) {
660
- this.reverseActive = this.enableReverse === "always", h(this, n, I).call(this), this.picked = void 0, h(this, n, ye).call(this, `${t[1].toFixed(6)}, ${bt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, n, me).call(this);
661
+ this.reverseActive = this.enableReverse === "always", h(this, n, I).call(this), this.picked = void 0, h(this, n, ye).call(this, `${t[1].toFixed(6)}, ${wt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, n, me).call(this);
661
662
  };
662
663
  le = function(t) {
663
664
  if (!this.listFeatures)
@@ -681,7 +682,7 @@ Ve = function() {
681
682
  this.searchValue = "", h(this, n, v).call(this, "queryclear"), this.picked = void 0, this.input.focus();
682
683
  };
683
684
  l.styles = M`
684
- ${he(It)}
685
+ ${he(Mt)}
685
686
  `;
686
687
  c([
687
688
  d({ attribute: !1 })
@@ -828,7 +829,7 @@ c([
828
829
  b()
829
830
  ], l.prototype, "focusedDelayed", 2);
830
831
  l = c([
831
- F("maptiler-geocoder")
832
+ O("maptiler-geocoder")
832
833
  ], l);
833
834
  const Ft = [
834
835
  "adjustUrl",
@@ -868,9 +869,9 @@ const Ft = [
868
869
  "types",
869
870
  "reverseGeocodingTypes",
870
871
  "worldview"
871
- ], Ot = "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)}";
872
- var Ct = Object.getOwnPropertyDescriptor, Tt = (t, e, i, o) => {
873
- for (var r = o > 1 ? void 0 : o ? Ct(e, i) : e, s = t.length - 1, a; s >= 0; s--)
872
+ ], Ct = "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)}";
873
+ var Tt = Object.getOwnPropertyDescriptor, Pt = (t, e, i, o) => {
874
+ for (var r = o > 1 ? void 0 : o ? Tt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
874
875
  (a = t[s]) && (r = a(r) || r);
875
876
  return r;
876
877
  };
@@ -891,15 +892,15 @@ let ce = class extends S {
891
892
  }
892
893
  };
893
894
  ce.styles = M`
894
- ${he(Ot)}
895
+ ${he(Ct)}
895
896
  `;
896
- ce = Tt([
897
- F("maptiler-geocode-marker")
897
+ ce = Pt([
898
+ O("maptiler-geocode-marker")
898
899
  ], ce);
899
- function Pt(t) {
900
- const e = st(
900
+ function Et(t) {
901
+ const e = rt(
901
902
  Le([
902
- ot([
903
+ at([
903
904
  [
904
905
  [180, 90],
905
906
  [-180, 90],
@@ -914,7 +915,7 @@ function Pt(t) {
914
915
  if (!e)
915
916
  return;
916
917
  e.properties = { isMask: !0 };
917
- const i = Z($e(t)), o = (i[2] - i[0]) / 360 / 1e3, r = i[0] < -180, s = i[2] > 180, a = rt(t);
918
+ const i = Z($e(t)), o = (i[2] - i[0]) / 360 / 1e3, r = i[0] < -180, s = i[2] > 180, a = ot(t);
918
919
  if (a.features.length > 1 && (r || s))
919
920
  for (const f of a.features) {
920
921
  const L = Z($e(f));
@@ -927,9 +928,9 @@ function Pt(t) {
927
928
  for (const T of k)
928
929
  T[0] -= 360 - o;
929
930
  }
930
- return Le([a.features.length < 2 ? t : at(a) ?? t, e]);
931
+ return Le([a.features.length < 2 ? t : nt(a) ?? t, e]);
931
932
  }
932
- const Et = {
933
+ const Ut = {
933
934
  continental_marine: 4,
934
935
  country: 4,
935
936
  major_landform: 8,
@@ -953,9 +954,9 @@ const Et = {
953
954
  "poi.restaurant": 18,
954
955
  "poi.aerodrome": 13
955
956
  // TODO add many more
956
- }, Ut = (t) => (e) => {
957
- const i = t.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.4/icons/", o = e.getProperties(), r = e.getGeometry()?.getType(), s = o.isMask ? 0 : r === "LineString" || r === "MultiLineString" ? 3 : 2;
958
- return new lt({
957
+ }, Bt = (t) => (e) => {
958
+ const i = t.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.5/icons/", o = e.getProperties(), r = e.getGeometry()?.getType(), s = o.isMask ? 0 : r === "LineString" || r === "MultiLineString" ? 3 : 2;
959
+ return new ct({
959
960
  stroke: o.isMask ? void 0 : new Me({
960
961
  color: "#3170fe",
961
962
  lineDash: [s, s],
@@ -965,12 +966,12 @@ const Et = {
965
966
  fill: o.isMask ? new Ie({
966
967
  color: "#00000020"
967
968
  }) : void 0,
968
- image: new nt({
969
+ image: new lt({
969
970
  src: `${i}marker_${o.isReverse ? "reverse" : o.isSelected ? "selected" : "unselected"}.svg`,
970
971
  anchor: [0.5, 1]
971
972
  }),
972
973
  zIndex: o.isSelected ? 2 : o.isReverse ? 0 : 1,
973
- text: (o.isSelected || o.isMouseOver) && o.tooltip ? new ct({
974
+ text: (o.isSelected || o.isMouseOver) && o.tooltip ? new ht({
974
975
  backgroundFill: new Ie({ color: "white" }),
975
976
  text: o.tooltip,
976
977
  offsetY: -40,
@@ -982,8 +983,8 @@ const Et = {
982
983
  padding: [2, 0, 0, 2]
983
984
  }) : void 0
984
985
  });
985
- }, O = "EPSG:4326";
986
- class oi extends Ke {
986
+ }, F = "EPSG:4326";
987
+ class ni extends Ke {
987
988
  #t;
988
989
  #e;
989
990
  #r;
@@ -1138,7 +1139,7 @@ class oi extends Ke {
1138
1139
  }
1139
1140
  }
1140
1141
  #i(e, i) {
1141
- this.dispatchEvent({ type: e, ...i ?? {} });
1142
+ this.dispatchEvent(Object.assign(new Ye(e), i));
1142
1143
  }
1143
1144
  #M(e) {
1144
1145
  e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#w(e.center, this.#p(e)) : this.#k(Z(e.bbox), 50, this.#p(e));
@@ -1154,7 +1155,7 @@ class oi extends Ke {
1154
1155
  #p(e) {
1155
1156
  if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
1156
1157
  return;
1157
- const i = e.id.replace(/\..*/, ""), o = this.#t.zoom ?? Et;
1158
+ const i = e.id.replace(/\..*/, ""), o = this.#t.zoom ?? Ut;
1158
1159
  return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((r, s) => {
1159
1160
  const a = o[i + "." + s];
1160
1161
  return r === void 0 ? a : a === void 0 ? r : Math.max(r, a);
@@ -1163,10 +1164,10 @@ class oi extends Ke {
1163
1164
  get #m() {
1164
1165
  return !!this.#t.flyTo || this.#t.flyTo === void 0;
1165
1166
  }
1166
- get #F() {
1167
+ get #O() {
1167
1168
  return typeof this.#t.flyTo == "boolean" ? {} : this.#t.flyTo;
1168
1169
  }
1169
- get #O() {
1170
+ get #F() {
1170
1171
  return typeof this.#t.flyTo == "boolean" ? {} : this.#t.flyTo;
1171
1172
  }
1172
1173
  #w(e, i) {
@@ -1174,15 +1175,15 @@ class oi extends Ke {
1174
1175
  center: this.#f(e),
1175
1176
  ...i ? { zoom: i } : {},
1176
1177
  duration: 2e3,
1177
- ...this.#F
1178
+ ...this.#O
1178
1179
  });
1179
1180
  }
1180
1181
  #k(e, i, o) {
1181
- this.#e?.getView().fit(Je(e, O, this.#n()), {
1182
+ this.#e?.getView().fit(Xe(e, F, this.#n()), {
1182
1183
  padding: [i, i, i, i],
1183
1184
  ...o ? { maxZoom: o } : {},
1184
1185
  duration: 2e3,
1185
- ...this.#O
1186
+ ...this.#F
1186
1187
  });
1187
1188
  }
1188
1189
  #_(e) {
@@ -1211,24 +1212,24 @@ class oi extends Ke {
1211
1212
  if (i?.geometry.type === "GeometryCollection") {
1212
1213
  const r = i.geometry.geometries.map((s) => s.type === "Polygon" ? new be(s.coordinates) : s.type === "MultiPolygon" ? new we(s.coordinates) : null).filter((s) => !!s);
1213
1214
  if (r.length > 0)
1214
- this.#s.addFeature(new $(new Ye(r).transform(O, this.#n())));
1215
+ this.#s.addFeature(new $(new He(r).transform(F, this.#n())));
1215
1216
  else
1216
1217
  for (const s of i.geometry.geometries)
1217
- s.type === "LineString" ? this.#s.addFeature(new $(new ke(s.coordinates).transform(O, this.#n()))) : s.type === "MultiLineString" && this.#s.addFeature(new $(new _e(s.coordinates).transform(O, this.#n())));
1218
+ s.type === "LineString" ? this.#s.addFeature(new $(new ke(s.coordinates).transform(F, this.#n()))) : s.type === "MultiLineString" && this.#s.addFeature(new $(new _e(s.coordinates).transform(F, this.#n())));
1218
1219
  } else if (i?.geometry.type.endsWith("Polygon")) {
1219
- const r = Pt(i);
1220
+ const r = Et(i);
1220
1221
  if (r)
1221
1222
  for (const s of r.features) {
1222
1223
  const a = s.geometry.type === "Polygon" ? new be(s.geometry.coordinates) : new we(s.geometry.coordinates);
1223
1224
  this.#s.addFeature(
1224
1225
  new $({
1225
1226
  isMask: !!s.properties?.isMask,
1226
- geometry: a.transform(O, this.#n())
1227
+ geometry: a.transform(F, this.#n())
1227
1228
  })
1228
1229
  );
1229
1230
  }
1230
1231
  this.#t.pickedResultStyle === "full-geometry-including-polygon-center-marker" && o();
1231
- } else i?.geometry.type === "LineString" ? this.#s.addFeature(new $(new ke(i.geometry.coordinates).transform(O, this.#n()))) : i?.geometry.type === "MultiLineString" ? this.#s.addFeature(new $(new _e(i.geometry.coordinates).transform(O, this.#n()))) : i?.geometry.type.endsWith("Point") && o();
1232
+ } else i?.geometry.type === "LineString" ? this.#s.addFeature(new $(new ke(i.geometry.coordinates).transform(F, this.#n()))) : i?.geometry.type === "MultiLineString" ? this.#s.addFeature(new $(new _e(i.geometry.coordinates).transform(F, this.#n()))) : i?.geometry.type.endsWith("Point") && o();
1232
1233
  if (this.#t.showResultMarkers !== !1)
1233
1234
  for (const r of e ?? []) {
1234
1235
  if (r.id === i?.id || r.place_type.includes("reverse"))
@@ -1244,7 +1245,7 @@ class oi extends Ke {
1244
1245
  this.#h?.set("isSelected", !1), this.#h = void 0, this.#t.markerOnSelected !== !1 && (this.#h = this.#c.get(e), this.#h?.setProperties({ isSelected: !0 }));
1245
1246
  }
1246
1247
  #T() {
1247
- this.#e && (this.#s = new it({}), this.#l = new He({
1248
+ this.#e && (this.#s = new st({}), this.#l = new Je({
1248
1249
  updateWhileAnimating: !0
1249
1250
  }), this.#l.setSource(this.#s), this.#l.setStyle(this.#E()), this.#e.addLayer(this.#l));
1250
1251
  }
@@ -1252,24 +1253,24 @@ class oi extends Ke {
1252
1253
  !this.#e || !this.#l || (this.#e.removeLayer(this.#l), this.#l = void 0);
1253
1254
  }
1254
1255
  #n() {
1255
- return Xe() ?? this.#e?.getView().getProjection();
1256
+ return et() ?? this.#e?.getView().getProjection();
1256
1257
  }
1257
1258
  #f(e) {
1258
- return et(e, this.#n());
1259
+ return tt(e, this.#n());
1259
1260
  }
1260
1261
  #$(e) {
1261
- return tt(e, this.#n());
1262
+ return it(e, this.#n());
1262
1263
  }
1263
1264
  #E() {
1264
1265
  const { fullGeometryStyle: e } = this.#t;
1265
- if (e === !0 || e === void 0) return Ut(this.#t);
1266
+ if (e === !0 || e === void 0) return Bt(this.#t);
1266
1267
  if (!(e === !1 || e === null))
1267
1268
  return e;
1268
1269
  }
1269
1270
  }
1270
1271
  export {
1271
- Ut as DEFAULT_GEOMETRY_STYLE,
1272
- oi as GeocodingControl,
1272
+ Bt as DEFAULT_GEOMETRY_STYLE,
1273
+ ni as GeocodingControl,
1273
1274
  te as MaptilerGeocodeClearIconElement,
1274
1275
  ie as MaptilerGeocodeFailIconElement,
1275
1276
  se as MaptilerGeocodeLoadingIconElement,
@@ -1277,7 +1278,7 @@ export {
1277
1278
  re as MaptilerGeocodeReverseGeocodingIconElement,
1278
1279
  oe as MaptilerGeocodeSearchIconElement,
1279
1280
  l as MaptilerGeocoderElement,
1280
- oi as OpenLayersGeocodingControl,
1281
- Et as ZOOM_DEFAULTS
1281
+ ni as OpenLayersGeocodingControl,
1282
+ Ut as ZOOM_DEFAULTS
1282
1283
  };
1283
1284
  //# sourceMappingURL=openlayers.public.js.map