@maptiler/geocoding-control 0.0.91-git.9f388b → 0.0.91
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 +16 -10
- package/FeatureItem.svelte.d.ts +1 -0
- package/GeocodingControl.svelte +2 -0
- package/leaflet.js +734 -723
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +4 -4
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +849 -838
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +4 -4
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +848 -837
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +4 -4
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +6 -6
- package/react.js +736 -725
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
package/FeatureItem.svelte
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
<script>export let feature;
|
|
2
2
|
export let selected = false;
|
|
3
3
|
export let showPlaceType;
|
|
4
|
+
export let missingIconsCache;
|
|
4
5
|
const categories = feature.properties?.categories;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$:
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
let category;
|
|
7
|
+
let imageUrl;
|
|
8
|
+
$: index = categories?.length ?? 0;
|
|
9
|
+
$: {
|
|
10
|
+
do {
|
|
11
|
+
index--;
|
|
12
|
+
category = categories?.[index];
|
|
13
|
+
imageUrl = category
|
|
14
|
+
? `/icons/${category.replace(/ /g, "_")}.svg`
|
|
15
|
+
: undefined;
|
|
16
|
+
} while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));
|
|
17
|
+
}
|
|
10
18
|
$: placeType = feature.id.startsWith("poi.")
|
|
11
19
|
? feature.properties?.categories?.join(", ")
|
|
12
20
|
: feature.properties?.place_type_name?.[0] ?? feature.place_type[0];
|
|
13
21
|
function handleImgError(e) {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
e.style.visibility = "hidden";
|
|
22
|
+
if (imageUrl) {
|
|
23
|
+
missingIconsCache.add(imageUrl);
|
|
19
24
|
}
|
|
25
|
+
index--;
|
|
20
26
|
}
|
|
21
27
|
</script>
|
|
22
28
|
|
package/FeatureItem.svelte.d.ts
CHANGED
package/GeocodingControl.svelte
CHANGED
|
@@ -72,6 +72,7 @@ let abortController;
|
|
|
72
72
|
let searchTimeoutRef;
|
|
73
73
|
let focusedDelayed;
|
|
74
74
|
let prevIdToFly;
|
|
75
|
+
const missingIconsCache = new Set();
|
|
75
76
|
const dispatch = createEventDispatcher();
|
|
76
77
|
$: if (!trackProximity) {
|
|
77
78
|
proximity = undefined;
|
|
@@ -460,6 +461,7 @@ function unwrapBbox(bbox0) {
|
|
|
460
461
|
selected={selectedItemIndex === i}
|
|
461
462
|
on:mouseenter={() => (selectedItemIndex = i)}
|
|
462
463
|
on:focus={() => pick(feature)}
|
|
464
|
+
{missingIconsCache}
|
|
463
465
|
/>
|
|
464
466
|
{/each}
|
|
465
467
|
</ul>
|