Created
May 20, 2022 02:09
-
-
Save gtnbssn/2176a76c77ba54f5073ba48bcf9a4751 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import XElement from 'astro-xelement'; | |
import { Debug } from 'astro/components'; | |
const { Div } = XElement; | |
--- | |
<Div id="map" style="position: absolute; top: 0; bottom: 0; width: 100%;" | |
@do={(element,store)=>{ | |
import maplibregl from 'maplibre-gl'; | |
import 'maplibre-gl/dist/maplibre-gl.css'; | |
store.map = new maplibregl.Map({ | |
container: 'map', // container id | |
style: 'https://demotiles.maplibre.org/style.json', // style URL | |
center: [0, 0], // starting position [lng, lat] | |
zoom: 1 // starting zoom | |
}} | |
></Div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment