@maptiler/geocoding-control 2.0.0 → 2.0.1
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/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +97 -95
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +2 -2
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +26 -4
- package/leaflet.js +906 -909
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +1 -1
- package/maplibregl-controller.js +480 -466
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +3 -3
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.d.ts +2594 -9
- package/maplibregl.js +2094 -1969
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +2594 -9
- package/maptilersdk.js +2086 -1964
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +1 -1
- package/openlayers-controller.js +62 -60
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +2 -2
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +21 -0
- package/openlayers.js +754 -786
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +18 -18
- package/react.d.ts +4 -4
- package/react.js +619 -619
- 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/FeatureItem.svelte +1 -1
- package/svelte/FeatureItem.svelte.d.ts +2 -2
- package/svelte/GeocodingControl.svelte +31 -32
- package/svelte/GeocodingControl.svelte.d.ts +26 -13
- package/svelte/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/svelte/MapLibreBasedGeocodingControl.js +120 -17
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +4 -1
- package/svelte/leaflet.d.ts +26 -4
- package/svelte/leaflet.js +17 -19
- package/svelte/maplibregl-controller.d.ts +1 -1
- package/svelte/maplibregl-controller.js +45 -36
- package/svelte/maplibregl.d.ts +2594 -9
- package/svelte/maplibregl.js +11 -3
- package/svelte/maptilersdk.d.ts +2594 -9
- package/svelte/maptilersdk.js +11 -3
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +4 -1
- package/svelte/openlayers.d.ts +21 -0
- package/svelte/openlayers.js +30 -45
- package/svelte/react.d.ts +4 -4
- package/svelte/react.js +5 -5
- package/svelte/types.d.ts +84 -35
- package/svelte/vanilla.d.ts +14 -1
- package/svelte/vanilla.js +31 -8
- package/types.d.ts +84 -35
- package/vanilla.d.ts +14 -1
- package/vanilla.js +929 -901
- 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-bz0zu3.svelte-bz0zu3{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-bz0zu3.svelte-bz0zu3,form.svelte-bz0zu3 .svelte-bz0zu3,form.svelte-bz0zu3 .svelte-bz0zu3:after,form.svelte-bz0zu3 .svelte-bz0zu3:before{box-sizing:border-box}form.can-collapse.svelte-bz0zu3.svelte-bz0zu3{max-width:29px}form.can-collapse.svelte-bz0zu3 input.svelte-bz0zu3::placeholder{transition:opacity .25s;opacity:0}form.svelte-bz0zu3.svelte-bz0zu3,form.svelte-bz0zu3.svelte-bz0zu3:focus-within,form.svelte-bz0zu3.svelte-bz0zu3:hover{width:270px;max-width:270px}form.svelte-bz0zu3 input.svelte-bz0zu3::placeholder,form.svelte-bz0zu3:focus-within input.svelte-bz0zu3::placeholder,form.svelte-bz0zu3:hover input.svelte-bz0zu3::placeholder{opacity:1}input.svelte-bz0zu3.svelte-bz0zu3{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-bz0zu3.svelte-bz0zu3:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-bz0zu3.svelte-bz0zu3,div.error.svelte-bz0zu3.svelte-bz0zu3,div.no-results.svelte-bz0zu3.svelte-bz0zu3{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-bz0zu3.svelte-bz0zu3{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-bz0zu3.svelte-bz0zu3,div.no-results.svelte-bz0zu3.svelte-bz0zu3{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-bz0zu3.svelte-bz0zu3{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-bz0zu3 div.svelte-bz0zu3{flex-grow:1}div.error.svelte-bz0zu3 svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-bz0zu3 button.svelte-bz0zu3{flex-shrink:0}div.error.svelte-bz0zu3 button.svelte-bz0zu3>svg{width:13px;fill:#e25041}div.error.svelte-bz0zu3 button.svelte-bz0zu3:hover svg,div.error.svelte-bz0zu3 button.svelte-bz0zu3:active svg{fill:#444952}div.no-results.svelte-bz0zu3.svelte-bz0zu3{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-bz0zu3 svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.leaflet-bottom ul.options.svelte-bz0zu3.svelte-bz0zu3,.maplibregl-ctrl-bottom-left ul.options.svelte-bz0zu3.svelte-bz0zu3,.maplibregl-ctrl-bottom-right ul.options.svelte-bz0zu3.svelte-bz0zu3{top:auto;bottom:calc(100% + 6px)}button.svelte-bz0zu3.svelte-bz0zu3{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-bz0zu3.svelte-bz0zu3:hover{background-color:transparent}button.svelte-bz0zu3:hover svg,button.svelte-bz0zu3:active svg{fill:#2b8bfb}.input-group.svelte-bz0zu3.svelte-bz0zu3{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-bz0zu3.svelte-bz0zu3:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-bz0zu3.svelte-bz0zu3{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-bz0zu3.svelte-bz0zu3{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-bz0zu3.svelte-bz0zu3{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-bz0zu3.svelte-bz0zu3{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-bz0zu3.svelte-bz0zu3:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-bz0zu3.svelte-bz0zu3{max-width:33px}.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3,.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3:focus-within,.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3:hover{width:270px;max-width:270px}
|
|
@@ -58,7 +58,7 @@ function handleImgError() {
|
|
|
58
58
|
{isReverse ? feature.place_name : feature.place_name.replace(/,.*/, "")}
|
|
59
59
|
</span>
|
|
60
60
|
|
|
61
|
-
{#if showPlaceType === "always" || (showPlaceType && !feature.address && !feature.id.startsWith("road.") && !feature.id.startsWith("address.") && !feature.id.startsWith("postal_code.") && (!feature.id.startsWith("poi.") || !imageUrl) && !isReverse)}
|
|
61
|
+
{#if showPlaceType === "always" || (showPlaceType !== "never" && !feature.address && !feature.id.startsWith("road.") && !feature.id.startsWith("address.") && !feature.id.startsWith("postal_code.") && (!feature.id.startsWith("poi.") || !imageUrl) && !isReverse)}
|
|
62
62
|
<span class="secondary">
|
|
63
63
|
{placeType}
|
|
64
64
|
</span>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Feature } from "./types";
|
|
2
|
+
import type { Feature, ShowPlaceType } from "./types";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
feature: Feature;
|
|
6
6
|
selected?: boolean;
|
|
7
|
-
showPlaceType:
|
|
7
|
+
showPlaceType: ShowPlaceType;
|
|
8
8
|
missingIconsCache: Set<string>;
|
|
9
9
|
iconsBaseUrl: string;
|
|
10
10
|
};
|
|
@@ -43,7 +43,7 @@ export let clearOnBlur = false;
|
|
|
43
43
|
export let collapsed = false;
|
|
44
44
|
export let country = undefined;
|
|
45
45
|
export let debounceSearch = 200;
|
|
46
|
-
export let enableReverse =
|
|
46
|
+
export let enableReverse = "never";
|
|
47
47
|
export let errorMessage = "Something went wrong…";
|
|
48
48
|
export let filter = () => true;
|
|
49
49
|
export let flyTo = true;
|
|
@@ -60,8 +60,8 @@ export let proximity = [
|
|
|
60
60
|
export let reverseActive = enableReverse === "always";
|
|
61
61
|
export let reverseButtonTitle = "toggle reverse geocoding";
|
|
62
62
|
export let searchValue = "";
|
|
63
|
-
export let
|
|
64
|
-
export let showPlaceType = "
|
|
63
|
+
export let pickedResultStyle = "full-geometry";
|
|
64
|
+
export let showPlaceType = "if-needed";
|
|
65
65
|
export let showResultsWhileTyping = true;
|
|
66
66
|
export let selectFirst = true;
|
|
67
67
|
export let flyToSelected = false;
|
|
@@ -70,11 +70,10 @@ export let types = undefined;
|
|
|
70
70
|
export let exhaustiveReverseGeocoding = false;
|
|
71
71
|
export let excludeTypes = false;
|
|
72
72
|
export let zoom = ZOOM_DEFAULTS;
|
|
73
|
-
export let maxZoom = undefined;
|
|
74
73
|
export let apiUrl = "https://api.maptiler.com/geocoding";
|
|
75
74
|
export let fetchParameters = {};
|
|
76
75
|
export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
|
|
77
|
-
"2.0.
|
|
76
|
+
"2.0.1" +
|
|
78
77
|
"/icons/";
|
|
79
78
|
export let adjustUrlQuery = () => { };
|
|
80
79
|
export function focus() {
|
|
@@ -124,7 +123,7 @@ const dispatch = createEventDispatcher();
|
|
|
124
123
|
$: {
|
|
125
124
|
reverseActive = enableReverse === "always";
|
|
126
125
|
}
|
|
127
|
-
$: if (
|
|
126
|
+
$: if (pickedResultStyle !== "marker-only" &&
|
|
128
127
|
picked &&
|
|
129
128
|
!picked.address &&
|
|
130
129
|
picked.geometry.type === "Point" &&
|
|
@@ -149,19 +148,21 @@ $: {
|
|
|
149
148
|
$: if (mapController && selected && flyTo && flyToSelected) {
|
|
150
149
|
mapController.flyTo(selected.center, computeZoom(selected));
|
|
151
150
|
}
|
|
151
|
+
$: showPolygonMarker =
|
|
152
|
+
pickedResultStyle === "full-geometry-including-polygon-center-marker";
|
|
152
153
|
// if markerOnSelected was dynamically changed to false
|
|
153
154
|
$: if (!markerOnSelected) {
|
|
154
|
-
mapController?.
|
|
155
|
+
mapController?.setFeatures(undefined, undefined, showPolygonMarker);
|
|
155
156
|
}
|
|
156
157
|
$: if (mapController && markerOnSelected && !markedFeatures) {
|
|
157
|
-
mapController.
|
|
158
|
+
mapController.setFeatures(selected ? [selected] : undefined, undefined, showPolygonMarker);
|
|
158
159
|
mapController.setSelectedMarker(selected ? 0 : -1);
|
|
159
160
|
}
|
|
160
161
|
$: if (markedFeatures !== listFeatures) {
|
|
161
162
|
markedFeatures = undefined;
|
|
162
163
|
}
|
|
163
164
|
$: if (mapController) {
|
|
164
|
-
mapController.
|
|
165
|
+
mapController.setFeatures(markedFeatures, picked, showPolygonMarker);
|
|
165
166
|
}
|
|
166
167
|
$: if (searchValue.length < minLength) {
|
|
167
168
|
picked = undefined;
|
|
@@ -194,13 +195,15 @@ $: if (mapController) {
|
|
|
194
195
|
const coords = isQueryReverse(searchValue);
|
|
195
196
|
mapController.setReverseMarker(coords ? [coords.decimalLongitude, coords.decimalLatitude] : undefined);
|
|
196
197
|
}
|
|
197
|
-
$: dispatch("select", selected);
|
|
198
|
-
$: dispatch("pick", picked);
|
|
199
|
-
$: dispatch("
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
$: dispatch("
|
|
203
|
-
$: dispatch("
|
|
198
|
+
$: dispatch("select", { feature: selected });
|
|
199
|
+
$: dispatch("pick", { feature: picked });
|
|
200
|
+
$: dispatch("optionsvisibilitychange", {
|
|
201
|
+
optionsVisible: focusedDelayed && !!listFeatures,
|
|
202
|
+
});
|
|
203
|
+
$: dispatch("featureslisted", { features: listFeatures });
|
|
204
|
+
$: dispatch("featuresmarked", { features: markedFeatures });
|
|
205
|
+
$: dispatch("reversetoggle", { reverse: reverseActive });
|
|
206
|
+
$: dispatch("querychange", { query: searchValue });
|
|
204
207
|
$: if (mapController) {
|
|
205
208
|
mapController.indicateReverse(reverseActive);
|
|
206
209
|
}
|
|
@@ -241,7 +244,7 @@ onDestroy(() => {
|
|
|
241
244
|
mapController.setEventHandler(undefined);
|
|
242
245
|
mapController.indicateReverse(false);
|
|
243
246
|
mapController.setSelectedMarker(-1);
|
|
244
|
-
mapController.
|
|
247
|
+
mapController.setFeatures(undefined, undefined, false);
|
|
245
248
|
}
|
|
246
249
|
});
|
|
247
250
|
function handleOnSubmit(event) {
|
|
@@ -411,12 +414,11 @@ function zoomToResults() {
|
|
|
411
414
|
for (const feature of markedFeatures) {
|
|
412
415
|
const featZoom = computeZoom(feature);
|
|
413
416
|
allZoom =
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
: Math.max(allZoom, featZoom));
|
|
417
|
+
allZoom === undefined
|
|
418
|
+
? featZoom
|
|
419
|
+
: featZoom === undefined
|
|
420
|
+
? allZoom
|
|
421
|
+
: Math.max(allZoom, featZoom);
|
|
420
422
|
if (fuzzyOnly || !feature.matching_text) {
|
|
421
423
|
for (const i of [0, 1, 2, 3]) {
|
|
422
424
|
bbox[i] = Math[i < 2 ? "min" : "max"](bbox[i], feature.bbox?.[i] ?? feature.center[i % 2]);
|
|
@@ -438,11 +440,6 @@ function computeZoom(feature) {
|
|
|
438
440
|
feature.bbox[1] !== feature.bbox[3])) {
|
|
439
441
|
return undefined;
|
|
440
442
|
}
|
|
441
|
-
if (typeof zoom === "number") {
|
|
442
|
-
return feature.id.startsWith("poi.") || feature.id.startsWith("address.")
|
|
443
|
-
? maxZoom
|
|
444
|
-
: zoom;
|
|
445
|
-
}
|
|
446
443
|
const index = feature.id.replace(/\..*/, "");
|
|
447
444
|
return ((Array.isArray(feature.properties?.categories)
|
|
448
445
|
? feature.properties.categories.reduce((a, category) => {
|
|
@@ -550,7 +547,7 @@ function pick(feature) {
|
|
|
550
547
|
{/if}
|
|
551
548
|
</div>
|
|
552
549
|
|
|
553
|
-
{#if enableReverse ===
|
|
550
|
+
{#if enableReverse === "button"}
|
|
554
551
|
<button
|
|
555
552
|
type="button"
|
|
556
553
|
class:active={reverseActive}
|
|
@@ -584,6 +581,7 @@ function pick(feature) {
|
|
|
584
581
|
</div>
|
|
585
582
|
{:else if focusedDelayed && listFeatures?.length}
|
|
586
583
|
<ul
|
|
584
|
+
class="options"
|
|
587
585
|
on:mouseleave={() => {
|
|
588
586
|
if (!selectFirst) {
|
|
589
587
|
selectedItemIndex = -1;
|
|
@@ -726,10 +724,11 @@ div.no-results :global(svg) {
|
|
|
726
724
|
height: 30px;
|
|
727
725
|
}
|
|
728
726
|
|
|
729
|
-
:global(.
|
|
730
|
-
:global(.maplibregl-ctrl-bottom-
|
|
727
|
+
:global(.leaflet-bottom) ul.options,
|
|
728
|
+
:global(.maplibregl-ctrl-bottom-left) ul.options,
|
|
729
|
+
:global(.maplibregl-ctrl-bottom-right) ul.options {
|
|
731
730
|
top: auto;
|
|
732
|
-
bottom: 100
|
|
731
|
+
bottom: calc(100% + 6px);
|
|
733
732
|
}
|
|
734
733
|
|
|
735
734
|
button {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { BBox, Feature, FeatureCollection, MapController, ProximityRule } from "./types";
|
|
2
|
+
import type { BBox, EnableReverse, Feature, FeatureCollection, MapController, PickedResultStyle, ProximityRule, ShowPlaceType } from "./types";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
ZOOM_DEFAULTS?: Record<string, number>;
|
|
@@ -11,7 +11,7 @@ declare const __propDef: {
|
|
|
11
11
|
collapsed?: boolean;
|
|
12
12
|
country?: string | string[] | undefined;
|
|
13
13
|
debounceSearch?: number;
|
|
14
|
-
enableReverse?:
|
|
14
|
+
enableReverse?: EnableReverse;
|
|
15
15
|
errorMessage?: string;
|
|
16
16
|
filter?: (feature: Feature) => boolean;
|
|
17
17
|
flyTo?: boolean;
|
|
@@ -26,8 +26,8 @@ declare const __propDef: {
|
|
|
26
26
|
reverseActive?: boolean;
|
|
27
27
|
reverseButtonTitle?: string;
|
|
28
28
|
searchValue?: string;
|
|
29
|
-
|
|
30
|
-
showPlaceType?:
|
|
29
|
+
pickedResultStyle?: PickedResultStyle;
|
|
30
|
+
showPlaceType?: ShowPlaceType;
|
|
31
31
|
showResultsWhileTyping?: boolean;
|
|
32
32
|
selectFirst?: boolean;
|
|
33
33
|
flyToSelected?: boolean;
|
|
@@ -35,8 +35,7 @@ declare const __propDef: {
|
|
|
35
35
|
types?: string[] | undefined;
|
|
36
36
|
exhaustiveReverseGeocoding?: boolean;
|
|
37
37
|
excludeTypes?: boolean;
|
|
38
|
-
zoom?:
|
|
39
|
-
maxZoom?: number | undefined;
|
|
38
|
+
zoom?: Record<string, number>;
|
|
40
39
|
apiUrl?: string;
|
|
41
40
|
fetchParameters?: RequestInit;
|
|
42
41
|
iconsBaseUrl?: string;
|
|
@@ -48,17 +47,31 @@ declare const __propDef: {
|
|
|
48
47
|
clearMap?: () => void;
|
|
49
48
|
};
|
|
50
49
|
events: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
featureslisted: CustomEvent<{
|
|
51
|
+
features: Feature[] | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
featuresmarked: CustomEvent<{
|
|
54
|
+
features: Feature[] | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
optionsvisibilitychange: CustomEvent<{
|
|
57
|
+
optionsVisible: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
pick: CustomEvent<{
|
|
60
|
+
feature: Feature | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
querychange: CustomEvent<{
|
|
63
|
+
query: string;
|
|
64
|
+
}>;
|
|
56
65
|
response: CustomEvent<{
|
|
57
66
|
url: string;
|
|
58
67
|
featureCollection: FeatureCollection;
|
|
59
68
|
}>;
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
reversetoggle: CustomEvent<{
|
|
70
|
+
reverse: boolean;
|
|
71
|
+
}>;
|
|
72
|
+
select: CustomEvent<{
|
|
73
|
+
feature: Feature | undefined;
|
|
74
|
+
}>;
|
|
62
75
|
} & {
|
|
63
76
|
[evt: string]: CustomEvent<any>;
|
|
64
77
|
};
|