@maptiler/geocoding-control 2.0.0-rc.1 → 2.0.0-rc.2
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 +1436 -1748
- package/leaflet.js +714 -718
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.d.ts +2625 -0
- package/maplibregl.js +636 -640
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +2620 -0
- package/maptilersdk.js +636 -640
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +643 -647
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +2 -2
- package/react.js +427 -431
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/FeatureItem.svelte +1 -1
- package/svelte/FeatureItem.svelte.d.ts +1 -1
- package/svelte/GeocodingControl.svelte +8 -15
- package/svelte/GeocodingControl.svelte.d.ts +3 -4
- package/svelte/MapLibreBasedGeocodingControl.d.ts +1436 -1748
- package/svelte/MapLibreBasedGeocodingControl.js +2 -3
- package/svelte/leaflet.js +2 -1
- package/svelte/maplibregl.d.ts +2625 -0
- package/svelte/maptilersdk.d.ts +2620 -0
- package/svelte/openlayers.js +2 -1
- package/svelte/react.js +5 -5
- package/svelte/types.d.ts +45 -23
- package/types.d.ts +45 -23
- package/vanilla.js +484 -488
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
|
@@ -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>
|
|
@@ -60,7 +60,7 @@ 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
|
|
63
|
+
export let pickedResultStyle = "full-geometry";
|
|
64
64
|
export let showPlaceType = "if-needed";
|
|
65
65
|
export let showResultsWhileTyping = true;
|
|
66
66
|
export let autocompleteTimeout = undefined;
|
|
@@ -71,11 +71,10 @@ export let types = undefined;
|
|
|
71
71
|
export let exhaustiveReverseGeocoding = false;
|
|
72
72
|
export let excludeTypes = false;
|
|
73
73
|
export let zoom = ZOOM_DEFAULTS;
|
|
74
|
-
export let maxZoom = undefined;
|
|
75
74
|
export let apiUrl = "https://api.maptiler.com/geocoding";
|
|
76
75
|
export let fetchParameters = {};
|
|
77
76
|
export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
|
|
78
|
-
"2.0.0-rc.
|
|
77
|
+
"2.0.0-rc.2" +
|
|
79
78
|
"/icons/";
|
|
80
79
|
export let adjustUrlQuery = () => { };
|
|
81
80
|
export function focus() {
|
|
@@ -126,7 +125,7 @@ const dispatch = createEventDispatcher();
|
|
|
126
125
|
$: {
|
|
127
126
|
reverseActive = enableReverse === "always";
|
|
128
127
|
}
|
|
129
|
-
$: if (
|
|
128
|
+
$: if (pickedResultStyle !== "marker-only" &&
|
|
130
129
|
picked &&
|
|
131
130
|
!picked.address &&
|
|
132
131
|
picked.geometry.type === "Point" &&
|
|
@@ -430,12 +429,11 @@ function zoomToResults() {
|
|
|
430
429
|
for (const feature of markedFeatures) {
|
|
431
430
|
const featZoom = computeZoom(feature);
|
|
432
431
|
allZoom =
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
: Math.max(allZoom, featZoom));
|
|
432
|
+
allZoom === undefined
|
|
433
|
+
? featZoom
|
|
434
|
+
: featZoom === undefined
|
|
435
|
+
? allZoom
|
|
436
|
+
: Math.max(allZoom, featZoom);
|
|
439
437
|
if (fuzzyOnly || !feature.matching_text) {
|
|
440
438
|
for (const i of [0, 1, 2, 3]) {
|
|
441
439
|
bbox[i] = Math[i < 2 ? "min" : "max"](bbox[i], feature.bbox?.[i] ?? feature.center[i % 2]);
|
|
@@ -457,11 +455,6 @@ function computeZoom(feature) {
|
|
|
457
455
|
feature.bbox[1] !== feature.bbox[3])) {
|
|
458
456
|
return undefined;
|
|
459
457
|
}
|
|
460
|
-
if (typeof zoom === "number") {
|
|
461
|
-
return feature.id.startsWith("poi.") || feature.id.startsWith("address.")
|
|
462
|
-
? maxZoom
|
|
463
|
-
: zoom;
|
|
464
|
-
}
|
|
465
458
|
const index = feature.id.replace(/\..*/, "");
|
|
466
459
|
return ((Array.isArray(feature.properties?.categories)
|
|
467
460
|
? feature.properties.categories.reduce((a, category) => {
|
|
@@ -26,8 +26,8 @@ declare const __propDef: {
|
|
|
26
26
|
reverseActive?: boolean;
|
|
27
27
|
reverseButtonTitle?: string;
|
|
28
28
|
searchValue?: string;
|
|
29
|
-
|
|
30
|
-
showPlaceType?:
|
|
29
|
+
pickedResultStyle?: "marker-only" | "full-geometry" | "full-geometry-including-polygon-center-marker";
|
|
30
|
+
showPlaceType?: "never" | "always" | "if-needed";
|
|
31
31
|
showResultsWhileTyping?: boolean;
|
|
32
32
|
autocompleteTimeout?: number | undefined;
|
|
33
33
|
selectFirst?: boolean;
|
|
@@ -36,8 +36,7 @@ declare const __propDef: {
|
|
|
36
36
|
types?: string[] | undefined;
|
|
37
37
|
exhaustiveReverseGeocoding?: boolean;
|
|
38
38
|
excludeTypes?: boolean;
|
|
39
|
-
zoom?:
|
|
40
|
-
maxZoom?: number | undefined;
|
|
39
|
+
zoom?: Record<string, number>;
|
|
41
40
|
apiUrl?: string;
|
|
42
41
|
fetchParameters?: RequestInit;
|
|
43
42
|
iconsBaseUrl?: string;
|