diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-11-13 02:46:28 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-11-13 02:46:28 +0100 |
| commit | 1b61e44f7fb273a3df6f1bb2a02aa046cfe736e0 (patch) | |
| tree | 6a7b1c9b492db190e4aecafc5b2a64acf57f5780 /reports/map.js | |
| parent | 6801542b636835c2abb07063448ce7416b12bbe2 (diff) | |
red dot
Diffstat (limited to 'reports/map.js')
| -rw-r--r-- | reports/map.js | 10 |
1 files changed, 9 insertions, 1 deletions
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([ "<b>",point[0], "</b>", "<br>", |
