var map = L.map('map').setView([55.68, 12.57], 13); L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap' }).addTo(map); function addMarker(shop) { L.marker([shop.lat, shop.long], {title: shop.name, }).addTo(map); } function addPolygon(polygon) { L.polygon(polygon, {color: 'red'}).addTo(map); console.log(polygon.coordinates) } async function fetchShops() { const response = await fetch("supermarkets.json"); const shops = await response.json(); shops.forEach((shop) => addMarker(shop)); } fetchShops() async function fetch_voronoi_polygons() { const response = await fetch("voronoi_polygons.json"); const voronoi_polygons = await response.json(); voronoi_polygons.forEach((polygon) => addPolygon(polygon)); } fetch_voronoi_polygons()