From 66900f8cb8b7edec0ad2c5f4a4ebd21b70a3e86a Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 8 Mar 2019 15:59:58 -0500 Subject: Changed code so that the popup doesn't show up when the marker is clicked. --- web/public/javascripts/map.js | 16 ++++++---------- web/public/stylesheets/style.css | 3 +-- 2 files changed, 7 insertions(+), 12 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 "

" + JSON.stringify(layer.feature.geometry) + "

"; -}).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') { diff --git a/web/public/stylesheets/style.css b/web/public/stylesheets/style.css index 85d3f10..d8618cd 100644 --- a/web/public/stylesheets/style.css +++ b/web/public/stylesheets/style.css @@ -23,8 +23,7 @@ a { width: 350px; height: 275px; max-height: 275px; -/* overflow: auto; -*/ position: relative; + position: relative; float: left; background-color: lightgrey; border-radius: 10px; -- cgit v1.2.3