aboutsummaryrefslogtreecommitdiff
path: root/web/public/javascripts/map.js
diff options
context:
space:
mode:
authorKumar Damani <damani.kumar@gmail.com>2019-03-05 20:49:57 +0000
committerGitHub <noreply@github.com>2019-03-05 20:49:57 +0000
commit97ae21bf83fb04526269442e2fa3954d99d18665 (patch)
tree4ef4ed4b8e9a079b504c7c31e5f5932bbe459f05 /web/public/javascripts/map.js
parentc16d2af861f4ed452b2b43f087290f5c0889c34d (diff)
parenta08006f89b4252c5edd2d88938ba4e68010b1bd3 (diff)
Merge pull request #22 from csc301-winter-2019/feat7-qa-merging
Feat7 qa merging
Diffstat (limited to 'web/public/javascripts/map.js')
-rw-r--r--web/public/javascripts/map.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js
index 5e5a303..190307d 100644
--- a/web/public/javascripts/map.js
+++ b/web/public/javascripts/map.js
@@ -12,10 +12,12 @@ L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}
ext: 'png'
}).addTo(map);
-// Create point feature for somewhere downtown
-var myDataPoint = L.marker([43.6529, -79.3849]).addTo(map);
-
-// Bind popup to Data Point object
-myDataPoint.bindPopup("<h3>City Hall (not really)</h3><p>Toronto, ON<br>Information about city hall.</p>");
-
-map.setZoom(13);
+L.geoJson(points, {
+ pointToLayer: function (feature, latlng) {
+ //return L.circleMarker(latlng);
+ return L.marker(latlng);
+ }
+}).bindPopup(function (layer) {
+ // layer.feature.geometry gives you access to all the fields
+ return "<p>" + JSON.stringify(layer.feature.geometry) + "</p>";
+}).addTo(map)