solid-map-gl 1.1.6 → 1.1.10
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/README.md +18 -21
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/source/components/Control/index.jsx +1 -1
- package/dist/source/components/Layer/index.jsx +14 -10
- package/dist/source/components/MapGL/index.jsx +26 -11
- package/dist/source/index.jsx +1 -1
- package/dist/types/components/MapGL/index.d.ts +3 -2
- package/dist/types/index.d.ts +2 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Solid Mapbox GL JS
|
|
4
4
|
|
|
5
|
-

|
|
11
|
-

|
|
12
|
-

|
|
5
|
+
[
|
|
6
|
+
](https://www.npmjs.com/package/solid-map-gl)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[
|
|
9
|
+
](https://bundlephobia.com/package/solid-map-gl)
|
|
13
10
|
|
|
14
11
|
[Solid](https://www.solidjs.com/) Component Library for [Mapbox GL JS.](https://github.com/mapbox/mapbox-gl-js) Mapbox GL JS is a JavaScript library that renders interactive maps from vector tiles and Mapbox styles using WebGL. This project is intended to be as close as possible to the [Mapbox GL JS API.](https://docs.mapbox.com/mapbox-gl-js/api/)
|
|
15
12
|
|
|
@@ -96,7 +93,7 @@ import MapGL, { Viewport } from 'solid-map-gl'
|
|
|
96
93
|
const [viewport, setViewport] = createSignal({
|
|
97
94
|
center: [-122.41, 37.78],
|
|
98
95
|
zoom: 11
|
|
99
|
-
} as Viewport)
|
|
96
|
+
} as Viewport);
|
|
100
97
|
|
|
101
98
|
<MapGL
|
|
102
99
|
options={{
|
|
@@ -117,7 +114,7 @@ const [viewport, setViewport] = createSignal({
|
|
|
117
114
|
Except for layers of the `background` type, each layer needs to refer to a source. Either buy referencing the `id` in `sourceId` or by nesting the layer within the source component. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.
|
|
118
115
|
|
|
119
116
|
```jsx
|
|
120
|
-
import MapGL, { Source, Layer } from 'solid-map-gl'
|
|
117
|
+
import MapGL, { Source, Layer } from 'solid-map-gl';
|
|
121
118
|
|
|
122
119
|
<MapGL
|
|
123
120
|
options={{
|
|
@@ -226,8 +223,8 @@ import { MapboxLayer } from '@deck.gl/mapbox'
|
|
|
226
223
|
import { ScatterplotLayer } from '@deck.gl/layers'
|
|
227
224
|
|
|
228
225
|
const [viewport, setViewport] = createSignal({
|
|
229
|
-
|
|
230
|
-
|
|
226
|
+
center: [-74.5, 40],
|
|
227
|
+
zoom: 9,
|
|
231
228
|
})
|
|
232
229
|
|
|
233
230
|
const myDeckLayer = new MapboxLayer({
|
|
@@ -236,17 +233,17 @@ const myDeckLayer = new MapboxLayer({
|
|
|
236
233
|
data: [{ position: [-74.5, 40], size: 1000 }],
|
|
237
234
|
getPosition: d => d.position,
|
|
238
235
|
getRadius: d => d.size,
|
|
239
|
-
getColor: [255, 0, 0]
|
|
236
|
+
getColor: [255, 0, 0],
|
|
240
237
|
})
|
|
241
238
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
;<MapGL
|
|
240
|
+
options={{
|
|
241
|
+
accessToken: { MAPBOX_ACCESS_TOKEN },
|
|
242
|
+
style: 'mapbox://styles/mapbox/light-v10',
|
|
243
|
+
}}
|
|
244
|
+
viewport={viewport()}
|
|
245
|
+
onViewportChange={evt => setViewport(evt)}>
|
|
246
|
+
<Layer customLayer={myDeckLayer} />
|
|
250
247
|
</MapGL>
|
|
251
248
|
```
|
|
252
249
|
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{template,createComponent,
|
|
1
|
+
import{template,createComponent,memo,effect,classList,insert}from"solid-js/web";import{useTransition,createContext,useContext,onCleanup,onMount,createEffect,createMemo,createUniqueId,createSignal}from"solid-js";import mapboxgl from"mapbox-gl";const _tmpl$$2=template("<main></main>",2),[pending,start]=useTransition(),MapContext=createContext(),useMap=()=>useContext(MapContext),MapGL=n=>{let a,t;onCleanup(()=>a.remove()),onMount(()=>{a=new mapboxgl.Map({...n.options,container:t,interactive:n.onViewportChange,bounds:n.viewport.bounds,center:n.viewport.center,zoom:n.viewport.zoom||null,pitch:n.viewport.pitch||null,bearing:n.viewport.bearing||null,fitBoundsOptions:{padding:n.viewport.padding}}),a.container=void 0}),createEffect(()=>a.on("mousemove",e=>n.onMouseMove(e.lngLat))),createMemo(()=>a&&a.setStyle(n.options.style));const e=e=>{e.isInternal||(e={center:a.getCenter(),zoom:a.getZoom(),pitch:a.getPitch(),bearing:a.getBearing(),padding:n.viewport.padding,bounds:n.viewport.bounds},n.onViewportChange(e))};createEffect(()=>n.onViewportChange&&a.on("dragend",e).on("moveend",e).on("zoomend",e).on("rotateend",e).on("pitchend",e).on("boxzoomend",e)),createMemo(()=>{var e;a&&(e=a.cameraForBounds(n.viewport.bounds,{padding:n.viewport.padding}),n.onViewportChange({...n.viewport,...e}))}),createEffect(async e=>{var t=n.viewport,o={...t.zoom!=e.zoom&&{zoom:t.zoom},...t.padding!=e.padding&&{padding:t.padding},...t.bearing!=e.bearing&&{bearing:t.bearing},...t.pitch!=e.pitch&&{pitch:t.pitch},...t.center!=e.center&&{center:t.center.lng?[t.center.lng,t.center.lat]:t.center}};if(Object.keys(o).length)switch(a.stop(),n.transitionType){case"easeTo":a.easeTo(o,{isInternal:!0});case"jumpTo":a.jumpTo(o,{isInternal:!0});default:a.flyTo(o,{isInternal:!0})}return t},n.viewport);let o=0;return createEffect(()=>{n.triggerResize&&(o=0,window.requestAnimationFrame(function e(){o<15&&(o++,window.requestAnimationFrame(e),start(()=>a.resize()))}))}),createComponent(MapContext.Provider,{value:()=>a,get children(){return[memo(()=>n.children),(()=>{const a=_tmpl$$2.cloneNode(!0),e=t;return"function"==typeof e?e(a):t=a,a.style.setProperty("height","100%"),a.style.setProperty("width","100%"),effect(e=>{var t=n.class||"",o=n.classList;return t!==e._v$&&(a.className=e._v$=t),e._v$2=classList(a,o,e._v$2),e},{_v$:void 0,_v$2:void 0}),a})()]}})},SourceContext=createContext(),useSource=()=>useContext(SourceContext),SourceComponent=t=>{const o=useMap();return t.id=t.id||createUniqueId(),onMount(async()=>{o().isStyleLoaded()||await o().once("styledata"),o().getSource(t.id)||o().addSource(t.id,t.source)}),onCleanup(()=>{o().getStyle().layers.forEach(e=>e.source===t.id&&o().removeLayer(e.id)),o().getSource(t.id)&&o().removeSource(t.id)}),createEffect(async()=>{("geojson"===t.source.type||t.source.data)&&o().getSource(t.id)&&o().getSource(t.id).setData(t.source.data)}),createComponent(SourceContext.Provider,{get value(){return{id:t.id}},get children(){return t.children}})},diff=(a={},n={})=>{return[...new Set([...Object.keys(a),...Object.keys(n)])].reduce((e,t)=>{var o=a[t];return o!==n[t]&&e.push([t,o]),e},[])},Layer=o=>{const a=useMap(),t=useSource();return o.id=o.id||createUniqueId(),onMount(async()=>{a().isStyleLoaded()||await a().once("styledata"),a().getLayer(o.id)||a().addLayer(o.layer||{...o.style,id:o.id,source:t.id},o.beforeType?a().getStyle().layers.find(e=>e.type===o.beforeType).id:o.beforeId)}),createEffect(e=>{if(o.style&&a().getSource(t.id)&&a().getLayer(o.id))return o.style.layout!==(null==e?void 0:e.layout)&&diff(o.style.layout,null==e?void 0:e.layout).forEach(([e,t])=>a().setLayoutProperty(o.id,e,t,{validate:!1})),o.style.paint!==(null==e?void 0:e.paint)&&diff(o.style.paint,null==e?void 0:e.paint).forEach(([e,t])=>a().setPaintProperty(o.id,e,t,{validate:!1})),o.style.minzoom===(null==e?void 0:e.minzoom)&&o.style.maxzoom===(null==e?void 0:e.maxzoom)||a().setLayerZoomRange(o.id,o.style.minzoom,o.style.maxzoom),o.style.filter!==(null==e?void 0:e.filter)&&a().setFilter(o.id,o.style.filter,{validate:!1}),o.style},o.style),createEffect(e=>{if(void 0!==o.visible&&o.visible!==e&&a().getSource(t.id)&&a().getLayer(o.id))return a().setLayoutProperty(o.id,"visibility",o.visible?"visible":"none",{validate:!1}),o.visible},o.visible),createEffect(async()=>{o.filter&&(a().isStyleLoaded()||await a().once("styledata"),a().setFilter(o.id,o.filter))}),createEffect(async()=>{o.featureState&&o.featureState.id&&(a().isStyleLoaded()||await a().once("styledata"),a().removeFeatureState({source:t.id,sourceLayer:o.style["source-layer"]}),a().setFeatureState({source:t.id,sourceLayer:o.style["source-layer"],id:o.featureState.id},o.featureState.state))}),o.children},Fog=e=>{const t=useMap();return onMount(async()=>{t().isStyleLoaded()||await t().once("styledata"),t().setFog(e.style)}),onCleanup(()=>t().setFog(null)),createEffect(async()=>{void 0!==e.visible&&(t().isStyleLoaded()||await t().once("styledata"),t().setFog(e.visible?e.style:null))}),e.children},Sky=e=>{const t=useMap(),o="_sky";return onMount(async()=>{t().isStyleLoaded()||await t().once("styledata"),t().getLayer(o)||t().addLayer({...e.style,id:o})}),onCleanup(()=>t().getLayer(o)&&t().removeLayer(o)),createEffect(async()=>{void 0!==e.visible&&(t().isStyleLoaded()||await t().once("styledata"),t().setLayoutProperty(o,"visibility",e.visible?"visible":"none"))}),e.children},Terrain=e=>{const t=useMap(),o=useSource();return onMount(async()=>{t().isStyleLoaded()||await t().once("styledata"),t().setTerrain({...e.style,source:o.id})}),onCleanup(()=>t().setTerrain(null)),createEffect(async()=>{void 0!==e.visible&&(t().isStyleLoaded()||await t().once("styledata"),t().setTerrain(e.visible?e.style:null))}),e.children},Control=t=>{const o=useMap(),[e,a]=createSignal(null);return onMount(async()=>{let e;switch(t.type){case"navigation":e=new mapboxgl.NavigationControl(t.options);break;case"scale":e=new mapboxgl.ScaleControl(t.options);break;case"attribution":e=new mapboxgl.AttributionControl(t.options);break;case"fullscreen":e=new mapboxgl.FullscreenControl(t.options||{container:o().container});break;case"geolocate":e=new mapboxgl.GeolocateControl(t.options)}e&&o().addControl(e,t.position),a(e)}),onCleanup(()=>o().removeControl(e())),t.children},_tmpl$$1=template("<div></div>",2),Marker=t=>{const o=useMap();let a=null;return onMount(async()=>{var e;a=new mapboxgl.Marker(t.options).setLngLat(t.lnglat).setPopup(t.children?(new mapboxgl.Popup).setDOMContent((e=_tmpl$$1.cloneNode(!0),insert(e,()=>t.children),e)):null).addTo(o())}),onCleanup(()=>a.remove()),createEffect(()=>a.setLngLat(t.lnglat)),[]},_tmpl$=template("<div></div>",2),Popup=t=>{const o=useMap();let a=null;return onMount(async()=>{var e;a=new mapboxgl.Popup(t.options).setLngLat(t.lnglat).setDOMContent((e=_tmpl$.cloneNode(!0),insert(e,()=>t.children),e)).addTo(o())}),onCleanup(()=>a.remove()),createEffect(()=>a.setLngLat(t.lnglat)),createEffect(()=>a.setDOMContent((()=>{var e=_tmpl$.cloneNode(!0);return insert(e,()=>t.children),e})())),[]},Image=o=>{const a=useMap();return onMount(async()=>{a().isStyleLoaded()||await a().once("styledata"),o.url?a().loadImage(o.url,(e,t)=>{if(e)throw e;a().hasImage(o.id)||a().addImage(o.id,t)}):a().hasImage(o.id)||a().addImage(o.id,o.image,o.options)}),onCleanup(()=>a().hasImage(o.id)&&a().removeImage(o.id)),createEffect(async()=>{o.image&&o.url||(o.url?a().loadImage(o.url,(e,t)=>{if(e)throw e;a().hasImage(o.id)||a().updateImage(o.id,t)}):a().hasImage(o.id)&&a().updateImage(o.id,o.image))}),[]};export{Control,Fog,Image,Layer,Marker,Popup,Sky,SourceComponent as Source,Terrain,MapGL as default,useMap};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/MapGL/index.tsx","../../src/components/Source/index.tsx","../../src/components/Layer/index.tsx","../../src/components/Fog/index.tsx","../../src/components/Sky/index.tsx","../../src/components/Terrain/index.tsx","../../src/components/Control/index.tsx","../../src/components/Marker/index.tsx","../../src/components/Popup/index.tsx","../../src/components/Image/index.tsx"],"sourcesContent":["import {\n createEffect,\n onMount,\n onCleanup,\n createContext,\n useContext,\n Component,\n useTransition,\n} from 'solid-js'\nimport mapboxgl from 'mapbox-gl'\nimport 'mapbox-gl/dist/mapbox-gl.css'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type MapboxOptions from 'mapbox-gl/src/ui/map'\nimport type MapMouseEvent from 'mapbox-gl/src/ui/events'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\nimport type { LngLatBounds } from 'mapbox-gl/src/geo/lng_lat_bounds.js'\n\nexport type Viewport = {\n center?: LngLatLike\n bounds?: LngLatBounds\n zoom?: number\n pitch?: number\n bearing?: number\n padding?: number\n}\n\nconst [pending, start] = useTransition()\n\nconst MapContext = createContext<MapboxMap>()\nconst useMap = () => useContext(MapContext)\n\nconst MapGL: Component<{\n class?: string\n classList?: {\n [k: string]: boolean | undefined\n }\n viewport?: Viewport\n options?: MapboxOptions\n children?: Element[]\n triggerResize?: boolean\n transitionType?: 'flyTo' | 'easeTo' | 'jumpTo'\n onMouseMove?: (event: MapMouseEvent) => void\n onViewportChange?: (viewport: Viewport) => void\n}> = props => {\n let map: MapboxMap\n let mapRef: HTMLElement\n\n onCleanup(() => map.remove())\n\n onMount(() => {\n map = new mapboxgl.Map({\n ...props.options,\n container: mapRef,\n bounds: props.viewport.bounds,\n center: props.viewport.center,\n zoom: props.viewport.zoom || null,\n pitch: props.viewport.pitch || null,\n bearing: props.viewport.bearing || null,\n fitBoundsOptions: { padding: props.viewport.padding },\n } as MapboxOptions)\n })\n\n createEffect(\n () =>\n props.onMouseMove &&\n map.on('mousemove', event => props.onMouseMove(event.lngLat))\n )\n\n const _onViewportChange = evt => {\n if (evt.isInternal) return\n const viewport: Viewport = {\n center: map.getCenter(),\n zoom: map.getZoom(),\n pitch: map.getPitch(),\n bearing: map.getBearing(),\n padding: props.viewport.padding,\n bounds: props.viewport.bounds,\n }\n props.onViewportChange(viewport)\n }\n\n createEffect(\n () =>\n props.onViewportChange &&\n map\n .on('dragend', _onViewportChange)\n .on('moveend', _onViewportChange)\n .on('zoomend', _onViewportChange)\n .on('rotateend', _onViewportChange)\n .on('pitchend', _onViewportChange)\n .on('boxzoomend', _onViewportChange)\n )\n\n createEffect(prev => {\n if (props.viewport.bounds != prev) {\n const camera = map.cameraForBounds(props.viewport.bounds)\n props.onViewportChange({\n ...props.viewport,\n ...camera,\n })\n }\n return props.viewport.bounds\n }, props.viewport.bounds)\n\n createEffect(async (prev: Viewport) => {\n const vp: Viewport = props.viewport\n const nvp: Viewport = {\n ...(vp.zoom != prev.zoom && { zoom: vp.zoom }),\n ...(vp.padding != prev.padding && { padding: vp.padding }),\n ...(vp.bearing != prev.bearing && { bearing: vp.bearing }),\n ...(vp.pitch != prev.pitch && { pitch: vp.pitch }),\n ...(vp.center != prev.center && {\n center: vp.center.lng ? [vp.center.lng, vp.center.lat] : vp.center,\n }),\n }\n if (Object.keys(nvp).length) {\n map.stop()\n switch (props.transitionType) {\n case 'easeTo':\n map.easeTo(nvp, { isInternal: true })\n case 'jumpTo':\n map.jumpTo(nvp, { isInternal: true })\n default:\n map.flyTo(nvp, { isInternal: true })\n }\n }\n return vp\n }, props.viewport)\n\n let index = 0\n\n createEffect(() => {\n if (props.triggerResize) {\n index = 0\n window.requestAnimationFrame(function loop() {\n if (index < 15) {\n index++\n window.requestAnimationFrame(loop)\n start(() => map.resize())\n }\n })\n }\n })\n\n return (\n <MapContext.Provider value={() => map}>\n <main\n ref={mapRef}\n class={props.class || ''}\n classList={props.classList}\n style={{ height: '100%', width: '100%' }}>\n {props.children}\n </main>\n </MapContext.Provider>\n )\n}\n\nexport { MapGL as default, useMap }\n","import {\n onMount,\n onCleanup,\n createEffect,\n Component,\n createContext,\n useContext,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n Source,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nconst SourceContext = createContext<Source>()\n\nconst useSource = (): Source => useContext(SourceContext)\n\nconst SourceComponent: Component<{\n id?: string\n source: SourceSpecification\n}> = props => {\n const map: MapboxMap = useMap()\n props.id = props.id || createUniqueId()\n // Add Source\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n !map().getSource(props.id) && map().addSource(props.id, props.source)\n })\n\n // Remove Source\n onCleanup(() => {\n map()\n .getStyle()\n .layers.forEach(\n layer => layer.source === props.id && map().removeLayer(layer.id)\n )\n map().getSource(props.id) && map().removeSource(props.id)\n })\n\n // Update GeoJSON Data\n createEffect(async () => {\n if (props.source.type !== 'geojson' && !props.source.data) return\n\n map().getSource(props.id) &&\n map().getSource(props.id).setData(props.source.data)\n })\n\n return (\n <SourceContext.Provider value={{ id: props.id }}>\n {props.children}\n </SourceContext.Provider>\n )\n}\n\nexport { SourceComponent as default, useSource }\n","import { onMount, createEffect, Component, createUniqueId } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSource } from '../Source'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n FilterSpecification,\n StyleSpecification,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\nimport type { CustomLayerInterface } from 'mapbox-gl/src/style/style_layer/custom_style_layer'\n\nconst diff = (\n newProps: StyleSpecification = {},\n prevProps: StyleSpecification = {}\n) => {\n const keys = new Set([...Object.keys(newProps), ...Object.keys(prevProps)])\n return [...keys].reduce((acc, key: string) => {\n const value = newProps[key]\n if (value !== prevProps[key]) {\n acc.push([key, value])\n }\n return acc\n }, [])\n}\n\nconst Layer: Component<{\n id?: string\n style?: StyleSpecification\n layer?: CustomLayerInterface\n filter?: FilterSpecification\n visible?: boolean\n sourceId?: string\n beforeType?:\n | 'background'\n | 'fill'\n | 'line'\n | 'symbol'\n | 'raster'\n | 'circle'\n | 'fill-extrusion'\n | 'heatmap'\n | 'hillshade'\n | 'sky'\n beforeId?: string\n featureState?: { id: number | string; state: object }\n}> = props => {\n const map: MapboxMap = useMap()\n const source: SourceSpecification = useSource()\n props.id = props.id || createUniqueId()\n // Add Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n\n if (map().getLayer(props.id)) return\n\n map().addLayer(\n props.layer || {\n ...props.style,\n id: props.id,\n source: source.id,\n },\n props.beforeType\n ? map()\n .getStyle()\n .layers.find(l => l.type === props.beforeType).id\n : props.beforeId\n )\n })\n\n // Update Style\n createEffect(async (prev: StyleSpecification) => {\n if (\n !props.style ||\n !map().getSource(source.id) ||\n !map().getLayer(props.id)\n )\n return\n\n !map().isSourceLoaded(source.id) && (await map().once('data'))\n\n diff(props.style.paint, prev.paint).forEach(([key, value]) =>\n map().setPaintProperty(props.id, key, value)\n )\n\n diff(props.style.layout, prev.layout).forEach(([key, value]) =>\n map().setLayoutProperty(props.id, key, value)\n )\n\n if (\n props.style.minzoom !== prev.minzoom ||\n props.style.maxzoom !== prev.max\n )\n map().setLayerZoomRange(\n props.id,\n props.style.minzoom,\n props.style.maxzoom\n )\n\n return props.style\n }, props.style)\n\n // Update Visibility\n createEffect(async () => {\n if (\n props.visible === undefined ||\n !map().getSource(source.id) ||\n !map().getLayer(props.id)\n )\n return\n\n !map().isSourceLoaded(source.id) && (await map().once('data'))\n map().setLayoutProperty(\n props.id,\n 'visibility',\n props.visible ? 'visible' : 'none',\n { validate: false }\n )\n })\n\n // Update Filter\n createEffect(async () => {\n if (!props.filter) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFilter(props.id, props.filter)\n })\n\n // Update Feature State\n createEffect(async () => {\n if (!props.featureState || !props.featureState.id) return\n\n map().loaded() ? null : await map().once('render')\n\n map().removeFeatureState({\n source: source.id,\n sourceLayer: props.style['source-layer'],\n })\n map().setFeatureState(\n {\n source: source.id,\n sourceLayer: props.style['source-layer'],\n id: props.featureState.id,\n },\n props.featureState.state\n )\n })\n\n return props.children\n}\n\nexport default Layer\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { FogSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nconst Fog: Component<{\n style: FogSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n // Add Fog Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFog(props.style)\n })\n // Remove Fog Layer\n onCleanup(() => map().setFog(null))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFog(props.visible ? props.style : null)\n })\n\n return props.children\n}\n\nexport default Fog\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { StyleSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nconst Sky: Component<{\n style: StyleSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n const layerId = '_sky'\n // Add Sky Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n !map().getLayer(layerId) && map().addLayer({ ...props.style, id: layerId })\n })\n\n // Remove Sky Layer\n onCleanup(() => map().getLayer(layerId) && map().removeLayer(layerId))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setLayoutProperty(\n layerId,\n 'visibility',\n props.visible ? 'visible' : 'none'\n )\n })\n\n return props.children\n}\n\nexport default Sky\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSource } from '../Source'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n TerrainSpecification,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nconst Terrain: Component<{\n style: TerrainSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n const source: SourceSpecification = useSource()\n\n // Add Terrain Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setTerrain({ ...props.style, source: source.id })\n })\n\n // Remove Terrain Layer\n onCleanup(() => map().setTerrain(null))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setTerrain(props.visible ? props.style : null)\n })\n\n return props.children\n}\n\nexport default Terrain\n","import { onMount, onCleanup, createSignal, Component, lazy } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { Options as AttributionOptions } from 'mapbox-gl/src/ui/control/attribution_control'\nimport type { Options as FullscreenOptions } from 'mapbox-gl/src/ui/control/fullscreen_control'\nimport type { Options as GeolocateOptions } from 'mapbox-gl/src/ui/control/geolocate_control'\nimport type { Options as NavigationOptions } from 'mapbox-gl/src/ui/control/navigation_control'\nimport type { Options as ScaleOptions } from 'mapbox-gl/src/ui/control/scale_control'\n\nconst Control: Component<{\n type:\n | 'navigation'\n | 'scale'\n | 'attribution'\n | 'fullscreen'\n | 'geolocate'\n | 'language'\n | 'traffic'\n options?:\n | NavigationOptions\n | ScaleOptions\n | AttributionOptions\n | FullscreenOptions\n | GeolocateOptions\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n}> = props => {\n const map: MapboxMap = useMap()\n const [control, setControl] = createSignal(null)\n // Add Control\n onMount(async () => {\n let control\n\n switch (props.type) {\n case 'navigation':\n control = new mapboxgl.NavigationControl(props.options)\n break\n case 'scale':\n control = new mapboxgl.ScaleControl(props.options)\n break\n case 'attribution':\n control = new mapboxgl.AttributionControl(props.options)\n break\n case 'fullscreen':\n control = new mapboxgl.FullscreenControl(props.options)\n break\n case 'geolocate':\n control = new mapboxgl.GeolocateControl(props.options)\n break\n // case 'language':\n // // @ts-ignore\n // const MapboxLanguage = (await import('@mapbox/mapbox-gl-language'))\n // .default\n // control = new MapboxLanguage(props.options)\n // break\n // case 'traffic':\n // // @ts-ignore\n // const MapboxTraffic = (await import('@mapbox/mapbox-gl-traffic'))\n // .default\n // // @ts-ignore\n // await import('@mapbox/mapbox-gl-traffic/mapbox-gl-traffic.css')\n // control = new MapboxTraffic(props.options)\n // break\n }\n control && map().addControl(control, props.position)\n setControl(control)\n })\n\n onCleanup(() => map().removeControl(control()))\n\n return props.children\n}\n\nexport default Control\n","import { onMount, onCleanup, createEffect, Component, children } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { MarkerSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nconst Marker: Component<{\n options?: MarkerSpecification\n lnglat: LngLatLike\n}> = props => {\n const map: MapboxMap = useMap()\n let marker = null\n\n // Add Marker\n onMount(async () => {\n marker = new mapboxgl.Marker(props.options)\n .setLngLat(props.lnglat)\n .setPopup(\n props.children\n ? new mapboxgl.Popup().setDOMContent(<div>{props.children}</div>)\n : null\n )\n .addTo(map())\n })\n // Remove Marker\n onCleanup(() => marker.remove())\n\n // Update Position\n createEffect(() => marker.setLngLat(props.lnglat))\n\n return <></>\n}\n\nexport default Marker\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { PopupSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nconst Popup: Component<{\n options?: PopupSpecification\n lnglat: LngLatLike\n}> = props => {\n const map: MapboxMap = useMap()\n let popup = null\n\n // Add Popup\n onMount(async () => {\n popup = new mapboxgl.Popup(props.options)\n .setLngLat(props.lnglat)\n .setDOMContent(<div>{props.children}</div>)\n .addTo(map())\n })\n // Remove Popup\n onCleanup(() => popup.remove())\n\n // Update Position\n createEffect(() => popup.setLngLat(props.lnglat))\n\n // Update Content\n createEffect(() => popup.setDOMContent(<div>{props.children}</div>))\n\n return <></>\n}\n\nexport default Popup\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n StyleImageInterface,\n StyleImageMetadata,\n} from 'mapbox-gl/src/style/style_image'\n\nconst Image: Component<{\n id: string\n url?: string\n image?:\n | HTMLImageElement\n | ImageBitmap\n | ImageData\n | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }\n | StyleImageInterface\n options?: StyleImageMetadata\n}> = props => {\n const map: MapboxMap = useMap()\n // Add Image\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n if (props.url) {\n map().loadImage(props.url, (error, image) => {\n if (error) throw error\n !map().hasImage(props.id) && map().addImage(props.id, image)\n })\n } else {\n !map().hasImage(props.id) &&\n map().addImage(props.id, props.image, props.options)\n }\n })\n // Remove Image\n onCleanup(() => map().hasImage(props.id) && map().removeImage(props.id))\n\n // Update Image\n createEffect(async () => {\n if (props.image && props.url) return\n\n if (props.url) {\n map().loadImage(props.url, (error, image) => {\n if (error) throw error\n !map().hasImage(props.id) && map().updateImage(props.id, image)\n })\n } else {\n map().hasImage(props.id) && map().updateImage(props.id, props.image)\n }\n })\n\n return <></>\n}\n\nexport default Image\n"],"names":["pending","start","useTransition","MapContext","createContext","useMap","useContext","MapGL","props","map","mapRef","onCleanup","remove","onMount","mapboxgl","Map","options","container","bounds","viewport","center","zoom","pitch","bearing","fitBoundsOptions","padding","createEffect","onMouseMove","on","event","lngLat","_onViewportChange","evt","isInternal","getCenter","getZoom","getPitch","getBearing","onViewportChange","prev","camera","cameraForBounds","vp","nvp","lng","lat","Object","keys","length","stop","transitionType","easeTo","jumpTo","flyTo","index","triggerResize","window","requestAnimationFrame","loop","resize","Provider","value","children","class","classList","SourceContext","useSource","SourceComponent","id","createUniqueId","async","isStyleLoaded","once","getSource","addSource","source","getStyle","layers","forEach","layer","removeLayer","removeSource","type","data","setData","diff","newProps","prevProps","Set","reduce","acc","key","push","Layer","getLayer","addLayer","style","beforeType","find","l","beforeId","isSourceLoaded","paint","setPaintProperty","layout","setLayoutProperty","minzoom","maxzoom","max","setLayerZoomRange","undefined","visible","validate","filter","setFilter","featureState","loaded","removeFeatureState","sourceLayer","setFeatureState","state","Fog","setFog","Sky","layerId","Terrain","setTerrain","Control","control","setControl","createSignal","NavigationControl","ScaleControl","AttributionControl","FullscreenControl","GeolocateControl","addControl","position","removeControl","Marker","marker","setLngLat","lnglat","setPopup","Popup","setDOMContent","addTo","popup","Image","url","loadImage","error","image","hasImage","addImage","removeImage","updateImage"],"mappings":"8QA0BM,CAACA,QAASC,OAASC,gBAEnBC,WAAaC,gBACbC,OAAS,IAAMC,WAAWH,YAE1BI,MAYDC,QACCC,EACAC,EAEJC,UAAU,IAAMF,EAAIG,UAEpBC,QAAQ,KACNJ,EAAM,IAAIK,SAASC,IAAI,IAClBP,EAAMQ,QACTC,UAAWP,EACXQ,OAAQV,EAAMW,SAASD,OACvBE,OAAQZ,EAAMW,SAASC,OACvBC,KAAMb,EAAMW,SAASE,MAAQ,KAC7BC,MAAOd,EAAMW,SAASG,OAAS,KAC/BC,QAASf,EAAMW,SAASI,SAAW,KACnCC,iBAAkB,CAAEC,QAASjB,EAAMW,SAASM,aAIhDC,aACE,IACElB,EAAMmB,aACNlB,EAAImB,GAAG,YAAaC,GAASrB,EAAMmB,YAAYE,EAAMC,gBAGnDC,EAAoBC,IACpBA,EAAIC,aACFd,EAAqB,CACzBC,OAAQX,EAAIyB,YACZb,KAAMZ,EAAI0B,UACVb,MAAOb,EAAI2B,WACXb,QAASd,EAAI4B,aACbZ,QAASjB,EAAMW,SAASM,QACxBP,OAAQV,EAAMW,SAASD,QAEzBV,EAAM8B,iBAAiBnB,KAGzBO,aACE,IACElB,EAAM8B,kBACN7B,EACGmB,GAAG,UAAWG,GACdH,GAAG,UAAWG,GACdH,GAAG,UAAWG,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C,EAAiBJ,gBAEvBQ,QAAQyD,UACL7D,IAAM8D,uBAA0B9D,IAAM+D,KAAK,aACxChE,EAAM6I,IACR5I,IAAM6I,UAAU9I,EAAM6I,IAAK,CAACE,EAAOC,QAC7BD,EAAO,MAAMA,EAChB9I,IAAMgJ,SAASjJ,EAAM4D,KAAO3D,IAAMiJ,SAASlJ,EAAM4D,GAAIoF,KAGvD/I,IAAMgJ,SAASjJ,EAAM4D,KACpB3D,IAAMiJ,SAASlJ,EAAM4D,GAAI5D,EAAMgJ,MAAOhJ,EAAMQ,WAIlDL,UAAU,IAAMF,IAAMgJ,SAASjJ,EAAM4D,KAAO3D,IAAMkJ,YAAYnJ,EAAM4D,KAGpE1C,aAAa4C,UACP9D,EAAMgJ,OAAShJ,EAAM6I,MAErB7I,EAAM6I,IACR5I,IAAM6I,UAAU9I,EAAM6I,IAAK,CAACE,EAAOC,QAC7BD,EAAO,MAAMA,EAChB9I,IAAMgJ,SAASjJ,EAAM4D,KAAO3D,IAAMmJ,YAAYpJ,EAAM4D,GAAIoF,KAG3D/I,IAAMgJ,SAASjJ,EAAM4D,KAAO3D,IAAMmJ,YAAYpJ,EAAM4D,GAAI5D,EAAMgJ"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/MapGL/index.tsx","../../src/components/Source/index.tsx","../../src/components/Layer/index.tsx","../../src/components/Fog/index.tsx","../../src/components/Sky/index.tsx","../../src/components/Terrain/index.tsx","../../src/components/Control/index.tsx","../../src/components/Marker/index.tsx","../../src/components/Popup/index.tsx","../../src/components/Image/index.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n onMount,\n onCleanup,\n createContext,\n useContext,\n Component,\n useTransition,\n} from 'solid-js'\nimport mapboxgl from 'mapbox-gl'\nimport 'mapbox-gl/dist/mapbox-gl.css'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type MapboxOptions from 'mapbox-gl/src/ui/map'\nimport type MapMouseEvent from 'mapbox-gl/src/ui/events'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\nimport type { LngLatBounds } from 'mapbox-gl/src/geo/lng_lat_bounds.js'\n\nexport type Viewport = {\n center?: LngLatLike\n bounds?: LngLatBounds\n zoom?: number\n pitch?: number\n bearing?: number\n padding?: number\n}\n\nexport type TransitionType = 'flyTo' | 'easeTo' | 'jumpTo'\n\nconst [pending, start] = useTransition()\n\nconst MapContext = createContext<MapboxMap>()\nconst useMap = () => useContext(MapContext)\n\nconst MapGL: Component<{\n class?: string\n classList?: {\n [k: string]: boolean | undefined\n }\n viewport?: Viewport\n options?: MapboxOptions\n children?: Element | Element[]\n triggerResize?: boolean\n transitionType?: TransitionType\n onMouseMove?: (event: MapMouseEvent) => void\n onViewportChange?: (viewport: Viewport) => void\n}> = props => {\n let map: MapboxMap\n let mapRef: HTMLDivElement\n let containerRef: HTMLElement\n\n onCleanup(() => map.remove())\n\n onMount(() => {\n map = new mapboxgl.Map({\n ...props.options,\n container: mapRef,\n interactive: props.onViewportChange,\n bounds: props.viewport.bounds,\n center: props.viewport.center,\n zoom: props.viewport.zoom || null,\n pitch: props.viewport.pitch || null,\n bearing: props.viewport.bearing || null,\n fitBoundsOptions: { padding: props.viewport.padding },\n } as MapboxOptions)\n\n map.container = containerRef\n })\n\n createEffect(() => map.on('mousemove', evt => props.onMouseMove(evt.lngLat)))\n\n createMemo(() => map && map.setStyle(props.options.style))\n\n const _onViewportChange = evt => {\n if (evt.isInternal) return\n const viewport: Viewport = {\n center: map.getCenter(),\n zoom: map.getZoom(),\n pitch: map.getPitch(),\n bearing: map.getBearing(),\n padding: props.viewport.padding,\n bounds: props.viewport.bounds,\n }\n props.onViewportChange(viewport)\n }\n\n createEffect(\n () =>\n props.onViewportChange &&\n map\n .on('dragend', _onViewportChange)\n .on('moveend', _onViewportChange)\n .on('zoomend', _onViewportChange)\n .on('rotateend', _onViewportChange)\n .on('pitchend', _onViewportChange)\n .on('boxzoomend', _onViewportChange)\n )\n\n createMemo(() => {\n if (map) {\n const camera = map.cameraForBounds(props.viewport.bounds, {\n padding: props.viewport.padding,\n })\n props.onViewportChange({\n ...props.viewport,\n ...camera,\n })\n }\n })\n\n // createEffect(prev => {\n // if (props.viewport.bounds != prev) {\n // const camera = map.cameraForBounds(props.viewport.bounds, {\n // padding: props.viewport.padding,\n // })\n // props.onViewportChange({\n // ...props.viewport,\n // ...camera,\n // })\n // }\n // return props.viewport.bounds\n // }, props.viewport.bounds)\n\n createEffect(async (prev: Viewport) => {\n const vp: Viewport = props.viewport\n const nvp: Viewport = {\n ...(vp.zoom != prev.zoom && { zoom: vp.zoom }),\n ...(vp.padding != prev.padding && { padding: vp.padding }),\n ...(vp.bearing != prev.bearing && { bearing: vp.bearing }),\n ...(vp.pitch != prev.pitch && { pitch: vp.pitch }),\n ...(vp.center != prev.center && {\n center: vp.center.lng ? [vp.center.lng, vp.center.lat] : vp.center,\n }),\n }\n if (Object.keys(nvp).length) {\n map.stop()\n switch (props.transitionType) {\n case 'easeTo':\n map.easeTo(nvp, { isInternal: true })\n case 'jumpTo':\n map.jumpTo(nvp, { isInternal: true })\n default:\n map.flyTo(nvp, { isInternal: true })\n }\n }\n return vp\n }, props.viewport)\n\n let index = 0\n\n createEffect(() => {\n if (props.triggerResize) {\n index = 0\n window.requestAnimationFrame(function loop() {\n if (index < 15) {\n index++\n window.requestAnimationFrame(loop)\n start(() => map.resize())\n }\n })\n }\n })\n\n return (\n <MapContext.Provider value={() => map}>\n {props.children}\n <main\n ref={mapRef}\n class={props.class || ''}\n classList={props.classList}\n style={{ height: '100%', width: '100%' }}></main>\n </MapContext.Provider>\n )\n}\n\nexport { MapGL as default, useMap }\n","import {\n onMount,\n onCleanup,\n createEffect,\n Component,\n createContext,\n useContext,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n Source,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nconst SourceContext = createContext<Source>()\n\nconst useSource = (): Source => useContext(SourceContext)\n\nconst SourceComponent: Component<{\n id?: string\n source: SourceSpecification\n}> = props => {\n const map: MapboxMap = useMap()\n props.id = props.id || createUniqueId()\n // Add Source\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n !map().getSource(props.id) && map().addSource(props.id, props.source)\n })\n\n // Remove Source\n onCleanup(() => {\n map()\n .getStyle()\n .layers.forEach(\n layer => layer.source === props.id && map().removeLayer(layer.id)\n )\n map().getSource(props.id) && map().removeSource(props.id)\n })\n\n // Update GeoJSON Data\n createEffect(async () => {\n if (props.source.type !== 'geojson' && !props.source.data) return\n\n map().getSource(props.id) &&\n map().getSource(props.id).setData(props.source.data)\n })\n\n return (\n <SourceContext.Provider value={{ id: props.id }}>\n {props.children}\n </SourceContext.Provider>\n )\n}\n\nexport { SourceComponent as default, useSource }\n","import { onMount, createEffect, Component, createUniqueId } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSource } from '../Source'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n FilterSpecification,\n StyleSpecification,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\nimport type { CustomLayerInterface } from 'mapbox-gl/src/style/style_layer/custom_style_layer'\n\nconst diff = (\n newProps: StyleSpecification = {},\n prevProps: StyleSpecification = {}\n) => {\n const keys = new Set([...Object.keys(newProps), ...Object.keys(prevProps)])\n return [...keys].reduce((acc, key: string) => {\n const value = newProps[key]\n if (value !== prevProps[key]) {\n acc.push([key, value])\n }\n return acc\n }, [])\n}\n\nconst Layer: Component<{\n id?: string\n style?: StyleSpecification\n layer?: CustomLayerInterface\n filter?: FilterSpecification\n visible?: boolean\n sourceId?: string\n beforeType?:\n | 'background'\n | 'fill'\n | 'line'\n | 'symbol'\n | 'raster'\n | 'circle'\n | 'fill-extrusion'\n | 'heatmap'\n | 'hillshade'\n | 'sky'\n beforeId?: string\n featureState?: { id: number | string; state: object }\n}> = props => {\n const map: MapboxMap = useMap()\n const source: SourceSpecification = useSource()\n props.id = props.id || createUniqueId()\n // Add Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n\n if (map().getLayer(props.id)) return\n\n map().addLayer(\n props.layer || {\n ...props.style,\n id: props.id,\n source: source.id,\n },\n props.beforeType\n ? map()\n .getStyle()\n .layers.find(l => l.type === props.beforeType).id\n : props.beforeId\n )\n })\n\n // Update Style\n createEffect((prev: StyleSpecification) => {\n if (\n !props.style ||\n !map().getSource(source.id) ||\n !map().getLayer(props.id)\n )\n return\n\n if (props.style.layout !== prev?.layout)\n diff(props.style.layout, prev?.layout).forEach(([key, value]) =>\n map().setLayoutProperty(props.id, key, value, { validate: false })\n )\n\n if (props.style.paint !== prev?.paint)\n diff(props.style.paint, prev?.paint).forEach(([key, value]) =>\n map().setPaintProperty(props.id, key, value, { validate: false })\n )\n\n if (\n props.style.minzoom !== prev?.minzoom ||\n props.style.maxzoom !== prev?.maxzoom\n )\n map().setLayerZoomRange(\n props.id,\n props.style.minzoom,\n props.style.maxzoom\n )\n\n if (props.style.filter !== prev?.filter)\n map().setFilter(props.id, props.style.filter, { validate: false })\n\n return props.style\n }, props.style)\n\n // Update Visibility\n createEffect((prev: boolean) => {\n if (\n props.visible === undefined ||\n props.visible === prev ||\n !map().getSource(source.id) ||\n !map().getLayer(props.id)\n )\n return\n\n map().setLayoutProperty(\n props.id,\n 'visibility',\n props.visible ? 'visible' : 'none',\n { validate: false }\n )\n return props.visible\n }, props.visible)\n\n // Update Filter\n createEffect(async () => {\n if (!props.filter) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFilter(props.id, props.filter)\n })\n\n // Update Feature State\n createEffect(async () => {\n if (!props.featureState || !props.featureState.id) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n\n map().removeFeatureState({\n source: source.id,\n sourceLayer: props.style['source-layer'],\n })\n map().setFeatureState(\n {\n source: source.id,\n sourceLayer: props.style['source-layer'],\n id: props.featureState.id,\n },\n props.featureState.state\n )\n })\n\n return props.children\n}\n\nexport default Layer\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { FogSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nconst Fog: Component<{\n style: FogSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n // Add Fog Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFog(props.style)\n })\n // Remove Fog Layer\n onCleanup(() => map().setFog(null))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setFog(props.visible ? props.style : null)\n })\n\n return props.children\n}\n\nexport default Fog\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { StyleSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nconst Sky: Component<{\n style: StyleSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n const layerId = '_sky'\n // Add Sky Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n !map().getLayer(layerId) && map().addLayer({ ...props.style, id: layerId })\n })\n\n // Remove Sky Layer\n onCleanup(() => map().getLayer(layerId) && map().removeLayer(layerId))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setLayoutProperty(\n layerId,\n 'visibility',\n props.visible ? 'visible' : 'none'\n )\n })\n\n return props.children\n}\n\nexport default Sky\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSource } from '../Source'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n TerrainSpecification,\n SourceSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nconst Terrain: Component<{\n style: TerrainSpecification\n visible?: boolean\n}> = props => {\n const map: MapboxMap = useMap()\n const source: SourceSpecification = useSource()\n\n // Add Terrain Layer\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setTerrain({ ...props.style, source: source.id })\n })\n\n // Remove Terrain Layer\n onCleanup(() => map().setTerrain(null))\n\n // Update Visibility\n createEffect(async () => {\n if (props.visible === undefined) return\n\n !map().isStyleLoaded() && (await map().once('styledata'))\n map().setTerrain(props.visible ? props.style : null)\n })\n\n return props.children\n}\n\nexport default Terrain\n","import { onMount, onCleanup, createSignal, Component, lazy } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { Options as AttributionOptions } from 'mapbox-gl/src/ui/control/attribution_control'\nimport type { Options as FullscreenOptions } from 'mapbox-gl/src/ui/control/fullscreen_control'\nimport type { Options as GeolocateOptions } from 'mapbox-gl/src/ui/control/geolocate_control'\nimport type { Options as NavigationOptions } from 'mapbox-gl/src/ui/control/navigation_control'\nimport type { Options as ScaleOptions } from 'mapbox-gl/src/ui/control/scale_control'\n\nconst Control: Component<{\n type:\n | 'navigation'\n | 'scale'\n | 'attribution'\n | 'fullscreen'\n | 'geolocate'\n | 'language'\n | 'traffic'\n options?:\n | NavigationOptions\n | ScaleOptions\n | AttributionOptions\n | FullscreenOptions\n | GeolocateOptions\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n}> = props => {\n const map: MapboxMap = useMap()\n const [control, setControl] = createSignal(null)\n // Add Control\n onMount(async () => {\n let control\n\n switch (props.type) {\n case 'navigation':\n control = new mapboxgl.NavigationControl(props.options)\n break\n case 'scale':\n control = new mapboxgl.ScaleControl(props.options)\n break\n case 'attribution':\n control = new mapboxgl.AttributionControl(props.options)\n break\n case 'fullscreen':\n control = new mapboxgl.FullscreenControl(\n props.options || { container: map().container }\n )\n break\n case 'geolocate':\n control = new mapboxgl.GeolocateControl(props.options)\n break\n // case 'language':\n // // @ts-ignore\n // const MapboxLanguage = (await import('@mapbox/mapbox-gl-language'))\n // .default\n // control = new MapboxLanguage(props.options)\n // break\n // case 'traffic':\n // // @ts-ignore\n // const MapboxTraffic = (await import('@mapbox/mapbox-gl-traffic'))\n // .default\n // // @ts-ignore\n // await import('@mapbox/mapbox-gl-traffic/mapbox-gl-traffic.css')\n // control = new MapboxTraffic(props.options)\n // break\n }\n control && map().addControl(control, props.position)\n setControl(control)\n })\n\n onCleanup(() => map().removeControl(control()))\n\n return props.children\n}\n\nexport default Control\n","import { onMount, onCleanup, createEffect, Component, children } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { MarkerSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nconst Marker: Component<{\n options?: MarkerSpecification\n lnglat: LngLatLike\n}> = props => {\n const map: MapboxMap = useMap()\n let marker = null\n\n // Add Marker\n onMount(async () => {\n marker = new mapboxgl.Marker(props.options)\n .setLngLat(props.lnglat)\n .setPopup(\n props.children\n ? new mapboxgl.Popup().setDOMContent(<div>{props.children}</div>)\n : null\n )\n .addTo(map())\n })\n // Remove Marker\n onCleanup(() => marker.remove())\n\n // Update Position\n createEffect(() => marker.setLngLat(props.lnglat))\n\n return <></>\n}\n\nexport default Marker\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport mapboxgl from 'mapbox-gl'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type { PopupSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nconst Popup: Component<{\n options?: PopupSpecification\n lnglat: LngLatLike\n}> = props => {\n const map: MapboxMap = useMap()\n let popup = null\n\n // Add Popup\n onMount(async () => {\n popup = new mapboxgl.Popup(props.options)\n .setLngLat(props.lnglat)\n .setDOMContent(<div>{props.children}</div>)\n .addTo(map())\n })\n // Remove Popup\n onCleanup(() => popup.remove())\n\n // Update Position\n createEffect(() => popup.setLngLat(props.lnglat))\n\n // Update Content\n createEffect(() => popup.setDOMContent(<div>{props.children}</div>))\n\n return <></>\n}\n\nexport default Popup\n","import { onMount, onCleanup, createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type MapboxMap from 'mapbox-gl/src/ui/map'\nimport type {\n StyleImageInterface,\n StyleImageMetadata,\n} from 'mapbox-gl/src/style/style_image'\n\nconst Image: Component<{\n id: string\n url?: string\n image?:\n | HTMLImageElement\n | ImageBitmap\n | ImageData\n | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }\n | StyleImageInterface\n options?: StyleImageMetadata\n}> = props => {\n const map: MapboxMap = useMap()\n // Add Image\n onMount(async () => {\n !map().isStyleLoaded() && (await map().once('styledata'))\n if (props.url) {\n map().loadImage(props.url, (error, image) => {\n if (error) throw error\n !map().hasImage(props.id) && map().addImage(props.id, image)\n })\n } else {\n !map().hasImage(props.id) &&\n map().addImage(props.id, props.image, props.options)\n }\n })\n // Remove Image\n onCleanup(() => map().hasImage(props.id) && map().removeImage(props.id))\n\n // Update Image\n createEffect(async () => {\n if (props.image && props.url) return\n\n if (props.url) {\n map().loadImage(props.url, (error, image) => {\n if (error) throw error\n !map().hasImage(props.id) && map().updateImage(props.id, image)\n })\n } else {\n map().hasImage(props.id) && map().updateImage(props.id, props.image)\n }\n })\n\n return <></>\n}\n\nexport default Image\n"],"names":["pending","start","useTransition","MapContext","createContext","useMap","useContext","MapGL","props","map","mapRef","onCleanup","remove","onMount","mapboxgl","Map","options","container","interactive","onViewportChange","bounds","viewport","center","zoom","pitch","bearing","fitBoundsOptions","padding","containerRef","createEffect","on","evt","onMouseMove","lngLat","createMemo","setStyle","style","_onViewportChange","isInternal","getCenter","getZoom","getPitch","getBearing","camera","cameraForBounds","prev","vp","nvp","lng","lat","Object","keys","length","stop","transitionType","easeTo","jumpTo","flyTo","index","triggerResize","window","requestAnimationFrame","loop","resize","Provider","value","children","class","classList","SourceContext","useSource","SourceComponent","id","createUniqueId","async","isStyleLoaded","once","getSource","addSource","source","getStyle","layers","forEach","layer","removeLayer","removeSource","type","data","setData","diff","newProps","prevProps","Set","reduce","acc","key","push","Layer","getLayer","addLayer","beforeType","find","l","beforeId","layout","setLayoutProperty","validate","paint","setPaintProperty","minzoom","maxzoom","setLayerZoomRange","filter","setFilter","undefined","visible","featureState","removeFeatureState","sourceLayer","setFeatureState","state","Fog","setFog","Sky","layerId","Terrain","setTerrain","Control","control","setControl","createSignal","NavigationControl","ScaleControl","AttributionControl","FullscreenControl","GeolocateControl","addControl","position","removeControl","Marker","marker","setLngLat","lnglat","setPopup","Popup","setDOMContent","addTo","popup","Image","url","loadImage","error","image","hasImage","addImage","removeImage","updateImage"],"mappings":"8RA6BM,CAACA,QAASC,OAASC,gBAEnBC,WAAaC,gBACbC,OAAS,IAAMC,WAAWH,YAE1BI,MAYDC,QACCC,EACAC,EAGJC,UAAU,IAAMF,EAAIG,UAEpBC,QAAQ,KACNJ,EAAM,IAAIK,SAASC,IAAI,IAClBP,EAAMQ,QACTC,UAAWP,EACXQ,YAAaV,EAAMW,iBACnBC,OAAQZ,EAAMa,SAASD,OACvBE,OAAQd,EAAMa,SAASC,OACvBC,KAAMf,EAAMa,SAASE,MAAQ,KAC7BC,MAAOhB,EAAMa,SAASG,OAAS,KAC/BC,QAASjB,EAAMa,SAASI,SAAW,KACnCC,iBAAkB,CAAEC,QAASnB,EAAMa,SAASM,WAG9ClB,EAAIQ,eAjBFW,IAoBJC,aAAa,IAAMpB,EAAIqB,GAAG,YAAaC,GAAOvB,EAAMwB,YAAYD,EAAIE,UAEpEC,WAAW,IAAMzB,GAAOA,EAAI0B,SAAS3B,EAAMQ,QAAQoB,cAE7CC,EAAoBN,IACpBA,EAAIO,aACFjB,EAAqB,CACzBC,OAAQb,EAAI8B,YACZhB,KAAMd,EAAI+B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AAMmJ,YAAYpJ,EAAMgE,GAAIhE,EAAMgJ"}
|
|
@@ -18,7 +18,7 @@ const Control = props => {
|
|
|
18
18
|
control = new mapboxgl.AttributionControl(props.options);
|
|
19
19
|
break;
|
|
20
20
|
case 'fullscreen':
|
|
21
|
-
control = new mapboxgl.FullscreenControl(props.options);
|
|
21
|
+
control = new mapboxgl.FullscreenControl(props.options || { container: map().container });
|
|
22
22
|
break;
|
|
23
23
|
case 'geolocate':
|
|
24
24
|
control = new mapboxgl.GeolocateControl(props.options);
|
|
@@ -31,28 +31,32 @@ const Layer = props => {
|
|
|
31
31
|
: props.beforeId);
|
|
32
32
|
});
|
|
33
33
|
// Update Style
|
|
34
|
-
createEffect(
|
|
34
|
+
createEffect((prev) => {
|
|
35
35
|
if (!props.style ||
|
|
36
36
|
!map().getSource(source.id) ||
|
|
37
37
|
!map().getLayer(props.id))
|
|
38
38
|
return;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
if (props.style.layout !== prev?.layout)
|
|
40
|
+
diff(props.style.layout, prev?.layout).forEach(([key, value]) => map().setLayoutProperty(props.id, key, value, { validate: false }));
|
|
41
|
+
if (props.style.paint !== prev?.paint)
|
|
42
|
+
diff(props.style.paint, prev?.paint).forEach(([key, value]) => map().setPaintProperty(props.id, key, value, { validate: false }));
|
|
43
|
+
if (props.style.minzoom !== prev?.minzoom ||
|
|
44
|
+
props.style.maxzoom !== prev?.maxzoom)
|
|
44
45
|
map().setLayerZoomRange(props.id, props.style.minzoom, props.style.maxzoom);
|
|
46
|
+
if (props.style.filter !== prev?.filter)
|
|
47
|
+
map().setFilter(props.id, props.style.filter, { validate: false });
|
|
45
48
|
return props.style;
|
|
46
49
|
}, props.style);
|
|
47
50
|
// Update Visibility
|
|
48
|
-
createEffect(
|
|
51
|
+
createEffect((prev) => {
|
|
49
52
|
if (props.visible === undefined ||
|
|
53
|
+
props.visible === prev ||
|
|
50
54
|
!map().getSource(source.id) ||
|
|
51
55
|
!map().getLayer(props.id))
|
|
52
56
|
return;
|
|
53
|
-
!map().isSourceLoaded(source.id) && (await map().once('data'));
|
|
54
57
|
map().setLayoutProperty(props.id, 'visibility', props.visible ? 'visible' : 'none', { validate: false });
|
|
55
|
-
|
|
58
|
+
return props.visible;
|
|
59
|
+
}, props.visible);
|
|
56
60
|
// Update Filter
|
|
57
61
|
createEffect(async () => {
|
|
58
62
|
if (!props.filter)
|
|
@@ -64,7 +68,7 @@ const Layer = props => {
|
|
|
64
68
|
createEffect(async () => {
|
|
65
69
|
if (!props.featureState || !props.featureState.id)
|
|
66
70
|
return;
|
|
67
|
-
map().
|
|
71
|
+
!map().isStyleLoaded() && (await map().once('styledata'));
|
|
68
72
|
map().removeFeatureState({
|
|
69
73
|
source: source.id,
|
|
70
74
|
sourceLayer: props.style['source-layer'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createEffect, onMount, onCleanup, createContext, useContext, useTransition, } from 'solid-js';
|
|
1
|
+
import { createEffect, createMemo, onMount, onCleanup, createContext, useContext, useTransition, } from 'solid-js';
|
|
2
2
|
import mapboxgl from 'mapbox-gl';
|
|
3
3
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
4
4
|
const [pending, start] = useTransition();
|
|
@@ -7,11 +7,13 @@ const useMap = () => useContext(MapContext);
|
|
|
7
7
|
const MapGL = props => {
|
|
8
8
|
let map;
|
|
9
9
|
let mapRef;
|
|
10
|
+
let containerRef;
|
|
10
11
|
onCleanup(() => map.remove());
|
|
11
12
|
onMount(() => {
|
|
12
13
|
map = new mapboxgl.Map({
|
|
13
14
|
...props.options,
|
|
14
15
|
container: mapRef,
|
|
16
|
+
interactive: props.onViewportChange,
|
|
15
17
|
bounds: props.viewport.bounds,
|
|
16
18
|
center: props.viewport.center,
|
|
17
19
|
zoom: props.viewport.zoom || null,
|
|
@@ -19,9 +21,10 @@ const MapGL = props => {
|
|
|
19
21
|
bearing: props.viewport.bearing || null,
|
|
20
22
|
fitBoundsOptions: { padding: props.viewport.padding },
|
|
21
23
|
});
|
|
24
|
+
map.container = containerRef;
|
|
22
25
|
});
|
|
23
|
-
createEffect(() => props.onMouseMove
|
|
24
|
-
|
|
26
|
+
createEffect(() => map.on('mousemove', evt => props.onMouseMove(evt.lngLat)));
|
|
27
|
+
createMemo(() => map && map.setStyle(props.options.style));
|
|
25
28
|
const _onViewportChange = evt => {
|
|
26
29
|
if (evt.isInternal)
|
|
27
30
|
return;
|
|
@@ -43,16 +46,29 @@ const MapGL = props => {
|
|
|
43
46
|
.on('rotateend', _onViewportChange)
|
|
44
47
|
.on('pitchend', _onViewportChange)
|
|
45
48
|
.on('boxzoomend', _onViewportChange));
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
const camera = map.cameraForBounds(props.viewport.bounds
|
|
49
|
+
createMemo(() => {
|
|
50
|
+
if (map) {
|
|
51
|
+
const camera = map.cameraForBounds(props.viewport.bounds, {
|
|
52
|
+
padding: props.viewport.padding,
|
|
53
|
+
});
|
|
49
54
|
props.onViewportChange({
|
|
50
55
|
...props.viewport,
|
|
51
56
|
...camera,
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
});
|
|
60
|
+
// createEffect(prev => {
|
|
61
|
+
// if (props.viewport.bounds != prev) {
|
|
62
|
+
// const camera = map.cameraForBounds(props.viewport.bounds, {
|
|
63
|
+
// padding: props.viewport.padding,
|
|
64
|
+
// })
|
|
65
|
+
// props.onViewportChange({
|
|
66
|
+
// ...props.viewport,
|
|
67
|
+
// ...camera,
|
|
68
|
+
// })
|
|
69
|
+
// }
|
|
70
|
+
// return props.viewport.bounds
|
|
71
|
+
// }, props.viewport.bounds)
|
|
56
72
|
createEffect(async (prev) => {
|
|
57
73
|
const vp = props.viewport;
|
|
58
74
|
const nvp = {
|
|
@@ -91,9 +107,8 @@ const MapGL = props => {
|
|
|
91
107
|
}
|
|
92
108
|
});
|
|
93
109
|
return (<MapContext.Provider value={() => map}>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</main>
|
|
110
|
+
{props.children}
|
|
111
|
+
<main ref={mapRef} class={props.class || ''} classList={props.classList} style={{ height: '100%', width: '100%' }}></main>
|
|
97
112
|
</MapContext.Provider>);
|
|
98
113
|
};
|
|
99
114
|
export { MapGL as default, useMap };
|
package/dist/source/index.jsx
CHANGED
|
@@ -12,6 +12,7 @@ export declare type Viewport = {
|
|
|
12
12
|
bearing?: number;
|
|
13
13
|
padding?: number;
|
|
14
14
|
};
|
|
15
|
+
export declare type TransitionType = 'flyTo' | 'easeTo' | 'jumpTo';
|
|
15
16
|
declare const useMap: () => MapboxMap;
|
|
16
17
|
declare const MapGL: Component<{
|
|
17
18
|
class?: string;
|
|
@@ -20,9 +21,9 @@ declare const MapGL: Component<{
|
|
|
20
21
|
};
|
|
21
22
|
viewport?: Viewport;
|
|
22
23
|
options?: MapboxOptions;
|
|
23
|
-
children?: Element[];
|
|
24
|
+
children?: Element | Element[];
|
|
24
25
|
triggerResize?: boolean;
|
|
25
|
-
transitionType?:
|
|
26
|
+
transitionType?: TransitionType;
|
|
26
27
|
onMouseMove?: (event: MapMouseEvent) => void;
|
|
27
28
|
onViewportChange?: (viewport: Viewport) => void;
|
|
28
29
|
}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default } from './components/MapGL';
|
|
1
|
+
export { default, useMap } from './components/MapGL';
|
|
2
2
|
export { default as Source } from './components/Source';
|
|
3
3
|
export { default as Layer } from './components/Layer';
|
|
4
4
|
export { default as Fog } from './components/Fog';
|
|
@@ -9,3 +9,4 @@ export { default as Marker } from './components/Marker';
|
|
|
9
9
|
export { default as Popup } from './components/Popup';
|
|
10
10
|
export { default as Image } from './components/Image';
|
|
11
11
|
export type { Viewport } from './components/MapGL';
|
|
12
|
+
export type { TransitionType } from './components/MapGL';
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.
|
|
2
|
+
"version": "1.1.10",
|
|
3
3
|
"name": "solid-map-gl",
|
|
4
4
|
"description": "Solid Component Library for Mapbox GL JS",
|
|
5
5
|
"author": "kaihuebner",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"not ie 11"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"mapbox-gl": "^2.
|
|
42
|
-
"solid-js": "^1.3.
|
|
41
|
+
"mapbox-gl": "^2.7.0",
|
|
42
|
+
"solid-js": "^1.3.7"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/mapbox-gl": "^2.
|
|
46
|
-
"rollup": "^2.
|
|
45
|
+
"@types/mapbox-gl": "^2.6.1",
|
|
46
|
+
"rollup": "^2.67.3",
|
|
47
47
|
"rollup-plugin-import-css": "^3.0.2",
|
|
48
48
|
"rollup-plugin-uglify": "^6.0.4",
|
|
49
|
-
"rollup-preset-solid": "^1.
|
|
49
|
+
"rollup-preset-solid": "^1.2.2",
|
|
50
50
|
"typescript": "^4.5.5"
|
|
51
51
|
}
|
|
52
52
|
}
|