solid-map-gl 1.6.0 → 1.6.1
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/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/source/components/Control/index.jsx +1 -2
- package/dist/source/components/MapGL/index.jsx +2 -2
- package/dist/source/components/Marker/index.jsx +5 -4
- package/dist/source/components/Popup/index.jsx +4 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{effect as e,setAttribute as t,className as o,classList as r,style as a,createComponent as n,memo as i,template as s}from"solid-js/web";import{createContext as l,useContext as c,createUniqueId as p,createSignal as d,createEffect as u,onMount as g,onCleanup as m,untrack as y}from"solid-js";const h=["onMouseDown","onMouseUp","onMouseOver","onMouseOut","onMouseMove","onMouseEnter","onMouseLeave","onPreClick","onClick","onDblClick","onContextMenu","onTouchStart","onTouchEnd","onTouchCancel","onWheel","onResize","onRemove","onTouchMove","onMoveStart","onMove","onMoveEnd","onDragStart","onDrag","onDragEnd","onZoomStart","onZoom","onZoomEnd","onRotateStart","onRotate","onRotatEnd","onPitchStart","onPitch","onPitchEnd","onBoxZoomStart","onBoxZoomEnd","onBoxZoomCancel","onWebglContextLost","onWebglContextRestored","onLoad","onRender","onIdle","onError","onData","onStyleData","onSourceData","onDataLoading","onStyleDataLoading","onSourceDataLoading","onStyleImageMissing"],b=["onMouseDown","onMouseUp","onMouseOver","onMouseOut","onMouseMove","onMouseEnter","onMouseLeave","onClick","onDblClick","onContextMenu","onTouchStart","onTouchEnd","onTouchCancel"],v="mapbox://styles/mapbox",w="https://raw.githubusercontent.com/",f="https://raw.githubusercontent.com/GIShub4/map-styles/main/",$="https://assets.vector.hereapi.com/styles/",k={mb:{light:`${v}/light-v11`,dark:`${v}/dark-v11`,street:`${v}/streets-v12`,outdoor:`${v}/outdoors-v12`,sat:`${v}/satellite-v9`,sat_street:`${v}/satellite-streets-v12`,nav:`${v}/navigation-guidance-day-v4`,nav_night:`${v}/navigation-guidance-night-v4`,basic:`${v}/cjf4m44iw0uza2spb3q0a7s41`,monochrome:`${v}/cjv6rzz4j3m4b1fqcchuxclhb`,leshine:`${v}/cjcunv5ae262f2sm9tfwg8i0w`,icecream:`${v}/cj7t3i5yj0unt2rmt3y4b5e32`,cali:`${v}/cjerxnqt3cgvp2rmyuxbeqme7`,northstar:`${v}/cj44mfrt20f082snokim4ungi`,mineral:`${v}/cjtep62gq54l21frr1whf27ak`,moonlight:`${v}/cj3kbeqzo00022smj7akz3o1e`,frank:`${v}-map-design/ckshxkppe0gge18nz20i0nrwq`,minimo:`${v}-map-design/cksjc2nsq1bg117pnekb655h1`,decimal:`${v}-map-design/ck4014y110wt61ctt07egsel6`,standard:`${v}-map-design/ckr0svm3922ki18qntevm857n`,blueprint:`${v}-map-design/cks97e1e37nsd17nzg7p0308g`,bubble:`${v}-map-design/cksysy2nl62zp17quosctdtcc`,pencil:`${v}-map-design/cks9iema71es417mlrft4go2k`,swiss_ski:`${w}mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,vintage:`${w}mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,whaam:`${w}mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,neon:`${w}NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,camoflauge:`${w}jingsam/mapbox-gl-styles/master/Camouflage.json`,emerald:`${w}jingsam/mapbox-gl-styles/master/Emerald.json`,runner:`${w}jingsam/mapbox-gl-styles/master/Runner.json`,x_ray:`${w}jingsam/mapbox-gl-styles/master/X-ray.json`},here:{base:`${$}berlin/base/mapbox/tilezen?apikey={apikey}`,day:`${$}berlin/day/mapbox/tilezen?apikey={apikey}`,night:`${$}berlin/night/mapbox/tilezen?apikey={apikey}`},esri:{blueprint:`${f}esri:blueprint.json`,charted_territory:`${f}esri:charted-territory.json`,colored_pencil:`${f}esri:colored-pencil.json`,community:`${f}esri:community.json`,mid_century:`${f}esri:mid-century.json`,modern_antique:`${f}esri:modern-antique.json`,nat_geo:`${f}esri:national-geographic.json`,newspaper:`${f}esri:newspaper.json`,open_street_map:`${f}esri:open-street-map.json`,light_gray_canvas:`${f}esri:light-gray-canvas.json`,dark_gray_canvas:`${f}esri:dark-gray-canvas.json`,human_geo_light:`${f}esri:human-geography-light.json`,human_geo_dark:`${f}esri:human-geography-dark.json`,world_navigation:`${f}esri:world-navigation.json`,world_street:`${f}esri:world-street.json`,world_street_night:`${f}esri:world-street-night.json`,world_terrain:`${f}esri:world-terrain.json`,world_terrain_hybrid:`${f}esri:world-terrain-hybrid.json`,world_topographic:`${f}esri:world-topographic.json`,chromium:`${f}esri:chromium.json`,dreamcatcher:`${f}esri:dreamcatcher.json`,seahaven:`${f}esri:seahaven.json`,sangria:`${f}esri:sangria.json`,mercurial:`${f}esri:mercurial.json`,imagery:`${f}esri:imagery.json`,imagery_hybrid:`${f}esri:imagery-hybrid.json`,firefly:`${f}esri:firefly.json`,firefly_hybrid:`${f}esri:firefly-hybrid.json`,oceans:`${f}esri:oceans.json`}},L="https://{s}.basemaps.cartocdn.com/rastertiles/",x="https://stamen-tiles-{s}.a.ssl.fastly.net/",M="https://{s}.tile.thunderforest.com/",_={osm:{org:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",human:"https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",cycle:"https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png",topo:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",_copy:'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a>'},carto:{voyager:`${L}voyager_labels_under/{z}/{x}/{y}{r}.png`,positron:`${L}light_all/{z}/{x}/{y}{r}.png`,dark:`${L}dark_all/{z}/{x}/{y}{r}.png`,_copy:'<a href="https://carto.com/attribution" target="_blank">© Carto</a>'},stamen:{toner:`${x}toner/{z}/{x}/{y}{r}.png`,toner_lite:`${x}toner-lite/{z}/{x}/{y}{r}.png`,watercolor:`${x}watercolor/{z}/{x}/{y}.png`,terrain:`${x}terrain/{z}/{x}/{y}{r}.png`,_copy:'<a href="https://stamen.com/privacy-policy" target="_blank">© Stamen Design</a>'},tf:{cycle:`${M}cycle/{z}/{x}/{y}{r}.png?apikey={apikey}`,trans:`${M}transport/{z}/{x}/{y}{r}.png?apikey={apikey}`,trans_dark:`${M}transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}`,landscape:`${M}landscape/{z}/{x}/{y}{r}.png?apikey={apikey}`,outdoors:`${M}outdoors/{z}/{x}/{y}{r}.png?apikey={apikey}`,neighbourhood:`${M}neighbourhood/{z}/{x}/{y}{r}.png?apikey={apikey}`,spinal:`${M}spinal-map/{z}/{x}/{y}{r}.png?apikey={apikey}`,pioneer:`${M}pioneer/{z}/{x}/{y}{r}.png?apikey={apikey}`,atlas:`${M}atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,mobile:`${M}mobile-atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,_copy:'<a href="https://thunderforest.com/privacy" target="_blank">© Thunderforest</a>'}},j=s("<div></div>",2),S=l(),z=()=>c(S),C=s=>{let l;s.id=s.id||p();const[c,y]=d(),[b,v]=d(!1),[w,f]=d(!1);u((()=>s.onUserInteraction?.(w())));const $=(e,t)=>{s.debug&&console.debug("%c[MapGL]","color: #0ea5e9",e,t||"")},L=(()=>{const n=j.cloneNode(!0);return e((e=>{const i=s.id,l=s?.class,c=s?.classList,p=s?.style||s?.class||s?.classList?s.style:{position:"absolute",inset:0,...s.style};return i!==e._v$&&t(n,"id",e._v$=i),l!==e._v$2&&o(n,e._v$2=l),e._v$3=r(n,c,e._v$3),e._v$4=a(n,p,e._v$4),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n})(),x=(e,t)=>{const o=b()&&t||e;return"string"==typeof o||o instanceof String?o?.split(":").reduce(((e,t)=>e&&e[t]),k)?.replace("{apikey}",s.apikey||import.meta.env.VITE_VECTOR_API_KEY)||o:o||{version:8,sources:{},layers:[]}};g((async()=>{let e=s.mapLib||await import("mapbox-gl");if(e.Map||(e=window.maplibregl||window.mapboxgl),!e.supported())throw new Error("Mapbox GL not supported");$(`Map (v${e.version}) loading...`),l=new e.Map({accessToken:s.options.accessToken||import.meta.env.VITE_MAPBOX_ACCESS_TOKEN,interactive:s.options.interactive||!!s.onViewportChange,...s.options,...s.viewport,container:L,style:x(s.options?.style,s.darkStyle),fitBoundsOptions:{padding:s.viewport?.padding}}),l.mapLib=e,l.debug=s.debug,l.sourceIdList=[],l.layerIdList=[],l.once("load",(()=>{y(l),$("Map loaded")})),["mousedown","touchstart","wheel"].forEach((e=>l.on(e,(()=>f(!0))))),l.on("moveend",(e=>!e.rotate&&f(!1)));const t="undefined"!=typeof window&&window.matchMedia("(prefers-color-scheme: dark)");t?.addEventListener("change",(()=>{v(t.matches),$("Set dark theme to:",t.matches?.toString())})),new MutationObserver((()=>{const e=document.body.classList.contains("dark");v(e),$("Set dark theme to:",e)})).observe(document.body,{attributes:!0}),h.forEach((e=>{const t=s[e];if(t){const o=e.slice(2).toLowerCase();"function"==typeof t?l.on(o,(e=>{t(e),$(`Map '${o}' event:`,e)})):Object.keys(t).forEach((e=>{l.on(o,e,(r=>{t[e](r),$(`Map '${o}' event on '${e}':`,r)}))}))}})),l.on("move",(e=>{const t={...s.viewport,id:s.id,point:{x:e.originalEvent?.x,y:e.originalEvent?.y},center:s.viewport.center.lat?l.getCenter():[l.getCenter().lng,l.getCenter().lat],zoom:l.getZoom(),pitch:l.getPitch(),bearing:l.getBearing()};s.onViewportChange&&s.onViewportChange(t)}))})),u((()=>{const e={...s.viewport,padding:s.viewport?.padding||0};l&&s.id!==s.viewport?.id&&!w()&&(l?.stop()[s.transitionType](e),$(`Update Viewport (${s.transitionType}):`,e))})),u((e=>{const t=s.viewport?.bounds;return l&&t&&e!==t&&!w()&&(s.onViewportChange({...s.viewport,...l?.cameraForBounds(t,{padding:s.viewport?.padding})}),$("Update Viewport Boundaries:",t)),t}),s.viewport?.bounds),u((e=>{const t=s.options?.projection;return e!==t&&(l.setProjection(t),$("Set Projection to:",t)),t}),s.options?.projection),u((()=>{s.cursorStyle&&l&&(l.getCanvas().style.cursor=s.cursorStyle,$("Set Cursor to:",s.cursorStyle))}));return u((e=>{const t=x(s.options?.style,s.darkStyle);if(l?.isStyleLoaded()&&e!==t){const e=l.getStyle(),o=e.layers.filter((e=>l.layerIdList.includes(e.id))),r=Object.keys(e.sources).filter((e=>l.sourceIdList.includes(e))).reduce(((t,o)=>({...t,[o]:e.sources[o]})),{});l.setStyle(t),l.once("styledata",(()=>{if(!o)return;const e=l.getStyle();var t,a;l.setStyle({...e,sources:{...e.sources,...r},layers:(t=e.layers,a=o,a.forEach((e=>{const o=t.findIndex((t=>e.metadata.smg.beforeType?t.type===e.metadata.smg.beforeType:t.id===e.metadata.smg.beforeId));t=-1===o?[...t,e]:[...t.slice(0,o),e,...t.slice(o+1)]})),t)})})),$("Set Mapstyle to:",t)}return t}),s.options?.style),["showTileBoundaries","showTerrainWireframe","showCollisionBoxes","showPadding","showOverdrawInspector"].forEach((e=>{u((()=>{const t=s[e];l&&(l[e]=t,$(`Set ${e} to:`,t))}))})),m((()=>{l?.remove(),$("Map removed")})),n(S.Provider,{value:[c,w,$],get children(){return[i((()=>c()&&s.children)),L]}})},E=l(),P=()=>c(E),T=e=>{if(!z())return;const[t]=z();e.id=e.id||p();const o=(e,o)=>{t().debug&&console.debug("%c[MapGL]","color: #ec4899",e,o||"")},r=t=>{const o=t?.split(":").reduce(((e,t)=>e&&e[t]),_),r=o?{...e.source,url:"",tiles:[o.replace("{apikey}",e.source.apikey||import.meta.env.VITE_RASTER_API_KEY).replace("{r}",window.devicePixelRatio>1?"@2x":"")],attribution:_[t.split(":")[0]]._copy}:e.source;return r.tiles&&(r.tiles=["a","b","c"].map((e=>r.tiles[0].replace("{s}",e)))),r};t().addSource(e.id,r(e.source.url)),t().sourceIdList.push(e.id),o("Add Source:",e.id);const a=t().getSource(e.id);switch(e.source.type){case"geojson":u((()=>{const r=e.source.data;t().isSourceLoaded(e.id)&&(a.setData(r||{}),o("Update GeoJSON Data:",e.id))}));break;case"image":u((()=>{const r=e.source.url,n=e.source.coordinates;t().isSourceLoaded(e.id)&&(a.updateImage(r,n),o("Update Image Data:",e.id))}));break;case"vector":u((()=>{const r=e.source.url,n=e.source.tiles;t().isSourceLoaded(e.id)&&(r?a.setUrl(r):a.setTiles(n),o("Update Vector Data:",e.id))}));break;case"raster":u((()=>{const n=e.source.url;if(!t().isSourceLoaded(e.id))return;const i=r(n);i.tiles&&(i.tiles=["a","b","c"].map((e=>i.tiles[0].replace("{s}",e)))),a._tileJSONRequest?.cancel(),a.url=i.url,a.scheme=i.scheme,a._options={...a._options,...i},t().style._sourceCaches[`other:${e.id}`]?.clearTiles(),a.load(),o("Update Raster Data:",e.id)}))}return m((()=>{t()?.getStyle().layers.forEach((o=>o.source===e.id&&t().removeLayer(o.id))),t().removeSource(e.id),o("Remove Source:",e.id)})),n(E.Provider,{get value(){return e.id},get children(){return e.children}})},I=(e={},t={})=>[...new Set([...Object.keys(e),...Object.keys(t)])].reduce(((o,r)=>{const a=e[r];return a!==t[r]&&o.push([r,a]),o}),[]),D=e=>{if(!z())return;const[t]=z(),o=e.style.source||P();e.id=e.id||p();const r=(e,o)=>{t().debug&&console.debug("%c[MapGL]","color: #10b981",e,o||"")};return t().addLayer(e.customLayer||{...e.style,id:e.id,source:o,metadata:{smg:{beforeType:e.beforeType,beforeId:e.beforeId}}},e.beforeType?t().getStyle().layers.find((t=>t.type===e.beforeType))?.id:e.beforeId),t().layerIdList.push(e.id),r("Add Layer:",e.id),b.forEach((o=>{if(e[o]){const a=o.slice(2).toLowerCase();t().on(a,e.id,(t=>{e[o](t),r(`Layer '${a}' event on '${e.id}':`,t)}))}})),u((o=>{const a=e.style;if(a!==o&&t().isStyleLoaded())return a.layout!==o?.layout&&I(a.layout,o?.layout).forEach((([o,r])=>t().setLayoutProperty(e.id,o,r,{validate:!1}))),a.paint!==o?.paint&&I(a.paint,o?.paint).forEach((([o,r])=>t().setPaintProperty(e.id,o,r,{validate:!1}))),a.minzoom===o?.minzoom&&a.maxzoom===o?.maxzoom||t().setLayerZoomRange(e.id,a.minzoom,a.maxzoom),a.filter!==o?.filter&&t().setFilter(e.id,a.filter,{validate:!1}),r("Update Layer Style:",e.id),a}),e.style),u((o=>{if(e.visible!==o)return t().setLayoutProperty(e.id,"visibility",e.visible?"visible":"none",{validate:!1}),r(`Update Visibility (${e.id}):`,e.visible),e.visible}),e.visible),u((async()=>{e.filter&&(!t().isStyleLoaded()&&await t().once("styledata"),t().setFilter(e.id,e.filter),r(`Update Filter (${e.id}):`,e.filter))})),u((async()=>{e.featureState&&e.featureState.id&&(!t().isStyleLoaded()&&await t().once("styledata"),t().removeFeatureState({source:o,sourceLayer:e.style["source-layer"]}),t().setFeatureState({source:o,sourceLayer:e.style["source-layer"],id:e.featureState.id},e.featureState.state))})),m((()=>t()?.getLayer(e.id)&&t()?.removeLayer(e.id))),e.children},O=e=>{if(!z())return;const[t]=z();return u((()=>t().setFog(e.style||{}))),m((()=>t()?.setFog(null))),null},V=e=>{if(!z())return;const[t]=z();let o=P();return void 0===o&&(o=p(),t().addSource(o,t().isMapLibre?{type:"raster-dem",url:"https://demotiles.maplibre.org/terrain-tiles/tiles.json",tileSize:256}:{type:"raster-dem",url:"mapbox://mapbox.terrain-rgb",tileSize:512,maxzoom:14})),u((()=>{t().setTerrain({exaggeration:e.exaggeration||1,source:o})})),m((()=>t().setTerrain(null))),null},R=e=>{if(!z())return;const[t]=z(),o=t().mapLib;let r=null;return u((()=>{r&&t().hasControl(r)&&t().removeControl(r),r=((e,t,o,r)=>{if(r)return new r(o);switch(t){case"navigation":return new e.NavigationControl(o);case"scale":return new e.ScaleControl(o);case"attribution":return new e.AttributionControl(o);case"geolocate":return new e.GeolocateControl(o);case"fullscreen":return new e.FullscreenControl;default:throw new Error(`Unknown control type: ${t}`)}})(o,e.type,e.options,e.custom),t().addControl(r,e.position)})),m((()=>t()?.removeControl(r))),null},q=e=>{if(!z())return;const[t]=z();let o=null,r=null;if(!e.lngLat)throw new Error("Marker - lngLat is required");return u((()=>{const a={...e.options},n={...e.options?.popup};y((()=>{r?.remove(),r=e.children?(new t).mapLib.Popup(n).setHTML(e.children).on("close",(()=>e.onClose?.())):null,o?.remove(),o=(new t).mapLib.Marker(a).setPopup(r).on("dragstart",(()=>e.onDragStart?.())).on("dragend",(()=>e.onDragEnd?.())).on("drag",(()=>e.onLngLatChange?.(o.getLngLat().toArray()))),o.setDraggable(e.draggable).setLngLat(e.lngLat).addTo(t()),e.openPopup!==r?.isOpen()&&o.togglePopup()}))})),u((()=>e.openPopup!==r?.isOpen()&&o.togglePopup())),u((()=>o.setLngLat(e.lngLat))),u((()=>r?.setHTML(e.children))),u((()=>o.setDraggable(e.draggable))),m((()=>o?.remove())),null},A=e=>{if(!z())return;const[t]=z();let o=null;if(!e.trackPointer&&!e.lngLat)throw new Error("Popup - lngLat or trackPointer is required");return u((()=>{const r={...e.options};y((()=>{o?.remove(),o=(new t).mapLib.Popup(e.trackPointer?{...r,closeOnClick:!1,closeButton:!1}:{focusAfterOpen:!1,...r}).setHTML(e.children||"").setLngLat(e.lngLat).on("close",(()=>e.onClose?.())).addTo(t())}))})),u((()=>e.trackPointer?o.trackPointer():o.setLngLat(e.lngLat))),u((()=>o.setHTML(e.children||""))),m((()=>o?.remove())),null},U={diagonal_l:{size:20,path:"M20 0 0 20M-10 10 10-10M10 30 30 10"},diagonal_r:{size:20,path:"M0 0 20 20M30 10 10-10M10 30-10 10"},horizontal:{size:14,path:"M7 0V20"},vertical:{size:14,path:"M0 7H20"},cross:{size:18,path:"M9 0V18M0 9H18"},hash:{size:30,path:"M15 0 30 15 15 30 0 15Z"},chevron_h:{size:20,path:"M-5 5 0 10 10 0 20 10 25 5M0 30 10 20 20 30"},chevron_v:{size:20,path:"M5-5 10 0 0 10 10 20 5 25M25 15 20 10 25 5"},square:{size:20,path:"M8 8H12V12H8Z",fill:!0},hex:{size:50,path:"M0 0V50L50 25ZM50 0V50L0 25ZM25 0V50"},circle:{size:25,path:"M8 10A2.5 2.5 0 118.01 10M18 15A2.5 2.5 0 1018.01 15",fill:!0}},Z=Object.keys(U),F=e=>{if(!z())return;const[t]=z(),[o,r]=d({width:0,height:0});m((()=>t()?.hasImage(e.id)&&t()?.removeImage(e.id))),u((()=>{if(!e.id)throw new Error("Image - ID is required");if(!e.image&&!e.pattern)throw new Error("Image - Image or Pattern is required");const i=e.pattern?{pixelRatio:2,...e.options}:e.options;a(e.image||n(e.pattern),(a=>{const{width:n,height:s}=a;t().hasImage(e.id)||t().addImage(e.id,a,i),!e.pattern&&y((()=>n===o().width&&s===o().height))?(t().updateImage(e.id,a),t().triggerRepaint()):(t().removeImage(e.id),t().addImage(e.id,a,i)),r({width:n,height:s})}))}));const a=(e,o)=>{if("string"!=typeof e)return o(e);t().loadImage(e,((e,t)=>{if(e)throw e;return o(t)}))},n=e=>{const t=U[e.type];return{width:t.size,height:t.size,data:new Uint8Array(t.size*t.size*4),onAdd:function(){let e=document.createElement("canvas");e.width=e.height=t.size,this.ctx=e.getContext("2d",{willReadFrequently:!0})},render:function(){return this.ctx.fillStyle=e.background||"transparent",this.ctx.fillRect(0,0,this.width,this.height),this.ctx.strokeStyle=this.ctx.fillStyle=e.color||"black",this.ctx.lineWidth=e.lineWith||1,this.ctx.stroke(new Path2D(t.path)),t.fill&&this.ctx.fill(new Path2D(t.path)),this.data=this.ctx.getImageData(0,0,this.width,this.height).data,!0}}};return null},G={in:e=>e*e,out:e=>1-(1-e)*(1-e),inOut:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},B=e=>{if(!z())return;const[t,o]=z();let r=.1,a=!1;const n=o=>{e.translate&&window.requestAnimationFrame(n);const i=[e.translate.start,e.translate.end,e.translate.easing?G[e.translate.easing](r):r];(async([e,o,r],a)=>{const n=t().getFreeCameraOptions();n.position=t().mapLib.MercatorCoordinate.fromLngLat([e,o],r),n.lookAtPoint(a),t().setFreeCameraOptions(n)})("line"===e.translate.type?((e,t,o)=>e.map(((r,a)=>(1-o)*e[a]+o*t[a])))(...i):((e,t,o)=>{const r=.075;return e.map(((a,n)=>Math.sin((1-o)*r)/Math.sin(r)*e[n]+Math.sin(o*r)/Math.sin(r)*t[n]))})(...i),e.translate.target),!e.translate.loop&&(r>1||r<0)&&(a=!a),r=a?r-.001:r+.001};u((()=>{e.translate&&window.requestAnimationFrame(n)}));const i=()=>{const r=e.rotateGlobe.secPerRev||120,a=e.rotateGlobe.maxZoom||5,n=e.rotateGlobe.slowZoom||3,i=t().getZoom();if(e.rotateGlobe&&!o()&&i<a){let e=360/r;if(i>n){e*=(a-i)/(a-n)}const o=t().getCenter();o.lng-=e,t().easeTo({center:o,duration:1e3,easing:e=>e},{rotate:!0})}},s=()=>{const r=e.rotateViewport?.secPerRev||60;if(e.rotateViewport&&!o()){let o=360/r;const a=t().getBearing()-o;t().easeTo({bearing:a,pitch:e.rotateViewport?.pitch||80,duration:1e3,around:e.rotateViewport?.around,easing:e=>e},{rotate:!0})}};return t().on("moveend",(t=>t.rotate&&e.rotateGlobe?i():s())),u((()=>e.rotateGlobe?!o()&&i():t().stop())),u((()=>e.rotateViewport?!o()&&s():t().stop().resetNorthPitch())),e.children},H=e=>{if(!z())return;const[t]=z();return u((()=>t().setLight(e.style||{}))),m((()=>t()?.setLight(null))),null};export{O as Atmosphere,B as Camera,R as Control,F as Image,D as Layer,H as Light,q as Marker,A as Popup,T as Source,V as Terrain,C as default,Z as patternList,z as useMap,P as useSourceId};
|
|
1
|
+
import{effect as e,setAttribute as t,className as o,classList as r,style as a,createComponent as n,memo as i,template as s}from"solid-js/web";import{createContext as l,useContext as c,createUniqueId as p,createSignal as d,createEffect as u,onMount as g,onCleanup as m,untrack as y}from"solid-js";const h=["onMouseDown","onMouseUp","onMouseOver","onMouseOut","onMouseMove","onMouseEnter","onMouseLeave","onPreClick","onClick","onDblClick","onContextMenu","onTouchStart","onTouchEnd","onTouchCancel","onWheel","onResize","onRemove","onTouchMove","onMoveStart","onMove","onMoveEnd","onDragStart","onDrag","onDragEnd","onZoomStart","onZoom","onZoomEnd","onRotateStart","onRotate","onRotatEnd","onPitchStart","onPitch","onPitchEnd","onBoxZoomStart","onBoxZoomEnd","onBoxZoomCancel","onWebglContextLost","onWebglContextRestored","onLoad","onRender","onIdle","onError","onData","onStyleData","onSourceData","onDataLoading","onStyleDataLoading","onSourceDataLoading","onStyleImageMissing"],v=["onMouseDown","onMouseUp","onMouseOver","onMouseOut","onMouseMove","onMouseEnter","onMouseLeave","onClick","onDblClick","onContextMenu","onTouchStart","onTouchEnd","onTouchCancel"],b="mapbox://styles/mapbox",w="https://raw.githubusercontent.com/",f="https://raw.githubusercontent.com/GIShub4/map-styles/main/",$="https://assets.vector.hereapi.com/styles/",k={mb:{light:`${b}/light-v11`,dark:`${b}/dark-v11`,street:`${b}/streets-v12`,outdoor:`${b}/outdoors-v12`,sat:`${b}/satellite-v9`,sat_street:`${b}/satellite-streets-v12`,nav:`${b}/navigation-guidance-day-v4`,nav_night:`${b}/navigation-guidance-night-v4`,basic:`${b}/cjf4m44iw0uza2spb3q0a7s41`,monochrome:`${b}/cjv6rzz4j3m4b1fqcchuxclhb`,leshine:`${b}/cjcunv5ae262f2sm9tfwg8i0w`,icecream:`${b}/cj7t3i5yj0unt2rmt3y4b5e32`,cali:`${b}/cjerxnqt3cgvp2rmyuxbeqme7`,northstar:`${b}/cj44mfrt20f082snokim4ungi`,mineral:`${b}/cjtep62gq54l21frr1whf27ak`,moonlight:`${b}/cj3kbeqzo00022smj7akz3o1e`,frank:`${b}-map-design/ckshxkppe0gge18nz20i0nrwq`,minimo:`${b}-map-design/cksjc2nsq1bg117pnekb655h1`,decimal:`${b}-map-design/ck4014y110wt61ctt07egsel6`,standard:`${b}-map-design/ckr0svm3922ki18qntevm857n`,blueprint:`${b}-map-design/cks97e1e37nsd17nzg7p0308g`,bubble:`${b}-map-design/cksysy2nl62zp17quosctdtcc`,pencil:`${b}-map-design/cks9iema71es417mlrft4go2k`,swiss_ski:`${w}mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,vintage:`${w}mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,whaam:`${w}mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,neon:`${w}NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,camoflauge:`${w}jingsam/mapbox-gl-styles/master/Camouflage.json`,emerald:`${w}jingsam/mapbox-gl-styles/master/Emerald.json`,runner:`${w}jingsam/mapbox-gl-styles/master/Runner.json`,x_ray:`${w}jingsam/mapbox-gl-styles/master/X-ray.json`},here:{base:`${$}berlin/base/mapbox/tilezen?apikey={apikey}`,day:`${$}berlin/day/mapbox/tilezen?apikey={apikey}`,night:`${$}berlin/night/mapbox/tilezen?apikey={apikey}`},esri:{blueprint:`${f}esri:blueprint.json`,charted_territory:`${f}esri:charted-territory.json`,colored_pencil:`${f}esri:colored-pencil.json`,community:`${f}esri:community.json`,mid_century:`${f}esri:mid-century.json`,modern_antique:`${f}esri:modern-antique.json`,nat_geo:`${f}esri:national-geographic.json`,newspaper:`${f}esri:newspaper.json`,open_street_map:`${f}esri:open-street-map.json`,light_gray_canvas:`${f}esri:light-gray-canvas.json`,dark_gray_canvas:`${f}esri:dark-gray-canvas.json`,human_geo_light:`${f}esri:human-geography-light.json`,human_geo_dark:`${f}esri:human-geography-dark.json`,world_navigation:`${f}esri:world-navigation.json`,world_street:`${f}esri:world-street.json`,world_street_night:`${f}esri:world-street-night.json`,world_terrain:`${f}esri:world-terrain.json`,world_terrain_hybrid:`${f}esri:world-terrain-hybrid.json`,world_topographic:`${f}esri:world-topographic.json`,chromium:`${f}esri:chromium.json`,dreamcatcher:`${f}esri:dreamcatcher.json`,seahaven:`${f}esri:seahaven.json`,sangria:`${f}esri:sangria.json`,mercurial:`${f}esri:mercurial.json`,imagery:`${f}esri:imagery.json`,imagery_hybrid:`${f}esri:imagery-hybrid.json`,firefly:`${f}esri:firefly.json`,firefly_hybrid:`${f}esri:firefly-hybrid.json`,oceans:`${f}esri:oceans.json`}},x="https://{s}.basemaps.cartocdn.com/rastertiles/",L="https://stamen-tiles-{s}.a.ssl.fastly.net/",M="https://{s}.tile.thunderforest.com/",_={osm:{org:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",human:"https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",cycle:"https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png",topo:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",_copy:'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a>'},carto:{voyager:`${x}voyager_labels_under/{z}/{x}/{y}{r}.png`,positron:`${x}light_all/{z}/{x}/{y}{r}.png`,dark:`${x}dark_all/{z}/{x}/{y}{r}.png`,_copy:'<a href="https://carto.com/attribution" target="_blank">© Carto</a>'},stamen:{toner:`${L}toner/{z}/{x}/{y}{r}.png`,toner_lite:`${L}toner-lite/{z}/{x}/{y}{r}.png`,watercolor:`${L}watercolor/{z}/{x}/{y}.png`,terrain:`${L}terrain/{z}/{x}/{y}{r}.png`,_copy:'<a href="https://stamen.com/privacy-policy" target="_blank">© Stamen Design</a>'},tf:{cycle:`${M}cycle/{z}/{x}/{y}{r}.png?apikey={apikey}`,trans:`${M}transport/{z}/{x}/{y}{r}.png?apikey={apikey}`,trans_dark:`${M}transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}`,landscape:`${M}landscape/{z}/{x}/{y}{r}.png?apikey={apikey}`,outdoors:`${M}outdoors/{z}/{x}/{y}{r}.png?apikey={apikey}`,neighbourhood:`${M}neighbourhood/{z}/{x}/{y}{r}.png?apikey={apikey}`,spinal:`${M}spinal-map/{z}/{x}/{y}{r}.png?apikey={apikey}`,pioneer:`${M}pioneer/{z}/{x}/{y}{r}.png?apikey={apikey}`,atlas:`${M}atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,mobile:`${M}mobile-atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,_copy:'<a href="https://thunderforest.com/privacy" target="_blank">© Thunderforest</a>'}},j=s("<div></div>",2),S=l(),z=()=>c(S),C=s=>{let l;s.id=s.id||p();const[c,y]=d(),[v,b]=d(!1),[w,f]=d(!1);u((()=>s.onUserInteraction?.(w())));const $=(e,t)=>{s.debug&&console.debug("%c[MapGL]","color: #0ea5e9",e,t||"")},x=(()=>{const n=j.cloneNode(!0);return e((e=>{const i=s.id,l=s?.class,c=s?.classList,p=s?.style||s?.class||s?.classList?s.style:{position:"absolute",inset:0,...s.style};return i!==e._v$&&t(n,"id",e._v$=i),l!==e._v$2&&o(n,e._v$2=l),e._v$3=r(n,c,e._v$3),e._v$4=a(n,p,e._v$4),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n})(),L=(e,t)=>{const o=v()&&t||e;return"string"==typeof o||o instanceof String?o?.split(":").reduce(((e,t)=>e&&e[t]),k)?.replace("{apikey}",s.apikey||import.meta.env.VITE_VECTOR_API_KEY)||o:o||{version:8,sources:{},layers:[]}};g((async()=>{let e=s.mapLib||await import("mapbox-gl");if(e.Map||(e=window.maplibregl||window.mapboxgl),!e.supported())throw new Error("Mapbox GL not supported");$(`Map (v${e.version}) loading...`),l=new e.Map({accessToken:s.options.accessToken||import.meta.env.VITE_MAPBOX_ACCESS_TOKEN,interactive:s.options.interactive||!!s.onViewportChange,...s.options,...s.viewport,container:x,style:L(s.options?.style,s.darkStyle),fitBoundsOptions:{padding:s.viewport?.padding}}),l.mapLib=e,l.debug=s.debug,l.sourceIdList=[],l.layerIdList=[],l.once("load",(()=>{y(l),$("Map loaded")})),["mousedown","touchstart","wheel"].forEach((e=>l.on(e,(()=>f(!0))))),l.on("moveend",(e=>!e.rotate&&f(!1)));const t="undefined"!=typeof window&&window.matchMedia("(prefers-color-scheme: dark)");t?.addEventListener("change",(()=>{b(t.matches),$("Set dark theme to:",t.matches?.toString())})),new MutationObserver((()=>{const e=document.body.classList.contains("dark");b(e),$("Set dark theme to:",e)})).observe(document.body,{attributes:!0}),h.forEach((e=>{const t=s[e];if(t){const o=e.slice(2).toLowerCase();"function"==typeof t?l.on(o,(e=>{t(e),$(`Map '${o}' event:`,e)})):Object.keys(t).forEach((e=>{l.on(o,e,(r=>{t[e](r),$(`Map '${o}' event on '${e}':`,r)}))}))}})),l.on("move",(e=>{const t={...s.viewport,id:s.id,point:{x:e.originalEvent?.x,y:e.originalEvent?.y},center:s.viewport.center.lat?l.getCenter():[l.getCenter().lng,l.getCenter().lat],zoom:l.getZoom(),pitch:l.getPitch(),bearing:l.getBearing()};s.onViewportChange&&s.onViewportChange(t)}))})),u((()=>{const e={...s.viewport,padding:s.viewport?.padding||0};l&&s.id!==s.viewport?.id&&!w()&&(l?.stop()[s.transitionType||"flyTo"](e),$(`Update Viewport (${s.transitionType||"flyTo"}):`,e))})),u((e=>{const t=s.viewport?.bounds;return l&&t&&e!==t&&!w()&&(s.onViewportChange({...s.viewport,...l?.cameraForBounds(t,{padding:s.viewport?.padding})}),$("Update Viewport Boundaries:",t)),t}),s.viewport?.bounds),u((e=>{const t=s.options?.projection;return e!==t&&(l.setProjection(t),$("Set Projection to:",t)),t}),s.options?.projection),u((()=>{s.cursorStyle&&l&&(l.getCanvas().style.cursor=s.cursorStyle,$("Set Cursor to:",s.cursorStyle))}));return u((e=>{const t=L(s.options?.style,s.darkStyle);if(l?.isStyleLoaded()&&e!==t){const e=l.getStyle(),o=e.layers.filter((e=>l.layerIdList.includes(e.id))),r=Object.keys(e.sources).filter((e=>l.sourceIdList.includes(e))).reduce(((t,o)=>({...t,[o]:e.sources[o]})),{});l.setStyle(t),l.once("styledata",(()=>{if(!o)return;const e=l.getStyle();var t,a;l.setStyle({...e,sources:{...e.sources,...r},layers:(t=e.layers,a=o,a.forEach((e=>{const o=t.findIndex((t=>e.metadata.smg.beforeType?t.type===e.metadata.smg.beforeType:t.id===e.metadata.smg.beforeId));t=-1===o?[...t,e]:[...t.slice(0,o),e,...t.slice(o+1)]})),t)})})),$("Set Mapstyle to:",t)}return t}),s.options?.style),["showTileBoundaries","showTerrainWireframe","showCollisionBoxes","showPadding","showOverdrawInspector"].forEach((e=>{u((()=>{const t=s[e];l&&(l[e]=t,$(`Set ${e} to:`,t))}))})),m((()=>{l?.remove(),$("Map removed")})),n(S.Provider,{value:[c,w,$],get children(){return[i((()=>c()&&s.children)),x]}})},E=l(),T=()=>c(E),P=e=>{if(!z())return;const[t]=z();e.id=e.id||p();const o=(e,o)=>{t().debug&&console.debug("%c[MapGL]","color: #ec4899",e,o||"")},r=t=>{const o=t?.split(":").reduce(((e,t)=>e&&e[t]),_),r=o?{...e.source,url:"",tiles:[o.replace("{apikey}",e.source.apikey||import.meta.env.VITE_RASTER_API_KEY).replace("{r}",window.devicePixelRatio>1?"@2x":"")],attribution:_[t.split(":")[0]]._copy}:e.source;return r.tiles&&(r.tiles=["a","b","c"].map((e=>r.tiles[0].replace("{s}",e)))),r};t().addSource(e.id,r(e.source.url)),t().sourceIdList.push(e.id),o("Add Source:",e.id);const a=t().getSource(e.id);switch(e.source.type){case"geojson":u((()=>{const r=e.source.data;t().isSourceLoaded(e.id)&&(a.setData(r||{}),o("Update GeoJSON Data:",e.id))}));break;case"image":u((()=>{const r=e.source.url,n=e.source.coordinates;t().isSourceLoaded(e.id)&&(a.updateImage(r,n),o("Update Image Data:",e.id))}));break;case"vector":u((()=>{const r=e.source.url,n=e.source.tiles;t().isSourceLoaded(e.id)&&(r?a.setUrl(r):a.setTiles(n),o("Update Vector Data:",e.id))}));break;case"raster":u((()=>{const n=e.source.url;if(!t().isSourceLoaded(e.id))return;const i=r(n);i.tiles&&(i.tiles=["a","b","c"].map((e=>i.tiles[0].replace("{s}",e)))),a._tileJSONRequest?.cancel(),a.url=i.url,a.scheme=i.scheme,a._options={...a._options,...i},t().style._sourceCaches[`other:${e.id}`]?.clearTiles(),a.load(),o("Update Raster Data:",e.id)}))}return m((()=>{t()?.getStyle().layers.forEach((o=>o.source===e.id&&t().removeLayer(o.id))),t().removeSource(e.id),o("Remove Source:",e.id)})),n(E.Provider,{get value(){return e.id},get children(){return e.children}})},I=(e={},t={})=>[...new Set([...Object.keys(e),...Object.keys(t)])].reduce(((o,r)=>{const a=e[r];return a!==t[r]&&o.push([r,a]),o}),[]),D=e=>{if(!z())return;const[t]=z(),o=e.style.source||T();e.id=e.id||p();const r=(e,o)=>{t().debug&&console.debug("%c[MapGL]","color: #10b981",e,o||"")};return t().addLayer(e.customLayer||{...e.style,id:e.id,source:o,metadata:{smg:{beforeType:e.beforeType,beforeId:e.beforeId}}},e.beforeType?t().getStyle().layers.find((t=>t.type===e.beforeType))?.id:e.beforeId),t().layerIdList.push(e.id),r("Add Layer:",e.id),v.forEach((o=>{if(e[o]){const a=o.slice(2).toLowerCase();t().on(a,e.id,(t=>{e[o](t),r(`Layer '${a}' event on '${e.id}':`,t)}))}})),u((o=>{const a=e.style;if(a!==o&&t().isStyleLoaded())return a.layout!==o?.layout&&I(a.layout,o?.layout).forEach((([o,r])=>t().setLayoutProperty(e.id,o,r,{validate:!1}))),a.paint!==o?.paint&&I(a.paint,o?.paint).forEach((([o,r])=>t().setPaintProperty(e.id,o,r,{validate:!1}))),a.minzoom===o?.minzoom&&a.maxzoom===o?.maxzoom||t().setLayerZoomRange(e.id,a.minzoom,a.maxzoom),a.filter!==o?.filter&&t().setFilter(e.id,a.filter,{validate:!1}),r("Update Layer Style:",e.id),a}),e.style),u((o=>{if(e.visible!==o)return t().setLayoutProperty(e.id,"visibility",e.visible?"visible":"none",{validate:!1}),r(`Update Visibility (${e.id}):`,e.visible),e.visible}),e.visible),u((async()=>{e.filter&&(!t().isStyleLoaded()&&await t().once("styledata"),t().setFilter(e.id,e.filter),r(`Update Filter (${e.id}):`,e.filter))})),u((async()=>{e.featureState&&e.featureState.id&&(!t().isStyleLoaded()&&await t().once("styledata"),t().removeFeatureState({source:o,sourceLayer:e.style["source-layer"]}),t().setFeatureState({source:o,sourceLayer:e.style["source-layer"],id:e.featureState.id},e.featureState.state))})),m((()=>t()?.getLayer(e.id)&&t()?.removeLayer(e.id))),e.children},O=e=>{if(!z())return;const[t]=z();return u((()=>t().setFog(e.style||{}))),m((()=>t()?.setFog(null))),null},V=e=>{if(!z())return;const[t]=z();let o=T();return void 0===o&&(o=p(),t().addSource(o,t().isMapLibre?{type:"raster-dem",url:"https://demotiles.maplibre.org/terrain-tiles/tiles.json",tileSize:256}:{type:"raster-dem",url:"mapbox://mapbox.terrain-rgb",tileSize:512,maxzoom:14})),u((()=>{t().setTerrain({exaggeration:e.exaggeration||1,source:o})})),m((()=>t().setTerrain(null))),null},R=e=>{if(!z())return;const[t]=z();let o=null;return u((()=>{o&&t().hasControl(o)&&t().removeControl(o),o=((e,t,o,r)=>{if(r)return new r(o);switch(t){case"navigation":return new e.NavigationControl(o);case"scale":return new e.ScaleControl(o);case"attribution":return new e.AttributionControl(o);case"geolocate":return new e.GeolocateControl(o);case"fullscreen":return new e.FullscreenControl;default:throw new Error(`Unknown control type: ${t}`)}})(t().mapLib,e.type,e.options,e.custom),t().addControl(o,e.position)})),m((()=>t()?.removeControl(o))),null},q=e=>{if(!z())return;const[t]=z();let o=null,r=null;if(!e.lngLat)throw new Error("Marker - lngLat is required");return u((()=>{const a={...e.options},n={...e.options?.popup};if(!t())return;const i=t().mapLib;y((()=>{r?.remove(),r=e.children?new i.Popup(n).setHTML(e.children).on("close",(()=>e.onClose?.())):null,o?.remove(),o=new i.Marker(a).setPopup(r).on("dragstart",(()=>e.onDragStart?.())).on("dragend",(()=>e.onDragEnd?.())).on("drag",(()=>e.onLngLatChange?.(o.getLngLat().toArray()))),o.setDraggable(e.draggable).setLngLat(e.lngLat).addTo(t()),e.openPopup!==r?.isOpen()&&o.togglePopup()}))})),u((()=>e.openPopup!==r?.isOpen()&&o.togglePopup())),u((()=>o.setLngLat(e.lngLat))),u((()=>r?.setHTML(e.children))),u((()=>o.setDraggable(e.draggable))),m((()=>o?.remove())),null},A=e=>{if(!z())return;const[t]=z();let o=null;if(!e.trackPointer&&!e.lngLat)throw new Error("Popup - lngLat or trackPointer is required");return u((()=>{const r={...e.options};if(!t())return;const a=t().mapLib;y((()=>{o?.remove(),o=new a.Popup(e.trackPointer?{...r,closeOnClick:!1,closeButton:!1}:{focusAfterOpen:!1,...r}).setHTML(e.children||"").setLngLat(e.lngLat).on("close",(()=>e.onClose?.())).addTo(t())}))})),u((()=>e.trackPointer?o.trackPointer():o.setLngLat(e.lngLat))),u((()=>o.setHTML(e.children||""))),m((()=>o?.remove())),null},U={diagonal_l:{size:20,path:"M20 0 0 20M-10 10 10-10M10 30 30 10"},diagonal_r:{size:20,path:"M0 0 20 20M30 10 10-10M10 30-10 10"},horizontal:{size:14,path:"M7 0V20"},vertical:{size:14,path:"M0 7H20"},cross:{size:18,path:"M9 0V18M0 9H18"},hash:{size:30,path:"M15 0 30 15 15 30 0 15Z"},chevron_h:{size:20,path:"M-5 5 0 10 10 0 20 10 25 5M0 30 10 20 20 30"},chevron_v:{size:20,path:"M5-5 10 0 0 10 10 20 5 25M25 15 20 10 25 5"},square:{size:20,path:"M8 8H12V12H8Z",fill:!0},hex:{size:50,path:"M0 0V50L50 25ZM50 0V50L0 25ZM25 0V50"},circle:{size:25,path:"M8 10A2.5 2.5 0 118.01 10M18 15A2.5 2.5 0 1018.01 15",fill:!0}},Z=Object.keys(U),F=e=>{if(!z())return;const[t]=z(),[o,r]=d({width:0,height:0});m((()=>t()?.hasImage(e.id)&&t()?.removeImage(e.id))),u((()=>{if(!e.id)throw new Error("Image - ID is required");if(!e.image&&!e.pattern)throw new Error("Image - Image or Pattern is required");const i=e.pattern?{pixelRatio:2,...e.options}:e.options;a(e.image||n(e.pattern),(a=>{const{width:n,height:s}=a;t().hasImage(e.id)||t().addImage(e.id,a,i),!e.pattern&&y((()=>n===o().width&&s===o().height))?(t().updateImage(e.id,a),t().triggerRepaint()):(t().removeImage(e.id),t().addImage(e.id,a,i)),r({width:n,height:s})}))}));const a=(e,o)=>{if("string"!=typeof e)return o(e);t().loadImage(e,((e,t)=>{if(e)throw e;return o(t)}))},n=e=>{const t=U[e.type];return{width:t.size,height:t.size,data:new Uint8Array(t.size*t.size*4),onAdd:function(){let e=document.createElement("canvas");e.width=e.height=t.size,this.ctx=e.getContext("2d",{willReadFrequently:!0})},render:function(){return this.ctx.fillStyle=e.background||"transparent",this.ctx.fillRect(0,0,this.width,this.height),this.ctx.strokeStyle=this.ctx.fillStyle=e.color||"black",this.ctx.lineWidth=e.lineWith||1,this.ctx.stroke(new Path2D(t.path)),t.fill&&this.ctx.fill(new Path2D(t.path)),this.data=this.ctx.getImageData(0,0,this.width,this.height).data,!0}}};return null},G={in:e=>e*e,out:e=>1-(1-e)*(1-e),inOut:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},B=e=>{if(!z())return;const[t,o]=z();let r=.1,a=!1;const n=o=>{e.translate&&window.requestAnimationFrame(n);const i=[e.translate.start,e.translate.end,e.translate.easing?G[e.translate.easing](r):r];(async([e,o,r],a)=>{const n=t().getFreeCameraOptions();n.position=t().mapLib.MercatorCoordinate.fromLngLat([e,o],r),n.lookAtPoint(a),t().setFreeCameraOptions(n)})("line"===e.translate.type?((e,t,o)=>e.map(((r,a)=>(1-o)*e[a]+o*t[a])))(...i):((e,t,o)=>{const r=.075;return e.map(((a,n)=>Math.sin((1-o)*r)/Math.sin(r)*e[n]+Math.sin(o*r)/Math.sin(r)*t[n]))})(...i),e.translate.target),!e.translate.loop&&(r>1||r<0)&&(a=!a),r=a?r-.001:r+.001};u((()=>{e.translate&&window.requestAnimationFrame(n)}));const i=()=>{const r=e.rotateGlobe.secPerRev||120,a=e.rotateGlobe.maxZoom||5,n=e.rotateGlobe.slowZoom||3,i=t().getZoom();if(e.rotateGlobe&&!o()&&i<a){let e=360/r;if(i>n){e*=(a-i)/(a-n)}const o=t().getCenter();o.lng-=e,t().easeTo({center:o,duration:1e3,easing:e=>e},{rotate:!0})}},s=()=>{const r=e.rotateViewport?.secPerRev||60;if(e.rotateViewport&&!o()){let o=360/r;const a=t().getBearing()-o;t().easeTo({bearing:a,pitch:e.rotateViewport?.pitch||80,duration:1e3,around:e.rotateViewport?.around,easing:e=>e},{rotate:!0})}};return t().on("moveend",(t=>t.rotate&&e.rotateGlobe?i():s())),u((()=>e.rotateGlobe?!o()&&i():t().stop())),u((()=>e.rotateViewport?!o()&&s():t().stop().resetNorthPitch())),e.children},H=e=>{if(!z())return;const[t]=z();return u((()=>t().setLight(e.style||{}))),m((()=>t()?.setLight(null))),null};export{O as Atmosphere,B as Camera,R as Control,F as Image,D as Layer,H as Light,q as Marker,A as Popup,P as Source,V as Terrain,C as default,Z as patternList,z as useMap,T as useSourceId};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/events.ts","../../src/mapStyles.ts","../../src/components/MapGL/index.tsx","../../src/components/Source/index.tsx","../../src/components/Layer/index.tsx","../../src/components/Atmosphere/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","../../src/components/Camera/index.tsx","../../src/components/Light/index.tsx"],"sourcesContent":["type mapEventTypes = {\n onMouseDown?: Function\n onMouseUp?: Function\n onMouseOver?: Function\n onMouseOut?: Function\n onMouseMove?: Function\n onMouseEnter?: Function\n onMouseLeave?: Function\n onPreClick?: Function\n onClick?: Function\n onDblClick?: Function\n onContextMenu?: Function\n onTouchStart?: Function\n onTouchEnd?: Function\n onTouchCancel?: Function\n onWheel?: Function\n onResize?: Function\n onRemove?: Function\n onTouchMove?: Function\n onMoveStart?: Function\n onMove?: Function\n onMoveEnd?: Function\n onDragStart?: Function\n onDrag?: Function\n onDragEnd?: Function\n onZoomStart?: Function\n onZoom?: Function\n onZoomEnd?: Function\n onRotateStart?: Function\n onRotate?: Function\n onRotatEnd?: Function\n onPitchStart?: Function\n onPitch?: Function\n onPitchEnd?: Function\n onBoxZoomStart?: Function\n onBoxZoomEnd?: Function\n onBoxZoomCancel?: Function\n onWebglContextLost?: Function\n onWebglContextRestored?: Function\n onLoad?: Function\n onRender?: Function\n onIdle?: Function\n onError?: Function\n onData?: Function\n onStyleData?: Function\n onSourceData?: Function\n onDataLoading?: Function\n onStyleDataLoading?: Function\n onSourceDataLoading?: Function\n onStyleImageMissing?: Function\n}\n\nconst mapEvents: string[] = [\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseOver',\n 'onMouseOut',\n 'onMouseMove',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onPreClick',\n 'onClick',\n 'onDblClick',\n 'onContextMenu',\n 'onTouchStart',\n 'onTouchEnd',\n 'onTouchCancel',\n 'onWheel',\n 'onResize',\n 'onRemove',\n 'onTouchMove',\n 'onMoveStart',\n 'onMove',\n 'onMoveEnd',\n 'onDragStart',\n 'onDrag',\n 'onDragEnd',\n 'onZoomStart',\n 'onZoom',\n 'onZoomEnd',\n 'onRotateStart',\n 'onRotate',\n 'onRotatEnd',\n 'onPitchStart',\n 'onPitch',\n 'onPitchEnd',\n 'onBoxZoomStart',\n 'onBoxZoomEnd',\n 'onBoxZoomCancel',\n 'onWebglContextLost',\n 'onWebglContextRestored',\n 'onLoad',\n 'onRender',\n 'onIdle',\n 'onError',\n 'onData',\n 'onStyleData',\n 'onSourceData',\n 'onDataLoading',\n 'onStyleDataLoading',\n 'onSourceDataLoading',\n 'onStyleImageMissing',\n]\n\ntype layerEventTypes = {\n onMouseDown?: Function\n onMouseUp?: Function\n onMouseOver?: Function\n onMouseOut?: Function\n onMouseMove?: Function\n onMouseEnter?: Function\n onMouseLeave?: Function\n onClick?: Function\n onDblClick?: Function\n onContextMenu?: Function\n onTouchStart?: Function\n onTouchEnd?: Function\n onTouchCancel?: Function\n}\n\nconst layerEvents: any[] = [\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseOver',\n 'onMouseOut',\n 'onMouseMove',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onClick',\n 'onDblClick',\n 'onContextMenu',\n 'onTouchStart',\n 'onTouchEnd',\n 'onTouchCancel',\n]\n\nexport { mapEvents, layerEvents }\nexport type { mapEventTypes, layerEventTypes }\n","const mapBase = 'mapbox://styles/mapbox'\nconst gitBase = 'https://raw.githubusercontent.com/'\nconst gishub = 'https://raw.githubusercontent.com/GIShub4/map-styles/main/'\nconst hereBase = 'https://assets.vector.hereapi.com/styles/'\n\nexport const vectorStyleList: object = {\n mb: {\n light: `${mapBase}/light-v11`,\n dark: `${mapBase}/dark-v11`,\n street: `${mapBase}/streets-v12`,\n outdoor: `${mapBase}/outdoors-v12`,\n sat: `${mapBase}/satellite-v9`,\n sat_street: `${mapBase}/satellite-streets-v12`,\n nav: `${mapBase}/navigation-guidance-day-v4`,\n nav_night: `${mapBase}/navigation-guidance-night-v4`,\n basic: `${mapBase}/cjf4m44iw0uza2spb3q0a7s41`,\n monochrome: `${mapBase}/cjv6rzz4j3m4b1fqcchuxclhb`,\n leshine: `${mapBase}/cjcunv5ae262f2sm9tfwg8i0w`,\n icecream: `${mapBase}/cj7t3i5yj0unt2rmt3y4b5e32`,\n cali: `${mapBase}/cjerxnqt3cgvp2rmyuxbeqme7`,\n northstar: `${mapBase}/cj44mfrt20f082snokim4ungi`,\n mineral: `${mapBase}/cjtep62gq54l21frr1whf27ak`,\n moonlight: `${mapBase}/cj3kbeqzo00022smj7akz3o1e`,\n frank: `${mapBase}-map-design/ckshxkppe0gge18nz20i0nrwq`,\n minimo: `${mapBase}-map-design/cksjc2nsq1bg117pnekb655h1`,\n decimal: `${mapBase}-map-design/ck4014y110wt61ctt07egsel6`,\n standard: `${mapBase}-map-design/ckr0svm3922ki18qntevm857n`,\n blueprint: `${mapBase}-map-design/cks97e1e37nsd17nzg7p0308g`,\n bubble: `${mapBase}-map-design/cksysy2nl62zp17quosctdtcc`,\n pencil: `${mapBase}-map-design/cks9iema71es417mlrft4go2k`,\n swiss_ski: `${gitBase}mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,\n vintage: `${gitBase}mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,\n whaam: `${gitBase}mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,\n neon: `${gitBase}NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,\n camoflauge: `${gitBase}jingsam/mapbox-gl-styles/master/Camouflage.json`,\n emerald: `${gitBase}jingsam/mapbox-gl-styles/master/Emerald.json`,\n runner: `${gitBase}jingsam/mapbox-gl-styles/master/Runner.json`,\n x_ray: `${gitBase}jingsam/mapbox-gl-styles/master/X-ray.json`,\n },\n here: {\n base: `${hereBase}berlin/base/mapbox/tilezen?apikey={apikey}`,\n day: `${hereBase}berlin/day/mapbox/tilezen?apikey={apikey}`,\n night: `${hereBase}berlin/night/mapbox/tilezen?apikey={apikey}`,\n },\n esri: {\n blueprint: `${gishub}esri:blueprint.json`,\n charted_territory: `${gishub}esri:charted-territory.json`,\n colored_pencil: `${gishub}esri:colored-pencil.json`,\n community: `${gishub}esri:community.json`,\n mid_century: `${gishub}esri:mid-century.json`,\n modern_antique: `${gishub}esri:modern-antique.json`,\n nat_geo: `${gishub}esri:national-geographic.json`,\n newspaper: `${gishub}esri:newspaper.json`,\n open_street_map: `${gishub}esri:open-street-map.json`,\n light_gray_canvas: `${gishub}esri:light-gray-canvas.json`,\n dark_gray_canvas: `${gishub}esri:dark-gray-canvas.json`,\n human_geo_light: `${gishub}esri:human-geography-light.json`,\n human_geo_dark: `${gishub}esri:human-geography-dark.json`,\n world_navigation: `${gishub}esri:world-navigation.json`,\n world_street: `${gishub}esri:world-street.json`,\n world_street_night: `${gishub}esri:world-street-night.json`,\n world_terrain: `${gishub}esri:world-terrain.json`,\n world_terrain_hybrid: `${gishub}esri:world-terrain-hybrid.json`,\n world_topographic: `${gishub}esri:world-topographic.json`,\n chromium: `${gishub}esri:chromium.json`,\n dreamcatcher: `${gishub}esri:dreamcatcher.json`,\n seahaven: `${gishub}esri:seahaven.json`,\n sangria: `${gishub}esri:sangria.json`,\n mercurial: `${gishub}esri:mercurial.json`,\n imagery: `${gishub}esri:imagery.json`,\n imagery_hybrid: `${gishub}esri:imagery-hybrid.json`,\n firefly: `${gishub}esri:firefly.json`,\n firefly_hybrid: `${gishub}esri:firefly-hybrid.json`,\n oceans: `${gishub}esri:oceans.json`,\n },\n}\nconst carto = 'https://{s}.basemaps.cartocdn.com/rastertiles/'\nconst stamen = 'https://stamen-tiles-{s}.a.ssl.fastly.net/'\nconst tf = 'https://{s}.tile.thunderforest.com/'\n\nexport const rasterStyleList: object = {\n osm: {\n org: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n human: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',\n cycle: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',\n topo: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',\n _copy:\n '<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap</a>',\n },\n carto: {\n voyager: `${carto}voyager_labels_under/{z}/{x}/{y}{r}.png`,\n positron: `${carto}light_all/{z}/{x}/{y}{r}.png`,\n dark: `${carto}dark_all/{z}/{x}/{y}{r}.png`,\n _copy:\n '<a href=\"https://carto.com/attribution\" target=\"_blank\">© Carto</a>',\n },\n stamen: {\n toner: `${stamen}toner/{z}/{x}/{y}{r}.png`,\n toner_lite: `${stamen}toner-lite/{z}/{x}/{y}{r}.png`,\n watercolor: `${stamen}watercolor/{z}/{x}/{y}.png`,\n terrain: `${stamen}terrain/{z}/{x}/{y}{r}.png`,\n _copy:\n '<a href=\"https://stamen.com/privacy-policy\" target=\"_blank\">© Stamen Design</a>',\n },\n tf: {\n cycle: `${tf}cycle/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n trans: `${tf}transport/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n trans_dark: `${tf}transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n landscape: `${tf}landscape/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n outdoors: `${tf}outdoors/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n neighbourhood: `${tf}neighbourhood/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n spinal: `${tf}spinal-map/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n pioneer: `${tf}pioneer/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n atlas: `${tf}atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n mobile: `${tf}mobile-atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n _copy:\n '<a href=\"https://thunderforest.com/privacy\" target=\"_blank\">© Thunderforest</a>',\n },\n}\n","import {\n createSignal,\n createEffect,\n onMount,\n onCleanup,\n createContext,\n useContext,\n Component,\n createUniqueId,\n} from 'solid-js'\nimport { mapEvents } from '../../events'\nimport { vectorStyleList } from '../../mapStyles'\nimport type { mapEventTypes } from '../../events'\nimport type { MapboxMap, MapboxOptions } from 'mapbox-gl/src/ui/map'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\nimport type { LngLatBounds } from 'mapbox-gl/src/geo/lng_lat_bounds.js'\nimport type { PaddingOptions } from 'mapbox-gl/src/geo/edge_insets.js'\nimport type { StyleSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { JSX } from 'solid-js'\n\nexport type Viewport = {\n id?: string\n point?: { x: number; y: number }\n center?: LngLatLike\n bounds?: LngLatBounds\n zoom?: number\n pitch?: number\n bearing?: number\n padding?: PaddingOptions\n}\n\nconst MapContext = createContext()\n/** Provides the Mapbox Map Object */\nexport const useMap = (): MapboxMap => useContext(MapContext)\n\n/** Creates a new Map Container */\nexport const MapGL: Component<\n {\n id?: string\n /** Map Container CSS Style */\n style?: JSX.CSSProperties\n /** Map Container CSS Class */\n class?: string\n /** SolidJS Class List for Map Container */\n classList?: {\n [k: string]: boolean | undefined\n }\n /** Current Map View */\n viewport?: Viewport\n /** Mapbox Options\n * @see https://docs.mapbox.com/mapbox-gl-js/api/map/#map-parameters\n */\n options?: MapboxOptions\n /** Type for pan, move and zoom transitions */\n transitionType?: 'flyTo' | 'easeTo' | 'jumpTo'\n /** Event listener for Viewport updates */\n onViewportChange?: (viewport: Viewport) => void\n /** Event listener for User Interaction */\n onUserInteraction?: (user: boolean) => void\n /** Displays Map Tile Borders */\n showTileBoundaries?: boolean\n /** Displays Wireframe if Terrain is visible */\n showTerrainWireframe?: boolean\n /** Displays Borders if Padding is set */\n showPadding?: boolean\n /** Displays Label Collision Boxes */\n showCollisionBoxes?: boolean\n /** Displays all feature outlines even if normally not drawn by style rules */\n showOverdrawInspector?: boolean\n /** Mouse Cursor Style */\n cursorStyle?: string\n //** Dark Map Style */\n darkStyle?: StyleSpecification | string\n //** Disable automatic map resize */\n disableResize?: boolean\n //** MapLibre library */\n mapLib?: any\n //** APIkey for vector service */\n apikey?: string\n //** Debug Message Mode */\n debug?: boolean\n ref?: HTMLDivElement\n /** Children within the Map Container */\n children?: any\n } & mapEventTypes\n> = props => {\n props.id = props.id || createUniqueId()\n\n let map: MapboxMap\n let resizeObserver: ResizeObserver\n\n const [mapRoot, setMapRoot] = createSignal<MapboxMap>()\n const [darkMode, setDarkMode] = createSignal(false)\n const [userInteraction, setUserInteraction] = createSignal(false)\n // debounce user interactions\n createEffect(() => props.onUserInteraction?.(userInteraction()))\n\n const debug = (text, value?) => {\n props.debug &&\n console.debug('%c[MapGL]', 'color: #0ea5e9', text, value || '')\n }\n\n const mapRef = (\n <div\n id={props.id}\n class={props?.class}\n classList={props?.classList}\n style={\n props?.style || props?.class || props?.classList\n ? props.style\n : { position: 'absolute', inset: 0, ...props.style }\n }\n />\n )\n\n const getStyle = (light, dark) => {\n const style = darkMode() ? dark || light : light\n return typeof style === 'string' || style instanceof String\n ? style\n ?.split(':')\n .reduce((p, c) => p && p[c], vectorStyleList)\n ?.replace(\n '{apikey}',\n //@ts-ignore\n props.apikey || import.meta.env.VITE_VECTOR_API_KEY\n ) || style\n : style || { version: 8, sources: {}, layers: [] }\n }\n\n onMount(async () => {\n let mapLib = props.mapLib || (await import('mapbox-gl'))\n if (!mapLib.Map) mapLib = window['maplibregl'] || window['mapboxgl']\n\n if (!mapLib.supported()) throw new Error('Mapbox GL not supported')\n\n debug(`Map (v${mapLib.version}) loading...`)\n map = new mapLib.Map({\n accessToken:\n //@ts-ignore\n props.options.accessToken || import.meta.env.VITE_MAPBOX_ACCESS_TOKEN,\n interactive: props.options.interactive || !!props.onViewportChange,\n ...props.options,\n ...props.viewport,\n container: mapRef,\n style: getStyle(props.options?.style, props.darkStyle),\n fitBoundsOptions: { padding: props.viewport?.padding },\n } as MapboxOptions)\n\n map.mapLib = mapLib\n map.debug = props.debug\n map.sourceIdList = []\n map.layerIdList = []\n\n map.once('load', () => {\n setMapRoot(map)\n debug('Map loaded')\n })\n\n // Handle User Interaction\n ;['mousedown', 'touchstart', 'wheel'].forEach(event =>\n map.on(event, () => setUserInteraction(true))\n )\n map.on('moveend', evt => !evt.rotate && setUserInteraction(false))\n\n // Listen to dark theme changes\n const darkTheme =\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-color-scheme: dark)')\n darkTheme?.addEventListener('change', () => {\n setDarkMode(darkTheme.matches)\n debug('Set dark theme to:', darkTheme.matches?.toString())\n })\n new MutationObserver(() => {\n const darkTheme = document.body.classList.contains('dark')\n setDarkMode(darkTheme)\n debug('Set dark theme to:', darkTheme)\n }).observe(document.body, { attributes: true })\n\n // Listen to map container size changes\n // !props.disableResize &&\n // new ResizeObserver(() => {\n // map?.resize()\n // debug('Map resized')\n // }).observe(mapRef as Element)\n\n // Hook up events\n mapEvents.forEach(item => {\n const prop = props[item]\n if (prop) {\n const event = item.slice(2).toLowerCase()\n if (typeof prop === 'function') {\n map.on(event, e => {\n prop(e)\n debug(`Map '${event}' event:`, e)\n })\n } else {\n Object.keys(prop).forEach(layerId => {\n map.on(event, layerId, e => {\n prop[layerId](e)\n debug(`Map '${event}' event on '${layerId}':`, e)\n })\n })\n }\n }\n })\n\n // Hook up viewport events\n map.on('move', event => {\n const viewport: Viewport = {\n ...props.viewport,\n id: props.id,\n point: { x: event.originalEvent?.x, y: event.originalEvent?.y },\n center: props.viewport.center.lat\n ? map.getCenter()\n : [map.getCenter().lng, map.getCenter().lat],\n zoom: map.getZoom(),\n pitch: map.getPitch(),\n bearing: map.getBearing(),\n }\n props.onViewportChange && props.onViewportChange(viewport)\n })\n })\n\n // Update Viewport\n createEffect(() => {\n const viewport = {\n ...props.viewport,\n padding: props.viewport?.padding || 0,\n }\n if (!map || props.id === props.viewport?.id || userInteraction()) return\n map?.stop()[props.transitionType](viewport)\n debug(`Update Viewport (${props.transitionType}):`, viewport)\n })\n\n // Update boundaries\n createEffect(prev => {\n const bounds = props.viewport?.bounds\n if (map && bounds && prev !== bounds && !userInteraction()) {\n props.onViewportChange({\n ...props.viewport,\n ...map?.cameraForBounds(bounds, {\n padding: props.viewport?.padding,\n }),\n })\n debug(`Update Viewport Boundaries:`, bounds)\n }\n return bounds\n }, props.viewport?.bounds)\n\n // Update Projection\n createEffect(prev => {\n const proj = props.options?.projection\n if (prev !== proj) {\n map.setProjection(proj)\n debug('Set Projection to:', proj)\n }\n return proj\n }, props.options?.projection)\n\n // Update cursor\n createEffect(() => {\n if (!props.cursorStyle || !map) return\n map.getCanvas().style.cursor = props.cursorStyle\n debug('Set Cursor to:', props.cursorStyle)\n })\n\n const insertLayers = (list, layers) => {\n layers.forEach(layer => {\n const index = list.findIndex(i =>\n layer.metadata.smg.beforeType\n ? i.type === layer.metadata.smg.beforeType\n : i.id === layer.metadata.smg.beforeId\n )\n list =\n index === -1\n ? [...list, layer]\n : [...list.slice(0, index), layer, ...list.slice(index + 1)]\n })\n return list\n }\n\n // Update map style\n createEffect(prev => {\n const style = getStyle(props.options?.style, props.darkStyle)\n if (map?.isStyleLoaded() && prev !== style) {\n const oldStyle = map.getStyle()\n const oldLayers = oldStyle.layers.filter(l =>\n map.layerIdList.includes(l.id)\n )\n const oldSources = Object.keys(oldStyle.sources)\n .filter(s => map.sourceIdList.includes(s))\n .reduce((obj, key) => ({ ...obj, [key]: oldStyle.sources[key] }), {})\n\n map.setStyle(style)\n map.once('styledata', () => {\n if (!oldLayers) return\n const newStyle = map.getStyle()\n map.setStyle({\n ...newStyle,\n sources: { ...newStyle.sources, ...oldSources },\n layers: insertLayers(newStyle.layers, oldLayers),\n })\n })\n debug('Set Mapstyle to:', style)\n }\n return style\n }, props.options?.style)\n\n // Update debug features\n ;[\n 'showTileBoundaries',\n 'showTerrainWireframe',\n 'showCollisionBoxes',\n 'showPadding',\n 'showOverdrawInspector',\n ].forEach(item => {\n createEffect(() => {\n const prop = props[item]\n if (!map) return\n map[item] = prop\n debug(`Set ${item} to:`, prop)\n })\n })\n\n onCleanup(() => {\n resizeObserver?.disconnect()\n map?.remove()\n debug('Map removed')\n })\n\n return (\n <MapContext.Provider value={[mapRoot, userInteraction, debug]}>\n {mapRoot() && props.children}\n {mapRef}\n </MapContext.Provider>\n )\n}\n","import {\n onCleanup,\n createEffect,\n Component,\n createContext,\n useContext,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { SourceSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport { rasterStyleList } from '../../mapStyles'\n\nconst SourceContext = createContext<string>()\nexport const useSourceId = (): string => useContext(SourceContext)\n\nexport const Source: Component<{\n /** @optional Source ID for referencing non nexted Layers */\n id?: string\n /** @see https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/ */\n source: SourceSpecification\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n props.id = props.id || createUniqueId()\n\n const debug = (text, value?) => {\n map().debug &&\n console.debug('%c[MapGL]', 'color: #ec4899', text, value || '')\n }\n\n const lookup = url => {\n const s = url?.split(':').reduce((p, c) => p && p[c], rasterStyleList)\n const source = s\n ? {\n ...props.source,\n url: '',\n tiles: [\n s\n .replace(\n '{apikey}', //@ts-ignore\n props.source.apikey || import.meta.env.VITE_RASTER_API_KEY\n )\n .replace('{r}', window.devicePixelRatio > 1 ? '@2x' : ''),\n ],\n attribution: rasterStyleList[url.split(':')[0]]._copy,\n }\n : props.source\n\n source.tiles &&\n (source.tiles = ['a', 'b', 'c'].map(i =>\n source.tiles[0].replace('{s}', i)\n ))\n\n return source\n }\n\n // Add Source\n map().addSource(props.id, lookup(props.source.url))\n map().sourceIdList.push(props.id)\n debug('Add Source:', props.id)\n\n // Update Data\n const source = map().getSource(props.id)\n switch (props.source.type) {\n case 'geojson':\n createEffect(() => {\n const data = props.source.data\n if (!map().isSourceLoaded(props.id)) return\n source.setData(data || {})\n debug('Update GeoJSON Data:', props.id)\n })\n break\n case 'image':\n createEffect(() => {\n const url = props.source.url\n const coords = props.source.coordinates\n if (!map().isSourceLoaded(props.id)) return\n source.updateImage(url, coords)\n debug('Update Image Data:', props.id)\n })\n break\n case 'vector':\n createEffect(() => {\n const url = props.source.url\n const tiles = props.source.tiles\n if (!map().isSourceLoaded(props.id)) return\n url ? source.setUrl(url) : source.setTiles(tiles)\n debug('Update Vector Data:', props.id)\n })\n break\n case 'raster':\n createEffect(() => {\n const url = props.source.url\n if (!map().isSourceLoaded(props.id)) return\n const src = lookup(url)\n src.tiles &&\n (src.tiles = ['a', 'b', 'c'].map(i => src.tiles[0].replace('{s}', i)))\n source._tileJSONRequest?.cancel()\n source.url = src.url\n source.scheme = src.scheme\n source._options = { ...source._options, ...src }\n map().style._sourceCaches[`other:${props.id}`]?.clearTiles()\n source.load()\n debug('Update Raster Data:', props.id)\n })\n break\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().removeSource(props.id)\n debug('Remove Source:', props.id)\n })\n\n return (\n <SourceContext.Provider value={props.id}>\n {props.children}\n </SourceContext.Provider>\n )\n}\n","import { onCleanup, createEffect, Component, createUniqueId } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSourceId } from '../Source'\nimport { layerEvents } from '../../events'\nimport type { layerEventTypes } from '../../events'\nimport type {\n FilterSpecification,\n StyleSpecification,\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\nexport const Layer: Component<\n {\n id?: string\n style?: StyleSpecification\n customLayer?: 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 children?: any\n } & layerEventTypes\n> = props => {\n if (!useMap()) return\n const [map] = useMap()\n const sourceId: string = props.style.source || useSourceId()\n props.id = props.id || createUniqueId()\n\n const debug = (text, value?) => {\n map().debug &&\n console.debug('%c[MapGL]', 'color: #10b981', text, value || '')\n }\n\n // Add Layer\n // if (!map().getLayer(props.id)) {\n map().addLayer(\n props.customLayer || {\n ...props.style,\n id: props.id,\n source: sourceId,\n metadata: {\n smg: { beforeType: props.beforeType, beforeId: props.beforeId },\n },\n },\n props.beforeType\n ? map()\n .getStyle()\n .layers.find(l => l.type === props.beforeType)?.id\n : props.beforeId\n )\n map().layerIdList.push(props.id)\n debug('Add Layer:', props.id)\n\n // Hook up events\n layerEvents.forEach(item => {\n if (props[item]) {\n const event = item.slice(2).toLowerCase()\n map().on(event, props.id, evt => {\n props[item](evt)\n debug(`Layer '${event}' event on '${props.id}':`, evt)\n })\n }\n })\n // }\n\n // Update Style\n createEffect((prev: StyleSpecification) => {\n const style = props.style\n if (style === prev || !map().isStyleLoaded()) return\n\n if (style.layout !== prev?.layout)\n diff(style.layout, prev?.layout).forEach(([key, value]) =>\n map().setLayoutProperty(props.id, key, value, { validate: false })\n )\n\n if (style.paint !== prev?.paint)\n diff(style.paint, prev?.paint).forEach(([key, value]) =>\n map().setPaintProperty(props.id, key, value, { validate: false })\n )\n\n if (style.minzoom !== prev?.minzoom || style.maxzoom !== prev?.maxzoom)\n map().setLayerZoomRange(props.id, style.minzoom, style.maxzoom)\n\n if (style.filter !== prev?.filter)\n map().setFilter(props.id, style.filter, { validate: false })\n\n debug('Update Layer Style:', props.id)\n return style\n }, props.style)\n\n // Update Visibility\n createEffect((prev: boolean) => {\n if (props.visible === prev) return\n\n map().setLayoutProperty(\n props.id,\n 'visibility',\n props.visible ? 'visible' : 'none',\n { validate: false }\n )\n debug(`Update Visibility (${props.id}):`, props.visible)\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 debug(`Update Filter (${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: sourceId,\n sourceLayer: props.style['source-layer'],\n })\n map().setFeatureState(\n {\n source: sourceId,\n sourceLayer: props.style['source-layer'],\n id: props.featureState.id,\n },\n props.featureState.state\n )\n })\n\n //Remove Layer\n onCleanup(() => map()?.getLayer(props.id) && map()?.removeLayer(props.id))\n\n return props.children\n}\n","import { onCleanup, createEffect, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { FogSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Atmosphere: VoidComponent<{\n style: FogSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n\n // Add or Update Atmosphere Layer\n createEffect(() => map().setFog(props.style || {}))\n\n // Remove Atmosphere Layer\n onCleanup(() => map()?.setFog(null))\n\n return null\n}\n","import {\n onCleanup,\n createEffect,\n VoidComponent,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSourceId } from '../Source'\nimport type {\n SourceSpecification,\n TerrainSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Terrain: VoidComponent<{\n exaggeration?: number\n source?: TerrainSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let sourceId: SourceSpecification = useSourceId()\n\n // Add Terrain Layer\n if (sourceId === undefined) {\n sourceId = createUniqueId()\n map().addSource(\n sourceId,\n map().isMapLibre\n ? {\n type: 'raster-dem',\n url: 'https://demotiles.maplibre.org/terrain-tiles/tiles.json',\n tileSize: 256,\n }\n : {\n type: 'raster-dem',\n url: 'mapbox://mapbox.terrain-rgb',\n tileSize: 512,\n maxzoom: 14,\n }\n )\n }\n\n createEffect(() => {\n map().setTerrain({\n exaggeration: props.exaggeration || 1,\n source: sourceId,\n })\n })\n\n // Remove Terrain Layer\n onCleanup(() => map().setTerrain(null))\n\n return null\n}\n","import { createEffect, onCleanup, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\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 getControl = (lib, type, options, custom?) => {\n if (custom) return new custom(options)\n switch (type) {\n case 'navigation':\n return new lib.NavigationControl(options)\n case 'scale':\n return new lib.ScaleControl(options)\n case 'attribution':\n return new lib.AttributionControl(options)\n case 'geolocate':\n return new lib.GeolocateControl(options)\n case 'fullscreen':\n return new lib.FullscreenControl()\n // options || { container: map().container }\n default:\n throw new Error(`Unknown control type: ${type}`)\n }\n}\n\nexport const Control: VoidComponent<{\n type: 'navigation' | 'scale' | 'attribution' | 'fullscreen' | 'geolocate'\n options?:\n | NavigationOptions\n | ScaleOptions\n | AttributionOptions\n | FullscreenOptions\n | GeolocateOptions\n | object\n custom?: any\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n const mapLib = map().mapLib\n let control = null\n\n // Add or Update Control\n createEffect(() => {\n control && map().hasControl(control) && map().removeControl(control)\n control = getControl(mapLib, props.type, props.options, props.custom)\n map().addControl(control, props.position)\n })\n\n // Remove Control\n onCleanup(() => map()?.removeControl(control))\n\n return null\n}\n","import { onCleanup, createEffect, Component, untrack } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n Popup as PopupType,\n PopupOptions,\n} from 'mapbox-gl/src/ui/popup.js'\nimport type {\n Marker as MarkerType,\n MarkerOptions,\n} from 'mapbox-gl/src/ui/marker.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nexport const Marker: Component<{\n options?: MarkerOptions & { popup: PopupOptions }\n lngLat: LngLatLike\n openPopup?: boolean\n draggable?: boolean\n onLngLatChange?: Function\n onClose?: Function\n onDragStart?: Function\n onDragEnd?: Function\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let marker: MarkerType = null\n let popup: PopupType = null\n\n if (!props.lngLat) throw new Error('Marker - lngLat is required')\n\n // Add or Update Marker\n createEffect(() => {\n const ops = { ...props.options }\n const pops = { ...props.options?.popup }\n untrack(() => {\n popup?.remove()\n popup = props.children\n ? new map().mapLib\n .Popup(pops)\n .setHTML(props.children)\n .on('close', () => props.onClose?.())\n : null\n\n marker?.remove()\n marker = new map().mapLib\n .Marker(ops)\n .setPopup(popup)\n .on('dragstart', () => props.onDragStart?.())\n .on('dragend', () => props.onDragEnd?.())\n .on('drag', () => props.onLngLatChange?.(marker.getLngLat().toArray()))\n marker.setDraggable(props.draggable).setLngLat(props.lngLat).addTo(map())\n props.openPopup !== popup?.isOpen() && marker.togglePopup()\n })\n })\n\n // Toggle Popup\n createEffect(\n () => props.openPopup !== popup?.isOpen() && marker.togglePopup()\n )\n\n // Update Position\n createEffect(() => marker.setLngLat(props.lngLat))\n\n // Update Popup Content\n createEffect(() => popup?.setHTML(props.children))\n\n // Update Draggable\n createEffect(() => marker.setDraggable(props.draggable))\n\n // Remove Marker\n onCleanup(() => marker?.remove())\n\n return null\n}\n","import { onCleanup, createEffect, Component, untrack } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n Popup as PopupType,\n PopupOptions,\n} from 'mapbox-gl/src/ui/popup.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nexport const Popup: Component<{\n options?: PopupOptions\n trackPointer?: boolean\n lngLat: LngLatLike\n onClose?: Function\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let popup: PopupType = null\n\n if (!props.trackPointer && !props.lngLat)\n throw new Error('Popup - lngLat or trackPointer is required')\n\n // Add or Update Popup\n createEffect(() => {\n const ops = { ...props.options }\n untrack(() => {\n popup?.remove()\n popup = new map().mapLib\n .Popup(\n props.trackPointer\n ? { ...ops, closeOnClick: false, closeButton: false }\n : { focusAfterOpen: false, ...ops }\n )\n .setHTML(props.children || '')\n .setLngLat(props.lngLat)\n .on('close', () => props.onClose?.())\n .addTo(map())\n })\n })\n\n // Update Position\n createEffect(() =>\n props.trackPointer ? popup.trackPointer() : popup.setLngLat(props.lngLat)\n )\n\n // Update Content\n createEffect(() => popup.setHTML(props.children || ''))\n\n // Remove Popup\n onCleanup(() => popup?.remove())\n\n return null\n}\n","import {\n onCleanup,\n createSignal,\n createEffect,\n VoidComponent,\n untrack,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n StyleImageInterface,\n StyleImageMetadata,\n} from 'mapbox-gl/src/style/style_image'\n\nconst PATTERN = {\n diagonal_l: { size: 20, path: 'M20 0 0 20M-10 10 10-10M10 30 30 10' },\n diagonal_r: { size: 20, path: 'M0 0 20 20M30 10 10-10M10 30-10 10' },\n horizontal: { size: 14, path: 'M7 0V20' },\n vertical: { size: 14, path: 'M0 7H20' },\n cross: { size: 18, path: 'M9 0V18M0 9H18' },\n hash: { size: 30, path: 'M15 0 30 15 15 30 0 15Z' },\n chevron_h: { size: 20, path: 'M-5 5 0 10 10 0 20 10 25 5M0 30 10 20 20 30' },\n chevron_v: { size: 20, path: 'M5-5 10 0 0 10 10 20 5 25M25 15 20 10 25 5' },\n square: { size: 20, path: 'M8 8H12V12H8Z', fill: true },\n hex: { size: 50, path: 'M0 0V50L50 25ZM50 0V50L0 25ZM25 0V50' },\n circle: {\n size: 25,\n path: 'M8 10A2.5 2.5 0 118.01 10M18 15A2.5 2.5 0 1018.01 15',\n fill: true,\n },\n}\n\nexport const patternList = Object.keys(PATTERN)\n\nexport type Color =\n | `#${string}`\n | `rgb(${number}, ${number}, ${number})`\n | `hsl(${number}, ${number}%, ${number}%)`\n\nexport const Image: VoidComponent<{\n id: string\n image?:\n | HTMLImageElement\n | ImageBitmap\n | ImageData\n | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }\n | StyleImageInterface\n | string\n options?: StyleImageMetadata\n pattern?: {\n type: string\n color: Color\n background: Color\n lineWith: number\n }\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n const [size, setSize] = createSignal({ width: 0, height: 0 })\n\n // Remove Image\n onCleanup(() => map()?.hasImage(props.id) && map()?.removeImage(props.id))\n\n // Add or Update Image\n createEffect(() => {\n if (!props.id) throw new Error('Image - ID is required')\n if (!props.image && !props.pattern)\n throw new Error('Image - Image or Pattern is required')\n\n const ops = props.pattern\n ? { pixelRatio: 2, ...props.options }\n : props.options\n\n _loadImage(props.image || _createPattern(props.pattern), data => {\n const { width, height } = data\n if (!map().hasImage(props.id)) map().addImage(props.id, data, ops)\n if (\n !props.pattern &&\n untrack(() => width === size().width && height === size().height)\n ) {\n map().updateImage(props.id, data)\n map().triggerRepaint()\n } else {\n map().removeImage(props.id)\n map().addImage(props.id, data, ops)\n }\n setSize({ width, height })\n })\n })\n\n // Load Image from URL\n const _loadImage = (image, callback) => {\n if (typeof image !== 'string') return callback(image)\n map().loadImage(image, (error, imageData) => {\n if (error) throw error\n return callback(imageData)\n })\n }\n\n const _createPattern = pattern => {\n const p = PATTERN[pattern.type]\n return {\n width: p.size,\n height: p.size,\n data: new Uint8Array(p.size * p.size * 4),\n onAdd: function () {\n let canvas = document.createElement('canvas')\n canvas.width = canvas.height = p.size\n this.ctx = canvas.getContext('2d', { willReadFrequently: true })\n },\n render: function () {\n this.ctx.fillStyle = pattern.background || 'transparent'\n this.ctx.fillRect(0, 0, this.width, this.height)\n this.ctx.strokeStyle = this.ctx.fillStyle = pattern.color || 'black'\n this.ctx.lineWidth = pattern.lineWith || 1\n this.ctx.stroke(new Path2D(p.path))\n if (p.fill) this.ctx.fill(new Path2D(p.path))\n this.data = this.ctx.getImageData(0, 0, this.width, this.height).data\n return true\n },\n }\n }\n\n return null\n}\n","import { createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type LngLatLike from 'mapbox-gl/src/geo/lng_lat.js'\n\n// linearly interpolate between two positions [x,y,z] based on time\nconst lerp = (a, b, t) => a.map((_, idx) => (1.0 - t) * a[idx] + t * b[idx])\n\n// sphericaly interpolate between two positions [x,y,z] based on time\nconst slerp = (a, b, t) => {\n const omega = 0.075\n // TODO: Proper Calculation\n // a.map((_, idx) => a[idx] * b[idx]).reduce((m, n) => m + n)\n\n return a.map(\n (_, idx) =>\n (Math.sin((1 - t) * omega) / Math.sin(omega)) * a[idx] +\n (Math.sin(t * omega) / Math.sin(omega)) * b[idx]\n )\n}\n\n// calculations from: https://easings.net\nconst easeQuad = {\n in: (x: number): number => x * x,\n out: (x: number): number => 1 - (1 - x) * (1 - x),\n inOut: (x: number): number =>\n x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,\n}\n\ninterface RotateOptions {\n secPerRev?: number\n maxZoom?: number\n slowZoom?: number\n pitch?: number\n around?: LngLatLike\n}\n\nexport const Camera: Component<{\n rotateGlobe?: boolean | RotateOptions\n rotateViewport?: boolean | RotateOptions\n translate?: {\n type?: 'line' | 'sphere'\n start: [number, number, number]\n end: [number, number, number]\n target: LngLatLike\n targetEnd?: LngLatLike\n easing?: 'in' | 'out' | 'inOut'\n loop?: boolean\n duration: number\n }\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map, userInteraction] = useMap()\n let animationTime = 0.1\n let isReverse = false\n\n const updateCameraPosition = async ([lng, lat, alt], target) => {\n const camera = map().getFreeCameraOptions()\n camera.position = map().mapLib.MercatorCoordinate.fromLngLat(\n [lng, lat],\n alt\n )\n camera.lookAtPoint(target)\n map().setFreeCameraOptions(camera)\n }\n\n const frame = (time: number) => {\n props.translate && window.requestAnimationFrame(frame)\n const params = [\n props.translate.start,\n props.translate.end,\n props.translate.easing\n ? easeQuad[props.translate.easing](animationTime)\n : animationTime,\n ] as const\n const position =\n props.translate.type === 'line' ? lerp(...params) : slerp(...params)\n\n updateCameraPosition(position, props.translate.target)\n\n if (!props.translate.loop && (animationTime > 1.0 || animationTime < 0.0))\n isReverse = !isReverse\n animationTime = isReverse ? animationTime - 0.001 : animationTime + 0.001\n }\n\n createEffect(() => {\n props.translate && window.requestAnimationFrame(frame)\n })\n\n const rotateGlobe = () => {\n const secPerRev = (props.rotateGlobe as RotateOptions).secPerRev || 120\n const maxSpinZoom = (props.rotateGlobe as RotateOptions).maxZoom || 5\n const slowSpinZoom = (props.rotateGlobe as RotateOptions).slowZoom || 3\n const zoom = map().getZoom()\n\n if (props.rotateGlobe && !userInteraction() && zoom < maxSpinZoom) {\n let distancePerSecond = 360 / secPerRev\n if (zoom > slowSpinZoom) {\n const zoomDif = (maxSpinZoom - zoom) / (maxSpinZoom - slowSpinZoom)\n distancePerSecond *= zoomDif\n }\n const center = map().getCenter()\n center.lng -= distancePerSecond\n map().easeTo({ center, duration: 1000, easing: n => n }, { rotate: true })\n }\n }\n\n const rotateViewport = () => {\n const secPerRev = (props.rotateViewport as RotateOptions)?.secPerRev || 60\n // const maxSpinZoom = (props.rotateViewport as RotateOptions)?.maxZoom || 5\n // const slowSpinZoom = (props.rotateViewport as RotateOptions)?.slowZoom || 3\n // const zoom = map().getZoom()\n\n if (props.rotateViewport && !userInteraction()) {\n let distancePerSecond = 360 / secPerRev\n // if (zoom > slowSpinZoom) {\n // const zoomDif = (maxSpinZoom - zoom) / (maxSpinZoom - slowSpinZoom)\n // distancePerSecond *= zoomDif\n // }\n const bearing = map().getBearing() - distancePerSecond\n map().easeTo(\n {\n bearing,\n pitch: (props.rotateViewport as RotateOptions)?.pitch || 80,\n duration: 1000,\n around: (props.rotateViewport as RotateOptions)?.around,\n easing: n => n,\n },\n { rotate: true }\n )\n }\n }\n\n map().on('moveend', evt =>\n evt.rotate && props.rotateGlobe ? rotateGlobe() : rotateViewport()\n )\n\n createEffect(() =>\n props.rotateGlobe ? !userInteraction() && rotateGlobe() : map().stop()\n )\n\n createEffect(() =>\n props.rotateViewport\n ? !userInteraction() && rotateViewport()\n : map().stop().resetNorthPitch()\n )\n\n return props.children\n}\n","import { onCleanup, createEffect, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { LightSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Light: VoidComponent<{\n style: LightSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n\n // Add or Update Light Layer\n createEffect(() => map().setLight(props.style || {}))\n\n // Remove Light Layer\n onCleanup(() => map()?.setLight(null))\n\n return null\n}\n"],"names":["mapEvents","layerEvents","mapBase","gitBase","gishub","hereBase","vectorStyleList","mb","light","dark","street","outdoor","sat","sat_street","nav","nav_night","basic","monochrome","leshine","icecream","cali","northstar","mineral","moonlight","frank","minimo","decimal","standard","blueprint","bubble","pencil","swiss_ski","vintage","whaam","neon","camoflauge","emerald","runner","x_ray","here","base","day","night","esri","charted_territory","colored_pencil","community","mid_century","modern_antique","nat_geo","newspaper","open_street_map","light_gray_canvas","dark_gray_canvas","human_geo_light","human_geo_dark","world_navigation","world_street","world_street_night","world_terrain","world_terrain_hybrid","world_topographic","chromium","dreamcatcher","seahaven","sangria","mercurial","imagery","imagery_hybrid","firefly","firefly_hybrid","oceans","carto","stamen","tf","rasterStyleList","osm","org","human","cycle","topo","_copy","voyager","positron","toner","toner_lite","watercolor","terrain","trans","trans_dark","landscape","outdoors","neighbourhood","spinal","pioneer","atlas","mobile","MapContext","createContext","useMap","useContext","MapGL","props","map","id","createUniqueId","mapRoot","setMapRoot","createSignal","darkMode","setDarkMode","userInteraction","setUserInteraction","createEffect","onUserInteraction","debug","text","value","console","mapRef","_el$","_tmpl$","cloneNode","_$effect","_p$","_v$2","class","_v$3","classList","_v$4","style","position","inset","_v$","_$setAttribute","_$className","_$classList","_$style","undefined","getStyle","String","split","reduce","p","c","replace","apikey","import","meta","env","VITE_VECTOR_API_KEY","version","sources","layers","onMount","async","mapLib","Map","window","supported","Error","accessToken","options","VITE_MAPBOX_ACCESS_TOKEN","interactive","onViewportChange","viewport","container","darkStyle","fitBoundsOptions","padding","sourceIdList","layerIdList","once","forEach","event","on","evt","rotate","darkTheme","matchMedia","addEventListener","matches","toString","MutationObserver","document","body","contains","observe","attributes","item","prop","slice","toLowerCase","e","Object","keys","layerId","point","x","originalEvent","y","center","lat","getCenter","lng","zoom","getZoom","pitch","getPitch","bearing","getBearing","stop","transitionType","prev","bounds","cameraForBounds","proj","projection","setProjection","cursorStyle","getCanvas","cursor","isStyleLoaded","oldStyle","oldLayers","filter","l","includes","oldSources","s","obj","key","setStyle","newStyle","list","layer","index","findIndex","i","metadata","smg","beforeType","type","beforeId","onCleanup","remove","_$createComponent","Provider","children","_$memo","SourceContext","useSourceId","Source","lookup","url","source","tiles","VITE_RASTER_API_KEY","devicePixelRatio","attribution","addSource","push","getSource","data","isSourceLoaded","setData","coords","coordinates","updateImage","setUrl","setTiles","src","_tileJSONRequest","cancel","scheme","_options","_sourceCaches","clearTiles","load","removeLayer","removeSource","diff","newProps","prevProps","Set","acc","Layer","sourceId","addLayer","customLayer","find","layout","setLayoutProperty","validate","paint","setPaintProperty","minzoom","maxzoom","setLayerZoomRange","setFilter","visible","featureState","removeFeatureState","sourceLayer","setFeatureState","state","getLayer","Atmosphere","setFog","Terrain","isMapLibre","tileSize","setTerrain","exaggeration","Control","control","hasControl","removeControl","lib","custom","NavigationControl","ScaleControl","AttributionControl","GeolocateControl","FullscreenControl","getControl","addControl","Marker","marker","popup","lngLat","ops","pops","untrack","Popup","setHTML","onClose","setPopup","onDragStart","onDragEnd","onLngLatChange","getLngLat","toArray","setDraggable","draggable","setLngLat","addTo","openPopup","isOpen","togglePopup","trackPointer","closeOnClick","closeButton","focusAfterOpen","PATTERN","diagonal_l","size","path","diagonal_r","horizontal","vertical","cross","hash","chevron_h","chevron_v","square","fill","hex","circle","patternList","Image","setSize","width","height","hasImage","removeImage","image","pattern","pixelRatio","_loadImage","_createPattern","addImage","triggerRepaint","callback","loadImage","error","imageData","Uint8Array","onAdd","canvas","createElement","this","ctx","getContext","willReadFrequently","render","fillStyle","background","fillRect","strokeStyle","color","lineWidth","lineWith","stroke","Path2D","getImageData","easeQuad","in","out","inOut","Math","pow","Camera","animationTime","isReverse","frame","time","translate","requestAnimationFrame","params","start","end","easing","alt","target","camera","getFreeCameraOptions","MercatorCoordinate","fromLngLat","lookAtPoint","setFreeCameraOptions","updateCameraPosition","a","b","t","_","idx","lerp","omega","sin","slerp","loop","rotateGlobe","secPerRev","maxSpinZoom","maxZoom","slowSpinZoom","slowZoom","distancePerSecond","easeTo","duration","n","rotateViewport","around","resetNorthPitch","Light","setLight"],"mappings":"wSAoDA,MAAMA,EAAsB,CAC1B,cACA,YACA,cACA,aACA,cACA,eACA,eACA,aACA,UACA,aACA,gBACA,eACA,aACA,gBACA,UACA,WACA,WACA,cACA,cACA,SACA,YACA,cACA,SACA,YACA,cACA,SACA,YACA,gBACA,WACA,aACA,eACA,UACA,aACA,iBACA,eACA,kBACA,qBACA,yBACA,SACA,WACA,SACA,UACA,SACA,cACA,eACA,gBACA,qBACA,sBACA,uBAmBIC,EAAqB,CACzB,cACA,YACA,cACA,aACA,cACA,eACA,eACA,UACA,aACA,gBACA,eACA,aACA,iBCrIIC,EAAU,yBACVC,EAAU,qCACVC,EAAS,6DACTC,EAAW,4CAEJC,EAA0B,CACrCC,GAAI,CACFC,MAAQ,GAAEN,cACVO,KAAO,GAAEP,aACTQ,OAAS,GAAER,gBACXS,QAAU,GAAET,iBACZU,IAAM,GAAEV,iBACRW,WAAa,GAAEX,0BACfY,IAAM,GAAEZ,+BACRa,UAAY,GAAEb,iCACdc,MAAQ,GAAEd,8BACVe,WAAa,GAAEf,8BACfgB,QAAU,GAAEhB,8BACZiB,SAAW,GAAEjB,8BACbkB,KAAO,GAAElB,8BACTmB,UAAY,GAAEnB,8BACdoB,QAAU,GAAEpB,8BACZqB,UAAY,GAAErB,8BACdsB,MAAQ,GAAEtB,yCACVuB,OAAS,GAAEvB,yCACXwB,QAAU,GAAExB,yCACZyB,SAAW,GAAEzB,yCACb0B,UAAY,GAAE1B,yCACd2B,OAAS,GAAE3B,yCACX4B,OAAS,GAAE5B,yCACX6B,UAAY,GAAE5B,0EACd6B,QAAU,GAAE7B,wEACZ8B,MAAQ,GAAE9B,sEACV+B,KAAO,GAAE/B,mEACTgC,WAAa,GAAEhC,mDACfiC,QAAU,GAAEjC,gDACZkC,OAAS,GAAElC,+CACXmC,MAAQ,GAAEnC,+CAEZoC,KAAM,CACJC,KA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../../src/components/MapGL/index.tsx","../../src/components/Source/index.tsx","../../src/components/Layer/index.tsx","../../src/components/Atmosphere/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","../../src/components/Camera/index.tsx","../../src/components/Light/index.tsx"],"sourcesContent":["type mapEventTypes = {\n onMouseDown?: Function\n onMouseUp?: Function\n onMouseOver?: Function\n onMouseOut?: Function\n onMouseMove?: Function\n onMouseEnter?: Function\n onMouseLeave?: Function\n onPreClick?: Function\n onClick?: Function\n onDblClick?: Function\n onContextMenu?: Function\n onTouchStart?: Function\n onTouchEnd?: Function\n onTouchCancel?: Function\n onWheel?: Function\n onResize?: Function\n onRemove?: Function\n onTouchMove?: Function\n onMoveStart?: Function\n onMove?: Function\n onMoveEnd?: Function\n onDragStart?: Function\n onDrag?: Function\n onDragEnd?: Function\n onZoomStart?: Function\n onZoom?: Function\n onZoomEnd?: Function\n onRotateStart?: Function\n onRotate?: Function\n onRotatEnd?: Function\n onPitchStart?: Function\n onPitch?: Function\n onPitchEnd?: Function\n onBoxZoomStart?: Function\n onBoxZoomEnd?: Function\n onBoxZoomCancel?: Function\n onWebglContextLost?: Function\n onWebglContextRestored?: Function\n onLoad?: Function\n onRender?: Function\n onIdle?: Function\n onError?: Function\n onData?: Function\n onStyleData?: Function\n onSourceData?: Function\n onDataLoading?: Function\n onStyleDataLoading?: Function\n onSourceDataLoading?: Function\n onStyleImageMissing?: Function\n}\n\nconst mapEvents: string[] = [\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseOver',\n 'onMouseOut',\n 'onMouseMove',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onPreClick',\n 'onClick',\n 'onDblClick',\n 'onContextMenu',\n 'onTouchStart',\n 'onTouchEnd',\n 'onTouchCancel',\n 'onWheel',\n 'onResize',\n 'onRemove',\n 'onTouchMove',\n 'onMoveStart',\n 'onMove',\n 'onMoveEnd',\n 'onDragStart',\n 'onDrag',\n 'onDragEnd',\n 'onZoomStart',\n 'onZoom',\n 'onZoomEnd',\n 'onRotateStart',\n 'onRotate',\n 'onRotatEnd',\n 'onPitchStart',\n 'onPitch',\n 'onPitchEnd',\n 'onBoxZoomStart',\n 'onBoxZoomEnd',\n 'onBoxZoomCancel',\n 'onWebglContextLost',\n 'onWebglContextRestored',\n 'onLoad',\n 'onRender',\n 'onIdle',\n 'onError',\n 'onData',\n 'onStyleData',\n 'onSourceData',\n 'onDataLoading',\n 'onStyleDataLoading',\n 'onSourceDataLoading',\n 'onStyleImageMissing',\n]\n\ntype layerEventTypes = {\n onMouseDown?: Function\n onMouseUp?: Function\n onMouseOver?: Function\n onMouseOut?: Function\n onMouseMove?: Function\n onMouseEnter?: Function\n onMouseLeave?: Function\n onClick?: Function\n onDblClick?: Function\n onContextMenu?: Function\n onTouchStart?: Function\n onTouchEnd?: Function\n onTouchCancel?: Function\n}\n\nconst layerEvents: any[] = [\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseOver',\n 'onMouseOut',\n 'onMouseMove',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onClick',\n 'onDblClick',\n 'onContextMenu',\n 'onTouchStart',\n 'onTouchEnd',\n 'onTouchCancel',\n]\n\nexport { mapEvents, layerEvents }\nexport type { mapEventTypes, layerEventTypes }\n","const mapBase = 'mapbox://styles/mapbox'\nconst gitBase = 'https://raw.githubusercontent.com/'\nconst gishub = 'https://raw.githubusercontent.com/GIShub4/map-styles/main/'\nconst hereBase = 'https://assets.vector.hereapi.com/styles/'\n\nexport const vectorStyleList: object = {\n mb: {\n light: `${mapBase}/light-v11`,\n dark: `${mapBase}/dark-v11`,\n street: `${mapBase}/streets-v12`,\n outdoor: `${mapBase}/outdoors-v12`,\n sat: `${mapBase}/satellite-v9`,\n sat_street: `${mapBase}/satellite-streets-v12`,\n nav: `${mapBase}/navigation-guidance-day-v4`,\n nav_night: `${mapBase}/navigation-guidance-night-v4`,\n basic: `${mapBase}/cjf4m44iw0uza2spb3q0a7s41`,\n monochrome: `${mapBase}/cjv6rzz4j3m4b1fqcchuxclhb`,\n leshine: `${mapBase}/cjcunv5ae262f2sm9tfwg8i0w`,\n icecream: `${mapBase}/cj7t3i5yj0unt2rmt3y4b5e32`,\n cali: `${mapBase}/cjerxnqt3cgvp2rmyuxbeqme7`,\n northstar: `${mapBase}/cj44mfrt20f082snokim4ungi`,\n mineral: `${mapBase}/cjtep62gq54l21frr1whf27ak`,\n moonlight: `${mapBase}/cj3kbeqzo00022smj7akz3o1e`,\n frank: `${mapBase}-map-design/ckshxkppe0gge18nz20i0nrwq`,\n minimo: `${mapBase}-map-design/cksjc2nsq1bg117pnekb655h1`,\n decimal: `${mapBase}-map-design/ck4014y110wt61ctt07egsel6`,\n standard: `${mapBase}-map-design/ckr0svm3922ki18qntevm857n`,\n blueprint: `${mapBase}-map-design/cks97e1e37nsd17nzg7p0308g`,\n bubble: `${mapBase}-map-design/cksysy2nl62zp17quosctdtcc`,\n pencil: `${mapBase}-map-design/cks9iema71es417mlrft4go2k`,\n swiss_ski: `${gitBase}mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,\n vintage: `${gitBase}mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,\n whaam: `${gitBase}mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,\n neon: `${gitBase}NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,\n camoflauge: `${gitBase}jingsam/mapbox-gl-styles/master/Camouflage.json`,\n emerald: `${gitBase}jingsam/mapbox-gl-styles/master/Emerald.json`,\n runner: `${gitBase}jingsam/mapbox-gl-styles/master/Runner.json`,\n x_ray: `${gitBase}jingsam/mapbox-gl-styles/master/X-ray.json`,\n },\n here: {\n base: `${hereBase}berlin/base/mapbox/tilezen?apikey={apikey}`,\n day: `${hereBase}berlin/day/mapbox/tilezen?apikey={apikey}`,\n night: `${hereBase}berlin/night/mapbox/tilezen?apikey={apikey}`,\n },\n esri: {\n blueprint: `${gishub}esri:blueprint.json`,\n charted_territory: `${gishub}esri:charted-territory.json`,\n colored_pencil: `${gishub}esri:colored-pencil.json`,\n community: `${gishub}esri:community.json`,\n mid_century: `${gishub}esri:mid-century.json`,\n modern_antique: `${gishub}esri:modern-antique.json`,\n nat_geo: `${gishub}esri:national-geographic.json`,\n newspaper: `${gishub}esri:newspaper.json`,\n open_street_map: `${gishub}esri:open-street-map.json`,\n light_gray_canvas: `${gishub}esri:light-gray-canvas.json`,\n dark_gray_canvas: `${gishub}esri:dark-gray-canvas.json`,\n human_geo_light: `${gishub}esri:human-geography-light.json`,\n human_geo_dark: `${gishub}esri:human-geography-dark.json`,\n world_navigation: `${gishub}esri:world-navigation.json`,\n world_street: `${gishub}esri:world-street.json`,\n world_street_night: `${gishub}esri:world-street-night.json`,\n world_terrain: `${gishub}esri:world-terrain.json`,\n world_terrain_hybrid: `${gishub}esri:world-terrain-hybrid.json`,\n world_topographic: `${gishub}esri:world-topographic.json`,\n chromium: `${gishub}esri:chromium.json`,\n dreamcatcher: `${gishub}esri:dreamcatcher.json`,\n seahaven: `${gishub}esri:seahaven.json`,\n sangria: `${gishub}esri:sangria.json`,\n mercurial: `${gishub}esri:mercurial.json`,\n imagery: `${gishub}esri:imagery.json`,\n imagery_hybrid: `${gishub}esri:imagery-hybrid.json`,\n firefly: `${gishub}esri:firefly.json`,\n firefly_hybrid: `${gishub}esri:firefly-hybrid.json`,\n oceans: `${gishub}esri:oceans.json`,\n },\n}\nconst carto = 'https://{s}.basemaps.cartocdn.com/rastertiles/'\nconst stamen = 'https://stamen-tiles-{s}.a.ssl.fastly.net/'\nconst tf = 'https://{s}.tile.thunderforest.com/'\n\nexport const rasterStyleList: object = {\n osm: {\n org: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n human: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',\n cycle: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',\n topo: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',\n _copy:\n '<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap</a>',\n },\n carto: {\n voyager: `${carto}voyager_labels_under/{z}/{x}/{y}{r}.png`,\n positron: `${carto}light_all/{z}/{x}/{y}{r}.png`,\n dark: `${carto}dark_all/{z}/{x}/{y}{r}.png`,\n _copy:\n '<a href=\"https://carto.com/attribution\" target=\"_blank\">© Carto</a>',\n },\n stamen: {\n toner: `${stamen}toner/{z}/{x}/{y}{r}.png`,\n toner_lite: `${stamen}toner-lite/{z}/{x}/{y}{r}.png`,\n watercolor: `${stamen}watercolor/{z}/{x}/{y}.png`,\n terrain: `${stamen}terrain/{z}/{x}/{y}{r}.png`,\n _copy:\n '<a href=\"https://stamen.com/privacy-policy\" target=\"_blank\">© Stamen Design</a>',\n },\n tf: {\n cycle: `${tf}cycle/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n trans: `${tf}transport/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n trans_dark: `${tf}transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n landscape: `${tf}landscape/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n outdoors: `${tf}outdoors/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n neighbourhood: `${tf}neighbourhood/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n spinal: `${tf}spinal-map/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n pioneer: `${tf}pioneer/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n atlas: `${tf}atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n mobile: `${tf}mobile-atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,\n _copy:\n '<a href=\"https://thunderforest.com/privacy\" target=\"_blank\">© Thunderforest</a>',\n },\n}\n","import {\n createSignal,\n createEffect,\n onMount,\n onCleanup,\n createContext,\n useContext,\n Component,\n createUniqueId,\n} from 'solid-js'\nimport { mapEvents } from '../../events'\nimport { vectorStyleList } from '../../mapStyles'\nimport type { mapEventTypes } from '../../events'\nimport type { MapboxMap, MapboxOptions } from 'mapbox-gl/src/ui/map'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\nimport type { LngLatBounds } from 'mapbox-gl/src/geo/lng_lat_bounds.js'\nimport type { PaddingOptions } from 'mapbox-gl/src/geo/edge_insets.js'\nimport type { StyleSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport type { JSX } from 'solid-js'\n\nexport type Viewport = {\n id?: string\n point?: { x: number; y: number }\n center?: LngLatLike\n bounds?: LngLatBounds\n zoom?: number\n pitch?: number\n bearing?: number\n padding?: PaddingOptions\n}\n\nconst MapContext = createContext()\n/** Provides the Mapbox Map Object */\nexport const useMap = (): MapboxMap => useContext(MapContext)\n\n/** Creates a new Map Container */\nexport const MapGL: Component<\n {\n id?: string\n /** Map Container CSS Style */\n style?: JSX.CSSProperties\n /** Map Container CSS Class */\n class?: string\n /** SolidJS Class List for Map Container */\n classList?: {\n [k: string]: boolean | undefined\n }\n /** Current Map View */\n viewport?: Viewport\n /** Mapbox Options\n * @see https://docs.mapbox.com/mapbox-gl-js/api/map/#map-parameters\n */\n options?: MapboxOptions\n /** Type for pan, move and zoom transitions */\n transitionType?: 'flyTo' | 'easeTo' | 'jumpTo'\n /** Event listener for Viewport updates */\n onViewportChange?: (viewport: Viewport) => void\n /** Event listener for User Interaction */\n onUserInteraction?: (user: boolean) => void\n /** Displays Map Tile Borders */\n showTileBoundaries?: boolean\n /** Displays Wireframe if Terrain is visible */\n showTerrainWireframe?: boolean\n /** Displays Borders if Padding is set */\n showPadding?: boolean\n /** Displays Label Collision Boxes */\n showCollisionBoxes?: boolean\n /** Displays all feature outlines even if normally not drawn by style rules */\n showOverdrawInspector?: boolean\n /** Mouse Cursor Style */\n cursorStyle?: string\n //** Dark Map Style */\n darkStyle?: StyleSpecification | string\n //** Disable automatic map resize */\n disableResize?: boolean\n //** MapLibre library */\n mapLib?: any\n //** APIkey for vector service */\n apikey?: string\n //** Debug Message Mode */\n debug?: boolean\n ref?: HTMLDivElement\n /** Children within the Map Container */\n children?: any\n } & mapEventTypes\n> = props => {\n props.id = props.id || createUniqueId()\n\n let map: MapboxMap\n let resizeObserver: ResizeObserver\n\n const [mapRoot, setMapRoot] = createSignal<MapboxMap>()\n const [darkMode, setDarkMode] = createSignal(false)\n const [userInteraction, setUserInteraction] = createSignal(false)\n // debounce user interactions\n createEffect(() => props.onUserInteraction?.(userInteraction()))\n\n const debug = (text, value?) => {\n props.debug &&\n console.debug('%c[MapGL]', 'color: #0ea5e9', text, value || '')\n }\n\n const mapRef = (\n <div\n id={props.id}\n class={props?.class}\n classList={props?.classList}\n style={\n props?.style || props?.class || props?.classList\n ? props.style\n : { position: 'absolute', inset: 0, ...props.style }\n }\n />\n )\n\n const getStyle = (light, dark) => {\n const style = darkMode() ? dark || light : light\n return typeof style === 'string' || style instanceof String\n ? style\n ?.split(':')\n .reduce((p, c) => p && p[c], vectorStyleList)\n ?.replace(\n '{apikey}',\n //@ts-ignore\n props.apikey || import.meta.env.VITE_VECTOR_API_KEY\n ) || style\n : style || { version: 8, sources: {}, layers: [] }\n }\n\n onMount(async () => {\n let mapLib = props.mapLib || (await import('mapbox-gl'))\n if (!mapLib.Map) mapLib = window['maplibregl'] || window['mapboxgl']\n\n if (!mapLib.supported()) throw new Error('Mapbox GL not supported')\n\n debug(`Map (v${mapLib.version}) loading...`)\n map = new mapLib.Map({\n accessToken:\n //@ts-ignore\n props.options.accessToken || import.meta.env.VITE_MAPBOX_ACCESS_TOKEN,\n interactive: props.options.interactive || !!props.onViewportChange,\n ...props.options,\n ...props.viewport,\n container: mapRef,\n style: getStyle(props.options?.style, props.darkStyle),\n fitBoundsOptions: { padding: props.viewport?.padding },\n } as MapboxOptions)\n\n map.mapLib = mapLib\n map.debug = props.debug\n map.sourceIdList = []\n map.layerIdList = []\n\n map.once('load', () => {\n setMapRoot(map)\n debug('Map loaded')\n })\n\n // Handle User Interaction\n ;['mousedown', 'touchstart', 'wheel'].forEach(event =>\n map.on(event, () => setUserInteraction(true))\n )\n map.on('moveend', evt => !evt.rotate && setUserInteraction(false))\n\n // Listen to dark theme changes\n const darkTheme =\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-color-scheme: dark)')\n darkTheme?.addEventListener('change', () => {\n setDarkMode(darkTheme.matches)\n debug('Set dark theme to:', darkTheme.matches?.toString())\n })\n new MutationObserver(() => {\n const darkTheme = document.body.classList.contains('dark')\n setDarkMode(darkTheme)\n debug('Set dark theme to:', darkTheme)\n }).observe(document.body, { attributes: true })\n\n // Listen to map container size changes\n // !props.disableResize &&\n // new ResizeObserver(() => {\n // map?.resize()\n // debug('Map resized')\n // }).observe(mapRef as Element)\n\n // Hook up events\n mapEvents.forEach(item => {\n const prop = props[item]\n if (prop) {\n const event = item.slice(2).toLowerCase()\n if (typeof prop === 'function') {\n map.on(event, e => {\n prop(e)\n debug(`Map '${event}' event:`, e)\n })\n } else {\n Object.keys(prop).forEach(layerId => {\n map.on(event, layerId, e => {\n prop[layerId](e)\n debug(`Map '${event}' event on '${layerId}':`, e)\n })\n })\n }\n }\n })\n\n // Hook up viewport events\n map.on('move', event => {\n const viewport: Viewport = {\n ...props.viewport,\n id: props.id,\n point: { x: event.originalEvent?.x, y: event.originalEvent?.y },\n center: props.viewport.center.lat\n ? map.getCenter()\n : [map.getCenter().lng, map.getCenter().lat],\n zoom: map.getZoom(),\n pitch: map.getPitch(),\n bearing: map.getBearing(),\n }\n props.onViewportChange && props.onViewportChange(viewport)\n })\n })\n\n // Update Viewport\n createEffect(() => {\n const viewport = {\n ...props.viewport,\n padding: props.viewport?.padding || 0,\n }\n if (!map || props.id === props.viewport?.id || userInteraction()) return\n map?.stop()[props.transitionType || 'flyTo'](viewport)\n debug(`Update Viewport (${props.transitionType || 'flyTo'}):`, viewport)\n })\n\n // Update boundaries\n createEffect(prev => {\n const bounds = props.viewport?.bounds\n if (map && bounds && prev !== bounds && !userInteraction()) {\n props.onViewportChange({\n ...props.viewport,\n ...map?.cameraForBounds(bounds, {\n padding: props.viewport?.padding,\n }),\n })\n debug(`Update Viewport Boundaries:`, bounds)\n }\n return bounds\n }, props.viewport?.bounds)\n\n // Update Projection\n createEffect(prev => {\n const proj = props.options?.projection\n if (prev !== proj) {\n map.setProjection(proj)\n debug('Set Projection to:', proj)\n }\n return proj\n }, props.options?.projection)\n\n // Update cursor\n createEffect(() => {\n if (!props.cursorStyle || !map) return\n map.getCanvas().style.cursor = props.cursorStyle\n debug('Set Cursor to:', props.cursorStyle)\n })\n\n const insertLayers = (list, layers) => {\n layers.forEach(layer => {\n const index = list.findIndex(i =>\n layer.metadata.smg.beforeType\n ? i.type === layer.metadata.smg.beforeType\n : i.id === layer.metadata.smg.beforeId\n )\n list =\n index === -1\n ? [...list, layer]\n : [...list.slice(0, index), layer, ...list.slice(index + 1)]\n })\n return list\n }\n\n // Update map style\n createEffect(prev => {\n const style = getStyle(props.options?.style, props.darkStyle)\n if (map?.isStyleLoaded() && prev !== style) {\n const oldStyle = map.getStyle()\n const oldLayers = oldStyle.layers.filter(l =>\n map.layerIdList.includes(l.id)\n )\n const oldSources = Object.keys(oldStyle.sources)\n .filter(s => map.sourceIdList.includes(s))\n .reduce((obj, key) => ({ ...obj, [key]: oldStyle.sources[key] }), {})\n\n map.setStyle(style)\n map.once('styledata', () => {\n if (!oldLayers) return\n const newStyle = map.getStyle()\n map.setStyle({\n ...newStyle,\n sources: { ...newStyle.sources, ...oldSources },\n layers: insertLayers(newStyle.layers, oldLayers),\n })\n })\n debug('Set Mapstyle to:', style)\n }\n return style\n }, props.options?.style)\n\n // Update debug features\n ;[\n 'showTileBoundaries',\n 'showTerrainWireframe',\n 'showCollisionBoxes',\n 'showPadding',\n 'showOverdrawInspector',\n ].forEach(item => {\n createEffect(() => {\n const prop = props[item]\n if (!map) return\n map[item] = prop\n debug(`Set ${item} to:`, prop)\n })\n })\n\n onCleanup(() => {\n resizeObserver?.disconnect()\n map?.remove()\n debug('Map removed')\n })\n\n return (\n <MapContext.Provider value={[mapRoot, userInteraction, debug]}>\n {mapRoot() && props.children}\n {mapRef}\n </MapContext.Provider>\n )\n}\n","import {\n onCleanup,\n createEffect,\n Component,\n createContext,\n useContext,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { SourceSpecification } from 'mapbox-gl/src/style-spec/types.js'\nimport { rasterStyleList } from '../../mapStyles'\n\nconst SourceContext = createContext<string>()\nexport const useSourceId = (): string => useContext(SourceContext)\n\nexport const Source: Component<{\n /** @optional Source ID for referencing non nexted Layers */\n id?: string\n /** @see https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/ */\n source: SourceSpecification\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n props.id = props.id || createUniqueId()\n\n const debug = (text, value?) => {\n map().debug &&\n console.debug('%c[MapGL]', 'color: #ec4899', text, value || '')\n }\n\n const lookup = url => {\n const s = url?.split(':').reduce((p, c) => p && p[c], rasterStyleList)\n const source = s\n ? {\n ...props.source,\n url: '',\n tiles: [\n s\n .replace(\n '{apikey}', //@ts-ignore\n props.source.apikey || import.meta.env.VITE_RASTER_API_KEY\n )\n .replace('{r}', window.devicePixelRatio > 1 ? '@2x' : ''),\n ],\n attribution: rasterStyleList[url.split(':')[0]]._copy,\n }\n : props.source\n\n source.tiles &&\n (source.tiles = ['a', 'b', 'c'].map(i =>\n source.tiles[0].replace('{s}', i)\n ))\n\n return source\n }\n\n // Add Source\n map().addSource(props.id, lookup(props.source.url))\n map().sourceIdList.push(props.id)\n debug('Add Source:', props.id)\n\n // Update Data\n const source = map().getSource(props.id)\n switch (props.source.type) {\n case 'geojson':\n createEffect(() => {\n const data = props.source.data\n if (!map().isSourceLoaded(props.id)) return\n source.setData(data || {})\n debug('Update GeoJSON Data:', props.id)\n })\n break\n case 'image':\n createEffect(() => {\n const url = props.source.url\n const coords = props.source.coordinates\n if (!map().isSourceLoaded(props.id)) return\n source.updateImage(url, coords)\n debug('Update Image Data:', props.id)\n })\n break\n case 'vector':\n createEffect(() => {\n const url = props.source.url\n const tiles = props.source.tiles\n if (!map().isSourceLoaded(props.id)) return\n url ? source.setUrl(url) : source.setTiles(tiles)\n debug('Update Vector Data:', props.id)\n })\n break\n case 'raster':\n createEffect(() => {\n const url = props.source.url\n if (!map().isSourceLoaded(props.id)) return\n const src = lookup(url)\n src.tiles &&\n (src.tiles = ['a', 'b', 'c'].map(i => src.tiles[0].replace('{s}', i)))\n source._tileJSONRequest?.cancel()\n source.url = src.url\n source.scheme = src.scheme\n source._options = { ...source._options, ...src }\n map().style._sourceCaches[`other:${props.id}`]?.clearTiles()\n source.load()\n debug('Update Raster Data:', props.id)\n })\n break\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().removeSource(props.id)\n debug('Remove Source:', props.id)\n })\n\n return (\n <SourceContext.Provider value={props.id}>\n {props.children}\n </SourceContext.Provider>\n )\n}\n","import { onCleanup, createEffect, Component, createUniqueId } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSourceId } from '../Source'\nimport { layerEvents } from '../../events'\nimport type { layerEventTypes } from '../../events'\nimport type {\n FilterSpecification,\n StyleSpecification,\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\nexport const Layer: Component<\n {\n id?: string\n style?: StyleSpecification\n customLayer?: 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 children?: any\n } & layerEventTypes\n> = props => {\n if (!useMap()) return\n const [map] = useMap()\n const sourceId: string = props.style.source || useSourceId()\n props.id = props.id || createUniqueId()\n\n const debug = (text, value?) => {\n map().debug &&\n console.debug('%c[MapGL]', 'color: #10b981', text, value || '')\n }\n\n // Add Layer\n // if (!map().getLayer(props.id)) {\n map().addLayer(\n props.customLayer || {\n ...props.style,\n id: props.id,\n source: sourceId,\n metadata: {\n smg: { beforeType: props.beforeType, beforeId: props.beforeId },\n },\n },\n props.beforeType\n ? map()\n .getStyle()\n .layers.find(l => l.type === props.beforeType)?.id\n : props.beforeId\n )\n map().layerIdList.push(props.id)\n debug('Add Layer:', props.id)\n\n // Hook up events\n layerEvents.forEach(item => {\n if (props[item]) {\n const event = item.slice(2).toLowerCase()\n map().on(event, props.id, evt => {\n props[item](evt)\n debug(`Layer '${event}' event on '${props.id}':`, evt)\n })\n }\n })\n // }\n\n // Update Style\n createEffect((prev: StyleSpecification) => {\n const style = props.style\n if (style === prev || !map().isStyleLoaded()) return\n\n if (style.layout !== prev?.layout)\n diff(style.layout, prev?.layout).forEach(([key, value]) =>\n map().setLayoutProperty(props.id, key, value, { validate: false })\n )\n\n if (style.paint !== prev?.paint)\n diff(style.paint, prev?.paint).forEach(([key, value]) =>\n map().setPaintProperty(props.id, key, value, { validate: false })\n )\n\n if (style.minzoom !== prev?.minzoom || style.maxzoom !== prev?.maxzoom)\n map().setLayerZoomRange(props.id, style.minzoom, style.maxzoom)\n\n if (style.filter !== prev?.filter)\n map().setFilter(props.id, style.filter, { validate: false })\n\n debug('Update Layer Style:', props.id)\n return style\n }, props.style)\n\n // Update Visibility\n createEffect((prev: boolean) => {\n if (props.visible === prev) return\n\n map().setLayoutProperty(\n props.id,\n 'visibility',\n props.visible ? 'visible' : 'none',\n { validate: false }\n )\n debug(`Update Visibility (${props.id}):`, props.visible)\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 debug(`Update Filter (${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: sourceId,\n sourceLayer: props.style['source-layer'],\n })\n map().setFeatureState(\n {\n source: sourceId,\n sourceLayer: props.style['source-layer'],\n id: props.featureState.id,\n },\n props.featureState.state\n )\n })\n\n //Remove Layer\n onCleanup(() => map()?.getLayer(props.id) && map()?.removeLayer(props.id))\n\n return props.children\n}\n","import { onCleanup, createEffect, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { FogSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Atmosphere: VoidComponent<{\n style: FogSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n\n // Add or Update Atmosphere Layer\n createEffect(() => map().setFog(props.style || {}))\n\n // Remove Atmosphere Layer\n onCleanup(() => map()?.setFog(null))\n\n return null\n}\n","import {\n onCleanup,\n createEffect,\n VoidComponent,\n createUniqueId,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport { useSourceId } from '../Source'\nimport type {\n SourceSpecification,\n TerrainSpecification,\n} from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Terrain: VoidComponent<{\n exaggeration?: number\n source?: TerrainSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let sourceId: SourceSpecification = useSourceId()\n\n // Add Terrain Layer\n if (sourceId === undefined) {\n sourceId = createUniqueId()\n map().addSource(\n sourceId,\n map().isMapLibre\n ? {\n type: 'raster-dem',\n url: 'https://demotiles.maplibre.org/terrain-tiles/tiles.json',\n tileSize: 256,\n }\n : {\n type: 'raster-dem',\n url: 'mapbox://mapbox.terrain-rgb',\n tileSize: 512,\n maxzoom: 14,\n }\n )\n }\n\n createEffect(() => {\n map().setTerrain({\n exaggeration: props.exaggeration || 1,\n source: sourceId,\n })\n })\n\n // Remove Terrain Layer\n onCleanup(() => map().setTerrain(null))\n\n return null\n}\n","import { createEffect, onCleanup, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\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 getControl = (lib, type, options, custom?) => {\n if (custom) return new custom(options)\n switch (type) {\n case 'navigation':\n return new lib.NavigationControl(options)\n case 'scale':\n return new lib.ScaleControl(options)\n case 'attribution':\n return new lib.AttributionControl(options)\n case 'geolocate':\n return new lib.GeolocateControl(options)\n case 'fullscreen':\n return new lib.FullscreenControl()\n // options || { container: map().container }\n default:\n throw new Error(`Unknown control type: ${type}`)\n }\n}\n\nexport const Control: VoidComponent<{\n type: 'navigation' | 'scale' | 'attribution' | 'fullscreen' | 'geolocate'\n options?:\n | NavigationOptions\n | ScaleOptions\n | AttributionOptions\n | FullscreenOptions\n | GeolocateOptions\n | object\n custom?: any\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let control = null\n\n // Add or Update Control\n createEffect(() => {\n control && map().hasControl(control) && map().removeControl(control)\n control = getControl(map().mapLib, props.type, props.options, props.custom)\n map().addControl(control, props.position)\n })\n\n // Remove Control\n onCleanup(() => map()?.removeControl(control))\n\n return null\n}\n","import { onCleanup, createEffect, Component, untrack } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n Popup as PopupType,\n PopupOptions,\n} from 'mapbox-gl/src/ui/popup.js'\nimport type {\n Marker as MarkerType,\n MarkerOptions,\n} from 'mapbox-gl/src/ui/marker.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nexport const Marker: Component<{\n options?: MarkerOptions & { popup: PopupOptions }\n lngLat: LngLatLike\n openPopup?: boolean\n draggable?: boolean\n onLngLatChange?: Function\n onClose?: Function\n onDragStart?: Function\n onDragEnd?: Function\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let marker: MarkerType = null\n let popup: PopupType = null\n\n if (!props.lngLat) throw new Error('Marker - lngLat is required')\n\n // Add or Update Marker\n createEffect(() => {\n const ops = { ...props.options }\n const pops = { ...props.options?.popup }\n if (!map()) return\n const mapboxgl = map().mapLib\n untrack(() => {\n popup?.remove()\n popup = props.children\n ? new mapboxgl.Popup(pops)\n .setHTML(props.children)\n .on('close', () => props.onClose?.())\n : null\n\n marker?.remove()\n marker = new mapboxgl.Marker(ops)\n .setPopup(popup)\n .on('dragstart', () => props.onDragStart?.())\n .on('dragend', () => props.onDragEnd?.())\n .on('drag', () => props.onLngLatChange?.(marker.getLngLat().toArray()))\n marker.setDraggable(props.draggable).setLngLat(props.lngLat).addTo(map())\n props.openPopup !== popup?.isOpen() && marker.togglePopup()\n })\n })\n\n // Toggle Popup\n createEffect(\n () => props.openPopup !== popup?.isOpen() && marker.togglePopup()\n )\n\n // Update Position\n createEffect(() => marker.setLngLat(props.lngLat))\n\n // Update Popup Content\n createEffect(() => popup?.setHTML(props.children))\n\n // Update Draggable\n createEffect(() => marker.setDraggable(props.draggable))\n\n // Remove Marker\n onCleanup(() => marker?.remove())\n\n return null\n}\n","import { onCleanup, createEffect, Component, untrack } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n Popup as PopupType,\n PopupOptions,\n} from 'mapbox-gl/src/ui/popup.js'\nimport type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js'\n\nexport const Popup: Component<{\n options?: PopupOptions\n trackPointer?: boolean\n lngLat: LngLatLike\n onClose?: Function\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n let popup: PopupType = null\n\n if (!props.trackPointer && !props.lngLat)\n throw new Error('Popup - lngLat or trackPointer is required')\n\n // Add or Update Popup\n createEffect(() => {\n const ops = { ...props.options }\n if (!map()) return\n const mapboxgl = map().mapLib\n untrack(() => {\n popup?.remove()\n popup = new mapboxgl.Popup(\n props.trackPointer\n ? { ...ops, closeOnClick: false, closeButton: false }\n : { focusAfterOpen: false, ...ops }\n )\n .setHTML(props.children || '')\n .setLngLat(props.lngLat)\n .on('close', () => props.onClose?.())\n .addTo(map())\n })\n })\n\n // Update Position\n createEffect(() =>\n props.trackPointer ? popup.trackPointer() : popup.setLngLat(props.lngLat)\n )\n\n // Update Content\n createEffect(() => popup.setHTML(props.children || ''))\n\n // Remove Popup\n onCleanup(() => popup?.remove())\n\n return null\n}\n","import {\n onCleanup,\n createSignal,\n createEffect,\n VoidComponent,\n untrack,\n} from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type {\n StyleImageInterface,\n StyleImageMetadata,\n} from 'mapbox-gl/src/style/style_image'\n\nconst PATTERN = {\n diagonal_l: { size: 20, path: 'M20 0 0 20M-10 10 10-10M10 30 30 10' },\n diagonal_r: { size: 20, path: 'M0 0 20 20M30 10 10-10M10 30-10 10' },\n horizontal: { size: 14, path: 'M7 0V20' },\n vertical: { size: 14, path: 'M0 7H20' },\n cross: { size: 18, path: 'M9 0V18M0 9H18' },\n hash: { size: 30, path: 'M15 0 30 15 15 30 0 15Z' },\n chevron_h: { size: 20, path: 'M-5 5 0 10 10 0 20 10 25 5M0 30 10 20 20 30' },\n chevron_v: { size: 20, path: 'M5-5 10 0 0 10 10 20 5 25M25 15 20 10 25 5' },\n square: { size: 20, path: 'M8 8H12V12H8Z', fill: true },\n hex: { size: 50, path: 'M0 0V50L50 25ZM50 0V50L0 25ZM25 0V50' },\n circle: {\n size: 25,\n path: 'M8 10A2.5 2.5 0 118.01 10M18 15A2.5 2.5 0 1018.01 15',\n fill: true,\n },\n}\n\nexport const patternList = Object.keys(PATTERN)\n\nexport type Color =\n | `#${string}`\n | `rgb(${number}, ${number}, ${number})`\n | `hsl(${number}, ${number}%, ${number}%)`\n\nexport const Image: VoidComponent<{\n id: string\n image?:\n | HTMLImageElement\n | ImageBitmap\n | ImageData\n | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }\n | StyleImageInterface\n | string\n options?: StyleImageMetadata\n pattern?: {\n type: string\n color: Color\n background: Color\n lineWith: number\n }\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n const [size, setSize] = createSignal({ width: 0, height: 0 })\n\n // Remove Image\n onCleanup(() => map()?.hasImage(props.id) && map()?.removeImage(props.id))\n\n // Add or Update Image\n createEffect(() => {\n if (!props.id) throw new Error('Image - ID is required')\n if (!props.image && !props.pattern)\n throw new Error('Image - Image or Pattern is required')\n\n const ops = props.pattern\n ? { pixelRatio: 2, ...props.options }\n : props.options\n\n _loadImage(props.image || _createPattern(props.pattern), data => {\n const { width, height } = data\n if (!map().hasImage(props.id)) map().addImage(props.id, data, ops)\n if (\n !props.pattern &&\n untrack(() => width === size().width && height === size().height)\n ) {\n map().updateImage(props.id, data)\n map().triggerRepaint()\n } else {\n map().removeImage(props.id)\n map().addImage(props.id, data, ops)\n }\n setSize({ width, height })\n })\n })\n\n // Load Image from URL\n const _loadImage = (image, callback) => {\n if (typeof image !== 'string') return callback(image)\n map().loadImage(image, (error, imageData) => {\n if (error) throw error\n return callback(imageData)\n })\n }\n\n const _createPattern = pattern => {\n const p = PATTERN[pattern.type]\n return {\n width: p.size,\n height: p.size,\n data: new Uint8Array(p.size * p.size * 4),\n onAdd: function () {\n let canvas = document.createElement('canvas')\n canvas.width = canvas.height = p.size\n this.ctx = canvas.getContext('2d', { willReadFrequently: true })\n },\n render: function () {\n this.ctx.fillStyle = pattern.background || 'transparent'\n this.ctx.fillRect(0, 0, this.width, this.height)\n this.ctx.strokeStyle = this.ctx.fillStyle = pattern.color || 'black'\n this.ctx.lineWidth = pattern.lineWith || 1\n this.ctx.stroke(new Path2D(p.path))\n if (p.fill) this.ctx.fill(new Path2D(p.path))\n this.data = this.ctx.getImageData(0, 0, this.width, this.height).data\n return true\n },\n }\n }\n\n return null\n}\n","import { createEffect, Component } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type LngLatLike from 'mapbox-gl/src/geo/lng_lat.js'\n\n// linearly interpolate between two positions [x,y,z] based on time\nconst lerp = (a, b, t) => a.map((_, idx) => (1.0 - t) * a[idx] + t * b[idx])\n\n// sphericaly interpolate between two positions [x,y,z] based on time\nconst slerp = (a, b, t) => {\n const omega = 0.075\n // TODO: Proper Calculation\n // a.map((_, idx) => a[idx] * b[idx]).reduce((m, n) => m + n)\n\n return a.map(\n (_, idx) =>\n (Math.sin((1 - t) * omega) / Math.sin(omega)) * a[idx] +\n (Math.sin(t * omega) / Math.sin(omega)) * b[idx]\n )\n}\n\n// calculations from: https://easings.net\nconst easeQuad = {\n in: (x: number): number => x * x,\n out: (x: number): number => 1 - (1 - x) * (1 - x),\n inOut: (x: number): number =>\n x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,\n}\n\ninterface RotateOptions {\n secPerRev?: number\n maxZoom?: number\n slowZoom?: number\n pitch?: number\n around?: LngLatLike\n}\n\nexport const Camera: Component<{\n rotateGlobe?: boolean | RotateOptions\n rotateViewport?: boolean | RotateOptions\n translate?: {\n type?: 'line' | 'sphere'\n start: [number, number, number]\n end: [number, number, number]\n target: LngLatLike\n targetEnd?: LngLatLike\n easing?: 'in' | 'out' | 'inOut'\n loop?: boolean\n duration: number\n }\n children?: any\n}> = props => {\n if (!useMap()) return\n const [map, userInteraction] = useMap()\n let animationTime = 0.1\n let isReverse = false\n\n const updateCameraPosition = async ([lng, lat, alt], target) => {\n const camera = map().getFreeCameraOptions()\n camera.position = map().mapLib.MercatorCoordinate.fromLngLat(\n [lng, lat],\n alt\n )\n camera.lookAtPoint(target)\n map().setFreeCameraOptions(camera)\n }\n\n const frame = (time: number) => {\n props.translate && window.requestAnimationFrame(frame)\n const params = [\n props.translate.start,\n props.translate.end,\n props.translate.easing\n ? easeQuad[props.translate.easing](animationTime)\n : animationTime,\n ] as const\n const position =\n props.translate.type === 'line' ? lerp(...params) : slerp(...params)\n\n updateCameraPosition(position, props.translate.target)\n\n if (!props.translate.loop && (animationTime > 1.0 || animationTime < 0.0))\n isReverse = !isReverse\n animationTime = isReverse ? animationTime - 0.001 : animationTime + 0.001\n }\n\n createEffect(() => {\n props.translate && window.requestAnimationFrame(frame)\n })\n\n const rotateGlobe = () => {\n const secPerRev = (props.rotateGlobe as RotateOptions).secPerRev || 120\n const maxSpinZoom = (props.rotateGlobe as RotateOptions).maxZoom || 5\n const slowSpinZoom = (props.rotateGlobe as RotateOptions).slowZoom || 3\n const zoom = map().getZoom()\n\n if (props.rotateGlobe && !userInteraction() && zoom < maxSpinZoom) {\n let distancePerSecond = 360 / secPerRev\n if (zoom > slowSpinZoom) {\n const zoomDif = (maxSpinZoom - zoom) / (maxSpinZoom - slowSpinZoom)\n distancePerSecond *= zoomDif\n }\n const center = map().getCenter()\n center.lng -= distancePerSecond\n map().easeTo({ center, duration: 1000, easing: n => n }, { rotate: true })\n }\n }\n\n const rotateViewport = () => {\n const secPerRev = (props.rotateViewport as RotateOptions)?.secPerRev || 60\n // const maxSpinZoom = (props.rotateViewport as RotateOptions)?.maxZoom || 5\n // const slowSpinZoom = (props.rotateViewport as RotateOptions)?.slowZoom || 3\n // const zoom = map().getZoom()\n\n if (props.rotateViewport && !userInteraction()) {\n let distancePerSecond = 360 / secPerRev\n // if (zoom > slowSpinZoom) {\n // const zoomDif = (maxSpinZoom - zoom) / (maxSpinZoom - slowSpinZoom)\n // distancePerSecond *= zoomDif\n // }\n const bearing = map().getBearing() - distancePerSecond\n map().easeTo(\n {\n bearing,\n pitch: (props.rotateViewport as RotateOptions)?.pitch || 80,\n duration: 1000,\n around: (props.rotateViewport as RotateOptions)?.around,\n easing: n => n,\n },\n { rotate: true }\n )\n }\n }\n\n map().on('moveend', evt =>\n evt.rotate && props.rotateGlobe ? rotateGlobe() : rotateViewport()\n )\n\n createEffect(() =>\n props.rotateGlobe ? !userInteraction() && rotateGlobe() : map().stop()\n )\n\n createEffect(() =>\n props.rotateViewport\n ? !userInteraction() && rotateViewport()\n : map().stop().resetNorthPitch()\n )\n\n return props.children\n}\n","import { onCleanup, createEffect, VoidComponent } from 'solid-js'\nimport { useMap } from '../MapGL'\nimport type { LightSpecification } from 'mapbox-gl/src/style-spec/types.js'\n\nexport const Light: VoidComponent<{\n style: LightSpecification\n}> = props => {\n if (!useMap()) return\n const [map] = useMap()\n\n // Add or Update Light Layer\n createEffect(() => map().setLight(props.style || {}))\n\n // Remove Light Layer\n onCleanup(() => map()?.setLight(null))\n\n return null\n}\n"],"names":["mapEvents","layerEvents","mapBase","gitBase","gishub","hereBase","vectorStyleList","mb","light","dark","street","outdoor","sat","sat_street","nav","nav_night","basic","monochrome","leshine","icecream","cali","northstar","mineral","moonlight","frank","minimo","decimal","standard","blueprint","bubble","pencil","swiss_ski","vintage","whaam","neon","camoflauge","emerald","runner","x_ray","here","base","day","night","esri","charted_territory","colored_pencil","community","mid_century","modern_antique","nat_geo","newspaper","open_street_map","light_gray_canvas","dark_gray_canvas","human_geo_light","human_geo_dark","world_navigation","world_street","world_street_night","world_terrain","world_terrain_hybrid","world_topographic","chromium","dreamcatcher","seahaven","sangria","mercurial","imagery","imagery_hybrid","firefly","firefly_hybrid","oceans","carto","stamen","tf","rasterStyleList","osm","org","human","cycle","topo","_copy","voyager","positron","toner","toner_lite","watercolor","terrain","trans","trans_dark","landscape","outdoors","neighbourhood","spinal","pioneer","atlas","mobile","MapContext","createContext","useMap","useContext","MapGL","props","map","id","createUniqueId","mapRoot","setMapRoot","createSignal","darkMode","setDarkMode","userInteraction","setUserInteraction","createEffect","onUserInteraction","debug","text","value","console","mapRef","_el$","_tmpl$","cloneNode","_$effect","_p$","_v$2","class","_v$3","classList","_v$4","style","position","inset","_v$","_$setAttribute","_$className","_$classList","_$style","undefined","getStyle","String","split","reduce","p","c","replace","apikey","import","meta","env","VITE_VECTOR_API_KEY","version","sources","layers","onMount","async","mapLib","Map","window","supported","Error","accessToken","options","VITE_MAPBOX_ACCESS_TOKEN","interactive","onViewportChange","viewport","container","darkStyle","fitBoundsOptions","padding","sourceIdList","layerIdList","once","forEach","event","on","evt","rotate","darkTheme","matchMedia","addEventListener","matches","toString","MutationObserver","document","body","contains","observe","attributes","item","prop","slice","toLowerCase","e","Object","keys","layerId","point","x","originalEvent","y","center","lat","getCenter","lng","zoom","getZoom","pitch","getPitch","bearing","getBearing","stop","transitionType","prev","bounds","cameraForBounds","proj","projection","setProjection","cursorStyle","getCanvas","cursor","isStyleLoaded","oldStyle","oldLayers","filter","l","includes","oldSources","s","obj","key","setStyle","newStyle","list","layer","index","findIndex","i","metadata","smg","beforeType","type","beforeId","onCleanup","remove","_$createComponent","Provider","children","_$memo","SourceContext","useSourceId","Source","lookup","url","source","tiles","VITE_RASTER_API_KEY","devicePixelRatio","attribution","addSource","push","getSource","data","isSourceLoaded","setData","coords","coordinates","updateImage","setUrl","setTiles","src","_tileJSONRequest","cancel","scheme","_options","_sourceCaches","clearTiles","load","removeLayer","removeSource","diff","newProps","prevProps","Set","acc","Layer","sourceId","addLayer","customLayer","find","layout","setLayoutProperty","validate","paint","setPaintProperty","minzoom","maxzoom","setLayerZoomRange","setFilter","visible","featureState","removeFeatureState","sourceLayer","setFeatureState","state","getLayer","Atmosphere","setFog","Terrain","isMapLibre","tileSize","setTerrain","exaggeration","Control","control","hasControl","removeControl","lib","custom","NavigationControl","ScaleControl","AttributionControl","GeolocateControl","FullscreenControl","getControl","addControl","Marker","marker","popup","lngLat","ops","pops","mapboxgl","untrack","Popup","setHTML","onClose","setPopup","onDragStart","onDragEnd","onLngLatChange","getLngLat","toArray","setDraggable","draggable","setLngLat","addTo","openPopup","isOpen","togglePopup","trackPointer","closeOnClick","closeButton","focusAfterOpen","PATTERN","diagonal_l","size","path","diagonal_r","horizontal","vertical","cross","hash","chevron_h","chevron_v","square","fill","hex","circle","patternList","Image","setSize","width","height","hasImage","removeImage","image","pattern","pixelRatio","_loadImage","_createPattern","addImage","triggerRepaint","callback","loadImage","error","imageData","Uint8Array","onAdd","canvas","createElement","this","ctx","getContext","willReadFrequently","render","fillStyle","background","fillRect","strokeStyle","color","lineWidth","lineWith","stroke","Path2D","getImageData","easeQuad","in","out","inOut","Math","pow","Camera","animationTime","isReverse","frame","time","translate","requestAnimationFrame","params","start","end","easing","alt","target","camera","getFreeCameraOptions","MercatorCoordinate","fromLngLat","lookAtPoint","setFreeCameraOptions","updateCameraPosition","a","b","t","_","idx","lerp","omega","sin","slerp","loop","rotateGlobe","secPerRev","maxSpinZoom","maxZoom","slowSpinZoom","slowZoom","distancePerSecond","easeTo","duration","n","rotateViewport","around","resetNorthPitch","Light","setLight"],"mappings":"wSAoDA,MAAMA,EAAsB,CAC1B,cACA,YACA,cACA,aACA,cACA,eACA,eACA,aACA,UACA,aACA,gBACA,eACA,aACA,gBACA,UACA,WACA,WACA,cACA,cACA,SACA,YACA,cACA,SACA,YACA,cACA,SACA,YACA,gBACA,WACA,aACA,eACA,UACA,aACA,iBACA,eACA,kBACA,qBACA,yBACA,SACA,WACA,SACA,UACA,SACA,cACA,eACA,gBACA,qBACA,sBACA,uBAmBIC,EAAqB,CACzB,cACA,YACA,cACA,aACA,cACA,eACA,eACA,UACA,aACA,gBACA,eACA,aACA,iBCrIIC,EAAU,yBACVC,EAAU,qCACVC,EAAS,6DACTC,EAAW,4CAEJC,EAA0B,CACrCC,GAAI,CACFC,MAAQ,GAAEN,cACVO,KAAO,GAAEP,aACTQ,OAAS,GAAER,gBACXS,QAAU,GAAET,iBACZU,IAAM,GAAEV,iBACRW,WAAa,GAAEX,0BACfY,IAAM,GAAEZ,+BACRa,UAAY,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ACEjP,UACAF,MAAQ1G,EAAMgW,gBAAkCtP,OAAS,GACzDoP,SAAU,IACVG,OAASjW,EAAMgW,gBAAkCC,OACjD/B,OAAQ6B,GAAKA,GAEf,CAAEnR,QAAQ,GAEd,GAiBF,OAdA3E,IAAMyE,GAAG,WAAWC,GAClBA,EAAIC,QAAU5E,EAAMsV,YAAcA,IAAgBU,MAGpDrV,GAAa,IACXX,EAAMsV,aAAe7U,KAAqB6U,IAAgBrV,IAAM6G,SAGlEnG,GAAa,IACXX,EAAMgW,gBACDvV,KAAqBuV,IACtB/V,IAAM6G,OAAOoP,oBAGZlW,EAAMmJ,QAAQ,EC/IVgN,EAERnW,IACH,IAAKH,IAAU,OACf,MAAOI,GAAOJ,IAQd,OALAc,GAAa,IAAMV,IAAMmW,SAASpW,EAAM4B,OAAS,CAAE,KAGnDmH,GAAU,IAAM9I,KAAOmW,SAAS,QAEzB,IAAI"}
|
|
@@ -23,12 +23,11 @@ export const Control = props => {
|
|
|
23
23
|
if (!useMap())
|
|
24
24
|
return;
|
|
25
25
|
const [map] = useMap();
|
|
26
|
-
const mapLib = map().mapLib;
|
|
27
26
|
let control = null;
|
|
28
27
|
// Add or Update Control
|
|
29
28
|
createEffect(() => {
|
|
30
29
|
control && map().hasControl(control) && map().removeControl(control);
|
|
31
|
-
control = getControl(mapLib, props.type, props.options, props.custom);
|
|
30
|
+
control = getControl(map().mapLib, props.type, props.options, props.custom);
|
|
32
31
|
map().addControl(control, props.position);
|
|
33
32
|
});
|
|
34
33
|
// Remove Control
|
|
@@ -123,8 +123,8 @@ export const MapGL = props => {
|
|
|
123
123
|
};
|
|
124
124
|
if (!map || props.id === props.viewport?.id || userInteraction())
|
|
125
125
|
return;
|
|
126
|
-
map?.stop()[props.transitionType](viewport);
|
|
127
|
-
debug(`Update Viewport (${props.transitionType}):`, viewport);
|
|
126
|
+
map?.stop()[props.transitionType || 'flyTo'](viewport);
|
|
127
|
+
debug(`Update Viewport (${props.transitionType || 'flyTo'}):`, viewport);
|
|
128
128
|
});
|
|
129
129
|
// Update boundaries
|
|
130
130
|
createEffect(prev => {
|
|
@@ -12,17 +12,18 @@ export const Marker = props => {
|
|
|
12
12
|
createEffect(() => {
|
|
13
13
|
const ops = { ...props.options };
|
|
14
14
|
const pops = { ...props.options?.popup };
|
|
15
|
+
if (!map())
|
|
16
|
+
return;
|
|
17
|
+
const mapboxgl = map().mapLib;
|
|
15
18
|
untrack(() => {
|
|
16
19
|
popup?.remove();
|
|
17
20
|
popup = props.children
|
|
18
|
-
? new
|
|
19
|
-
.Popup(pops)
|
|
21
|
+
? new mapboxgl.Popup(pops)
|
|
20
22
|
.setHTML(props.children)
|
|
21
23
|
.on('close', () => props.onClose?.())
|
|
22
24
|
: null;
|
|
23
25
|
marker?.remove();
|
|
24
|
-
marker = new
|
|
25
|
-
.Marker(ops)
|
|
26
|
+
marker = new mapboxgl.Marker(ops)
|
|
26
27
|
.setPopup(popup)
|
|
27
28
|
.on('dragstart', () => props.onDragStart?.())
|
|
28
29
|
.on('dragend', () => props.onDragEnd?.())
|
|
@@ -10,10 +10,12 @@ export const Popup = props => {
|
|
|
10
10
|
// Add or Update Popup
|
|
11
11
|
createEffect(() => {
|
|
12
12
|
const ops = { ...props.options };
|
|
13
|
+
if (!map())
|
|
14
|
+
return;
|
|
15
|
+
const mapboxgl = map().mapLib;
|
|
13
16
|
untrack(() => {
|
|
14
17
|
popup?.remove();
|
|
15
|
-
popup = new
|
|
16
|
-
.Popup(props.trackPointer
|
|
18
|
+
popup = new mapboxgl.Popup(props.trackPointer
|
|
17
19
|
? { ...ops, closeOnClick: false, closeButton: false }
|
|
18
20
|
: { focusAfterOpen: false, ...ops })
|
|
19
21
|
.setHTML(props.children || '')
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.6.
|
|
2
|
+
"version": "1.6.1",
|
|
3
3
|
"name": "solid-map-gl",
|
|
4
4
|
"description": "Solid Component Library for Mapbox GL JS",
|
|
5
5
|
"info": "Solid Component Library for 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.",
|