aboutsummaryrefslogtreecommitdiff
path: root/web/public/javascripts/map.js
diff options
context:
space:
mode:
authorSamarth Agarwal <samarth.agarwal@mail.utoronto.ca>2019-03-08 20:59:58 +0000
committerSamarth Agarwal <samarth.agarwal@mail.utoronto.ca>2019-03-08 20:59:58 +0000
commit66900f8cb8b7edec0ad2c5f4a4ebd21b70a3e86a (patch)
tree43a5b6ae0409588f477f562f7ebaa2d264227dd0 /web/public/javascripts/map.js
parent6693b77761373a269c6d797ecb6a8eedec946e9a (diff)
Changed code so that the popup doesn't show up when the marker is clicked.feat/22
Diffstat (limited to 'web/public/javascripts/map.js')
-rw-r--r--web/public/javascripts/map.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js
index fe33d73..4a1e697 100644
--- a/web/public/javascripts/map.js
+++ b/web/public/javascripts/map.js
@@ -17,18 +17,14 @@ L.geoJson(points, {
//return L.circleMarker(latlng);
return L.marker(latlng);
}
-}).bindPopup(function (layer) {
- // layer.feature.geometry gives you access to all the fields
-
- // show the details of the point in a sidebar
- showDetails(layer)
-
- return "<p>" + JSON.stringify(layer.feature.geometry) + "</p>";
-}).addTo(map)
+}).on('click', showDetails).addTo(map)
// show details about point
-// layer is the dictionary that holds info about the point
-function showDetails(layer) {
+// e is the event info
+function showDetails(e) {
+ // layer.feature.geometry gives you access to all the fields
+ let layer = e.layer
+
let sideBar = document.getElementById('sidebar')
if (getComputedStyle(sideBar).visibility === 'hidden') {