container = {
const div = DOM.element('div', { style: `height:800px;` });
yield div;
const map = L.map(div).setView([40.7299, -85], 5);
const accessToken =
"pk.eyJ1IjoibGlmZXdpbm5pbmciLCJhIjoiYWZyWnFjMCJ9.ksAPTz72HyEjF2AOMbRNvg";
L.tileLayer(
'https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibGlmZXdpbm5pbmciLCJhIjoiYWZyWnFjMCJ9.ksAPTz72HyEjF2AOMbRNvg',
{
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}
).addTo(map);
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.slug) {
layer.bindPopup(feature.properties.slug);
}
}
const mystyle = {
color: "red",
weight: 2,
opacity: .5
};
const json = L.geoJSON(submarine, {
style: function(feature) {
return { color: `#${feature.properties.color}`, weight: 1 };
},
onEachFeature: onEachFeature
});
json.addTo(map);
}