From 23a58485de45d32aa9e57d5d5889500a6bf89623 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 9 May 2021 15:56:46 +0200 Subject: [PATCH] Remove unused code --- static/js/map.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/static/js/map.js b/static/js/map.js index 12ed8b5..bc5e85e 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -68,46 +68,12 @@ if (!start_lat || !start_lng) { ]); } -// Add OpenStreetMap layer var osm = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { maxZoom: 19, }); osm.addTo(map); -function check_items(items) { - if (items.length === 0) return; - - var item = items.shift(); - var qid = item.qid; - - var markers_url = `/api/1/item/${qid}`; - axios.get(markers_url).then((response) => { - // console.log(response.data, item); - response.data.info.forEach((osm) => { - var icon = osmYellowMarker; - var marker = L.marker(osm.centroid, { title: osm.name, icon: icon }); - var popup = ` -

- ${osm.identifier}: ${osm.name} -

`; - marker.bindPopup(popup); - marker.addTo(group); - }); - item.markers.forEach((marker_data) => { - var marker = marker_data.marker; - var icon = response.data.tagged ? greenMarker : redMarker; - marker.setIcon(icon); - - response.data.info.forEach((osm) => { - var path = [osm.centroid, marker_data]; - var polyline = L.polyline(path, { color: "green" }).addTo(map); - }); - }); - if (items.length) check_items(items); - }); -} - function update_wikidata() { if ( Object.keys(wikidata_items).length === 0 ||