From 1b61e44f7fb273a3df6f1bb2a02aa046cfe736e0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 13 Nov 2018 02:46:28 +0100 Subject: red dot --- reports/map.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'reports/map.js') diff --git a/reports/map.js b/reports/map.js index e6244686..6a2db154 100644 --- a/reports/map.js +++ b/reports/map.js @@ -22,6 +22,14 @@ if (address) { source = address.slice(3,5).map(n => parseFloat(n)) console.log(address, source) } + +var redDot = L.icon({ + iconUrl: '../reddot.png', + iconSize: [17, 17], // size of the icon + iconAnchor: [8, 8], // point of the icon which will correspond to marker's location + popupAnchor: [0, -5] // point from which the popup should open relative to the iconAnchor +}); + points.forEach(point => { /* [ @@ -39,7 +47,7 @@ points.forEach(point => { const latlng = point.slice(5,7).map(n => parseFloat(n)) console.log(point) if (!latlng.length || isNaN(latlng[0]) || isNaN(latlng[1])) return - var marker = L.marker(latlng).addTo(map); + var marker = L.marker(latlng, { icon: redDot }).addTo(map); marker.bindPopup([ "",point[0], "", "
", -- cgit v1.2.3-70-g09d2