@maptiler/geocoding-control 1.4.2-dev.1 → 1.4.2-dev.3
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/leaflet.js +731 -729
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +675 -673
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +675 -673
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +774 -772
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +9 -9
- package/react.js +444 -442
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/GeocodingControl.svelte +6 -3
- package/svelte/GeocodingControl.svelte.d.ts +1 -0
- package/svelte/types.d.ts +8 -2
- package/types.d.ts +8 -2
- package/vanilla.js +420 -418
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{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}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-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)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}circle.svelte-1aq105l{stroke-width:1.875;fill:none}path.svelte-1aq105l{stroke-width:1.875;stroke-linecap:round}svg.svelte-1aq105l{display:block;stroke:var(--color-icon-button)}form.svelte-
|
|
1
|
+
svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{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}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-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)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}circle.svelte-1aq105l{stroke-width:1.875;fill:none}path.svelte-1aq105l{stroke-width:1.875;stroke-linecap:round}svg.svelte-1aq105l{display:block;stroke:var(--color-icon-button)}form.svelte-1uvos7g.svelte-1uvos7g{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}form.svelte-1uvos7g.svelte-1uvos7g,form.svelte-1uvos7g .svelte-1uvos7g,form.svelte-1uvos7g .svelte-1uvos7g:after,form.svelte-1uvos7g .svelte-1uvos7g:before{box-sizing:border-box}form.can-collapse.svelte-1uvos7g.svelte-1uvos7g{max-width:29px}form.can-collapse.svelte-1uvos7g input.svelte-1uvos7g::placeholder{transition:opacity .25s;opacity:0}form.svelte-1uvos7g.svelte-1uvos7g,form.svelte-1uvos7g.svelte-1uvos7g:focus-within,form.svelte-1uvos7g.svelte-1uvos7g:hover{width:270px;max-width:270px}form.svelte-1uvos7g input.svelte-1uvos7g::placeholder,form.svelte-1uvos7g:focus-within input.svelte-1uvos7g::placeholder,form.svelte-1uvos7g:hover input.svelte-1uvos7g::placeholder{opacity:1}input.svelte-1uvos7g.svelte-1uvos7g{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.svelte-1uvos7g.svelte-1uvos7g:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-1uvos7g.svelte-1uvos7g,div.error.svelte-1uvos7g.svelte-1uvos7g,div.no-results.svelte-1uvos7g.svelte-1uvos7g{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.svelte-1uvos7g.svelte-1uvos7g{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-1uvos7g.svelte-1uvos7g,div.no-results.svelte-1uvos7g.svelte-1uvos7g{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-1uvos7g.svelte-1uvos7g{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-1uvos7g div.svelte-1uvos7g{flex-grow:1}div.error.svelte-1uvos7g svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-1uvos7g button.svelte-1uvos7g{flex-shrink:0}div.error.svelte-1uvos7g button.svelte-1uvos7g>svg{width:13px;fill:#e25041}div.error.svelte-1uvos7g button.svelte-1uvos7g:hover svg,div.error.svelte-1uvos7g button.svelte-1uvos7g:active svg{fill:#444952}div.no-results.svelte-1uvos7g.svelte-1uvos7g{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-1uvos7g svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.maplibregl-ctrl-bottom-left ul.svelte-1uvos7g.svelte-1uvos7g,.maplibregl-ctrl-bottom-right ul.svelte-1uvos7g.svelte-1uvos7g{top:auto;bottom:100%}button.svelte-1uvos7g.svelte-1uvos7g{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-1uvos7g.svelte-1uvos7g:hover{background-color:transparent}button.svelte-1uvos7g:hover svg,button.svelte-1uvos7g:active svg{fill:#2b8bfb}.input-group.svelte-1uvos7g.svelte-1uvos7g{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-1uvos7g.svelte-1uvos7g:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-1uvos7g.svelte-1uvos7g{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-1uvos7g.svelte-1uvos7g{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-1uvos7g.svelte-1uvos7g{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-1uvos7g.svelte-1uvos7g{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-1uvos7g.svelte-1uvos7g:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-1uvos7g.svelte-1uvos7g{max-width:33px}.maptiler-ctrl form.svelte-1uvos7g.svelte-1uvos7g,.maptiler-ctrl form.svelte-1uvos7g.svelte-1uvos7g:focus-within,.maptiler-ctrl form.svelte-1uvos7g.svelte-1uvos7g:hover{width:270px;max-width:270px}
|
|
@@ -67,13 +67,14 @@ export let selectFirst = true;
|
|
|
67
67
|
export let flyToSelected = false;
|
|
68
68
|
export let markerOnSelected = true;
|
|
69
69
|
export let types = undefined;
|
|
70
|
+
export let exhaustiveReverseGeocoding = false;
|
|
70
71
|
export let excludeTypes = false;
|
|
71
72
|
export let zoom = ZOOM_DEFAULTS;
|
|
72
73
|
export let maxZoom = undefined;
|
|
73
74
|
export let apiUrl = "https://api.maptiler.com/geocoding";
|
|
74
75
|
export let fetchParameters = {};
|
|
75
76
|
export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
|
|
76
|
-
"1.4.2-dev.
|
|
77
|
+
"1.4.2-dev.3" +
|
|
77
78
|
"/icons/";
|
|
78
79
|
export let adjustUrlQuery = () => { };
|
|
79
80
|
export function focus() {
|
|
@@ -183,7 +184,7 @@ $: if (selectFirst && listFeatures?.length) {
|
|
|
183
184
|
selectedItemIndex = 0;
|
|
184
185
|
}
|
|
185
186
|
// clear selection on edit
|
|
186
|
-
$:
|
|
187
|
+
$: {
|
|
187
188
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
188
189
|
searchValue;
|
|
189
190
|
selectedItemIndex = -1;
|
|
@@ -312,7 +313,8 @@ async function search(searchValue, { byId = false, exact = false, } = {}) {
|
|
|
312
313
|
}
|
|
313
314
|
sp.set("fuzzyMatch", String(fuzzyMatch));
|
|
314
315
|
}
|
|
315
|
-
if (limit !== undefined &&
|
|
316
|
+
if (limit !== undefined &&
|
|
317
|
+
(exhaustiveReverseGeocoding || !isReverse || types?.length === 1)) {
|
|
316
318
|
sp.set("limit", String(limit));
|
|
317
319
|
}
|
|
318
320
|
sp.set("key", apiKey);
|
|
@@ -610,6 +612,7 @@ function pick(feature) {
|
|
|
610
612
|
background-color: #fff;
|
|
611
613
|
z-index: 10;
|
|
612
614
|
border-radius: 4px;
|
|
615
|
+
margin: 0;
|
|
613
616
|
transition: max-width 0.25s;
|
|
614
617
|
box-shadow: 0px 2px 5px rgba(51, 51, 89, 0.15);
|
|
615
618
|
--color-text: #444952;
|
|
@@ -33,6 +33,7 @@ declare const __propDef: {
|
|
|
33
33
|
flyToSelected?: boolean;
|
|
34
34
|
markerOnSelected?: boolean;
|
|
35
35
|
types?: string[] | undefined;
|
|
36
|
+
exhaustiveReverseGeocoding?: boolean;
|
|
36
37
|
excludeTypes?: boolean;
|
|
37
38
|
zoom?: number | Record<string, number>;
|
|
38
39
|
maxZoom?: number | undefined;
|
package/svelte/types.d.ts
CHANGED
|
@@ -73,10 +73,10 @@ export type ControlOptions = {
|
|
|
73
73
|
debounceSearch?: number;
|
|
74
74
|
/**
|
|
75
75
|
* Search results closer to the proximity point will be given higher priority. First matching rule from the array will be used.
|
|
76
|
-
* Set to `
|
|
76
|
+
* Set to `null` to disable the proximity.
|
|
77
77
|
* Default value is `[{ type: "server-geolocation" }]`.
|
|
78
78
|
*/
|
|
79
|
-
proximity?: ProximityRule[] | null
|
|
79
|
+
proximity?: ProximityRule[] | null;
|
|
80
80
|
/**
|
|
81
81
|
* Override the default placeholder attribute value.
|
|
82
82
|
* Default value is `"Search"`.
|
|
@@ -207,6 +207,12 @@ export type ControlOptions = {
|
|
|
207
207
|
* Default value is `undefined` - all available feature types are returned.
|
|
208
208
|
*/
|
|
209
209
|
types?: string[];
|
|
210
|
+
/**
|
|
211
|
+
* Use `limit` value for reverse geocoding even if `types` is not an array with a single element.
|
|
212
|
+
* Will work only if enabled on the server.
|
|
213
|
+
* Default value is `false`.
|
|
214
|
+
*/
|
|
215
|
+
exhaustiveReverseGeocoding?: boolean;
|
|
210
216
|
/**
|
|
211
217
|
* If set to `true` then use all types except for those listed in `types`.
|
|
212
218
|
* Default value is `false`.
|
package/types.d.ts
CHANGED
|
@@ -73,10 +73,10 @@ export type ControlOptions = {
|
|
|
73
73
|
debounceSearch?: number;
|
|
74
74
|
/**
|
|
75
75
|
* Search results closer to the proximity point will be given higher priority. First matching rule from the array will be used.
|
|
76
|
-
* Set to `
|
|
76
|
+
* Set to `null` to disable the proximity.
|
|
77
77
|
* Default value is `[{ type: "server-geolocation" }]`.
|
|
78
78
|
*/
|
|
79
|
-
proximity?: ProximityRule[] | null
|
|
79
|
+
proximity?: ProximityRule[] | null;
|
|
80
80
|
/**
|
|
81
81
|
* Override the default placeholder attribute value.
|
|
82
82
|
* Default value is `"Search"`.
|
|
@@ -207,6 +207,12 @@ export type ControlOptions = {
|
|
|
207
207
|
* Default value is `undefined` - all available feature types are returned.
|
|
208
208
|
*/
|
|
209
209
|
types?: string[];
|
|
210
|
+
/**
|
|
211
|
+
* Use `limit` value for reverse geocoding even if `types` is not an array with a single element.
|
|
212
|
+
* Will work only if enabled on the server.
|
|
213
|
+
* Default value is `false`.
|
|
214
|
+
*/
|
|
215
|
+
exhaustiveReverseGeocoding?: boolean;
|
|
210
216
|
/**
|
|
211
217
|
* If set to `true` then use all types except for those listed in `types`.
|
|
212
218
|
* Default value is `false`.
|