Published unlisted
Edited
Feb 6, 2020
Insert cell
Insert cell
Insert cell
Changed in fork
viewof map = { const container = html`<div style="height:400px;">`; yield container; // Give the container dimensions. const map = container.value = new mapboxgl.Map({ container, center: [0,0], zoom: 1, style: mapStyle(), scrollZoom: false });
-
var marker = new mapboxgl.Marker() .setLngLat([longitude, 0]) .addTo(map);
invalidation.then(() => map.remove()); }
Insert cell
Removed in parent
marker = {
const marker = new mapboxgl.Marker()
.setLngLat([0, 0])
.addTo(map);
// make sure we clean up the marker if we re-run this cell too!
invalidation.then(() => marker.remove());
return marker;
}
Insert cell
Removed in parent
{
// make only this call depend on changes to `longitude` cell
marker.setLngLat([longitude, 0])
}
Insert cell
Insert cell
Insert cell
Insert cell