@maptiler/geocoding-control 0.0.91 → 0.0.92
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/FeatureItem.svelte +8 -7
- package/FeatureItem.svelte.d.ts +1 -0
- package/GeocodingControl.svelte +2 -0
- package/GeocodingControl.svelte.d.ts +1 -0
- package/README.md +3 -0
- package/leaflet.js +2519 -2492
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +5 -5
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +2603 -2576
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +5 -5
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2602 -2575
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +5 -5
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +4 -4
- package/react.js +612 -585
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/types.d.ts +7 -1
package/FeatureItem.svelte
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let selected = false;
|
|
3
3
|
export let showPlaceType;
|
|
4
4
|
export let missingIconsCache;
|
|
5
|
+
export let iconsBaseUrl;
|
|
5
6
|
const categories = feature.properties?.categories;
|
|
6
7
|
let category;
|
|
7
8
|
let imageUrl;
|
|
@@ -11,7 +12,7 @@ $: {
|
|
|
11
12
|
index--;
|
|
12
13
|
category = categories?.[index];
|
|
13
14
|
imageUrl = category
|
|
14
|
-
?
|
|
15
|
+
? iconsBaseUrl + category.replace(/ /g, "_") + ".svg"
|
|
15
16
|
: undefined;
|
|
16
17
|
} while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));
|
|
17
18
|
}
|
|
@@ -35,17 +36,17 @@ function handleImgError(e) {
|
|
|
35
36
|
on:error={(e) => handleImgError(e.currentTarget)}
|
|
36
37
|
/>
|
|
37
38
|
{:else if feature.address}
|
|
38
|
-
<img src="
|
|
39
|
+
<img src={iconsBaseUrl + "housenumber.svg"} alt={placeType} />
|
|
39
40
|
{:else if feature.properties?.kind === "road" || feature.properties?.kind === "road_relation"}
|
|
40
|
-
<img src="
|
|
41
|
+
<img src={iconsBaseUrl + "road.svg"} alt={placeType} />
|
|
41
42
|
{:else if feature.id.startsWith("address.")}
|
|
42
|
-
<img src="
|
|
43
|
+
<img src={iconsBaseUrl + "street.svg"} alt={placeType} />
|
|
43
44
|
{:else if feature.id.startsWith("postal_code.")}
|
|
44
|
-
<img src="
|
|
45
|
+
<img src={iconsBaseUrl + "postal_code.svg"} alt={placeType} />
|
|
45
46
|
{:else if feature.id.startsWith("poi.")}
|
|
46
|
-
<img src="
|
|
47
|
+
<img src={iconsBaseUrl + "poi.svg"} alt={placeType} />
|
|
47
48
|
{:else}
|
|
48
|
-
<img src="
|
|
49
|
+
<img src={iconsBaseUrl + "area.svg"} alt={placeType} />
|
|
49
50
|
{/if}
|
|
50
51
|
|
|
51
52
|
<span class="texts">
|
package/FeatureItem.svelte.d.ts
CHANGED
package/GeocodingControl.svelte
CHANGED
|
@@ -39,6 +39,7 @@ export let zoom = 16;
|
|
|
39
39
|
export let maxZoom = 18;
|
|
40
40
|
export let apiUrl = import.meta.env.VITE_API_URL;
|
|
41
41
|
export let fetchParameters = {};
|
|
42
|
+
export let iconsBaseUrl = "icons/";
|
|
42
43
|
export function focus() {
|
|
43
44
|
input.focus();
|
|
44
45
|
}
|
|
@@ -462,6 +463,7 @@ function unwrapBbox(bbox0) {
|
|
|
462
463
|
on:mouseenter={() => (selectedItemIndex = i)}
|
|
463
464
|
on:focus={() => pick(feature)}
|
|
464
465
|
{missingIconsCache}
|
|
466
|
+
{iconsBaseUrl}
|
|
465
467
|
/>
|
|
466
468
|
{/each}
|
|
467
469
|
</ul>
|
|
@@ -34,6 +34,7 @@ declare const __propDef: {
|
|
|
34
34
|
maxZoom?: number | undefined;
|
|
35
35
|
apiUrl?: string | undefined;
|
|
36
36
|
fetchParameters?: RequestInit | undefined;
|
|
37
|
+
iconsBaseUrl?: string | undefined;
|
|
37
38
|
focus?: (() => void) | undefined;
|
|
38
39
|
blur?: (() => void) | undefined;
|
|
39
40
|
setQuery?: ((value: string, submit?: boolean) => void) | undefined;
|
package/README.md
CHANGED
|
@@ -128,6 +128,9 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
128
128
|
- `limit`: `number` - Maximum number of results to show. Default `5`.
|
|
129
129
|
- `country`: `string | string[]` - Limit search to specified country(ies). Default `undefined` (use all countries). Specify as [alpha-2 ISO 3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) lowercase code.
|
|
130
130
|
- `types`: `string[]` - Filter of feature types to return. Default `undefined` (all available feature types are returned).
|
|
131
|
+
- `apiUrl`: `string` - Geocoding API URL. Default MapTiler Geocoding API URL.
|
|
132
|
+
- `fetchParameters`: `RequestInit` - Extra fetch parameters. Default `undefined`.
|
|
133
|
+
- `iconsBaseUrl`: `string` - Base URL for POI icons. Default `"icons/"`.
|
|
131
134
|
|
|
132
135
|
### Methods
|
|
133
136
|
|