viewof berkshire_map = {
const container = html`<div><div class="inner" style="height:800px;"></div></div>`;
let inner = container.querySelector(".inner");
inner.addEventListener("input", e => e.stopPropagation());
yield container;
let map = L.map(inner).setView([42.3824162, -73.2380902], 10);
let osmLayer = L.tileLayer(
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}
).addTo(map);
let world_imagry = L.tileLayer(
'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
{
attribution:
'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
maxZoom: 17
}
);
let world_topo = L.tileLayer(
'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
{
attribution:
'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
maxZoom: 17
}
);
let baseLayers = {
"Open Street Maps": osmLayer,
"World Imagery": world_imagry,
"World Topo Map": world_topo
};
map.addLayer(world_imagry);
map.baseLayers = baseLayers;
container.value = map;
}