You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/tutorial/15-context/01-context-api/app-a/MapMarker.svelte

14 lines
293 B

<script>
import { mapbox } from './mapbox.js';
// ...get the context here
export let lat;
export let lon;
export let label;
const popup = new mapbox.Popup({ offset: 25 }).setText(label);
const marker = new mapbox.Marker().setLngLat([lon, lat]).setPopup(popup).addTo(map);
</script>