shadcn-map 0.1.4 → 0.1.6
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.
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
autoClusterRadius?: number
|
|
50
50
|
/** Max zoom to cluster at for auto clustering */
|
|
51
51
|
autoClusterMaxZoom?: number
|
|
52
|
+
/** URL to a hosted MapLibre GL CSP worker script. Set this to fix map loading in restricted environments (e.g. in-app browsers like Facebook Messenger) that block blob: URL workers. Point to a copy of maplibre-gl-csp-worker.js in your static folder. */
|
|
53
|
+
workerUrl?: string
|
|
52
54
|
}
|
|
53
55
|
</script>
|
|
54
56
|
|
|
@@ -86,6 +88,7 @@
|
|
|
86
88
|
autoCluster = false,
|
|
87
89
|
autoClusterRadius = 50,
|
|
88
90
|
autoClusterMaxZoom = 14,
|
|
91
|
+
workerUrl,
|
|
89
92
|
}: MapProps = $props()
|
|
90
93
|
|
|
91
94
|
let container: HTMLDivElement
|
|
@@ -153,6 +156,10 @@
|
|
|
153
156
|
})
|
|
154
157
|
|
|
155
158
|
onMount(() => {
|
|
159
|
+
if (workerUrl) {
|
|
160
|
+
maplibregl.setWorkerUrl(workerUrl)
|
|
161
|
+
}
|
|
162
|
+
|
|
156
163
|
const protocol = new Protocol()
|
|
157
164
|
maplibregl.addProtocol('pmtiles', protocol.tile)
|
|
158
165
|
|
|
@@ -56,6 +56,8 @@ export interface MapProps {
|
|
|
56
56
|
autoClusterRadius?: number;
|
|
57
57
|
/** Max zoom to cluster at for auto clustering */
|
|
58
58
|
autoClusterMaxZoom?: number;
|
|
59
|
+
/** URL to a hosted MapLibre GL CSP worker script. Set this to fix map loading in restricted environments (e.g. in-app browsers like Facebook Messenger) that block blob: URL workers. Point to a copy of maplibre-gl-csp-worker.js in your static folder. */
|
|
60
|
+
workerUrl?: string;
|
|
59
61
|
}
|
|
60
62
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
61
63
|
declare const Map: import("svelte").Component<MapProps, {}, "">;
|
package/dist/styles/dark.js
CHANGED
|
@@ -153,7 +153,7 @@ export function createDarkStyle(tilesUrl, options = {}) {
|
|
|
153
153
|
'source': 'protomaps',
|
|
154
154
|
'source-layer': 'places',
|
|
155
155
|
'minzoom': 6,
|
|
156
|
-
'filter': ['in', 'kind', '
|
|
156
|
+
'filter': ['in', 'kind', 'locality', 'region', 'country'],
|
|
157
157
|
'layout': {
|
|
158
158
|
'text-field': ['get', 'name'],
|
|
159
159
|
'text-font': ['Noto Sans Regular'],
|
package/dist/styles/light.js
CHANGED
|
@@ -153,7 +153,7 @@ export function createLightStyle(tilesUrl, options = {}) {
|
|
|
153
153
|
'source': 'protomaps',
|
|
154
154
|
'source-layer': 'places',
|
|
155
155
|
'minzoom': 6,
|
|
156
|
-
'filter': ['in', 'kind', '
|
|
156
|
+
'filter': ['in', 'kind', 'locality', 'region', 'country'],
|
|
157
157
|
'layout': {
|
|
158
158
|
'text-field': ['get', 'name'],
|
|
159
159
|
'text-font': ['Noto Sans Regular'],
|
package/package.json
CHANGED