diff --git a/app/assets/javascripts/places.js.erb b/app/assets/javascripts/places.js.erb
index 7f321a33d..55f480b62 100644
--- a/app/assets/javascripts/places.js.erb
+++ b/app/assets/javascripts/places.js.erb
@@ -8,8 +8,8 @@ nominatim_user_agent_email = "<%= Growstuff::Application.config.user_agent_email
L.Icon.Default.imagePath = '/assets'
if (location.pathname === places_base_path) { //places index page
- map = L.map('map').setView([0.0, -0.0], 2);
- showMap(map);
+ placesmap = L.map('placesmap').setView([0.0, -0.0], 2);
+ showMap(placesmap);
} else { // specific place page
place = location.pathname.replace(places_base_path + "/", '');
nominatim_query_url = nominatim_base_url + place;
@@ -20,16 +20,16 @@ if (location.pathname === places_base_path) { //places index page
email: nominatim_user_agent_email
};
$.getJSON(nominatim_query_url, nominatim_options, function(data) {
- map = L.map('map').setView([data[0].lat, data[0].lon], 5);
- showMap(map);
+ placesmap = L.map('map').setView([data[0].lat, data[0].lon], 5);
+ showMap(placesmap);
})
}
-function showMap(map) {
+function showMap(placesmap) {
L.tileLayer(base_url, {
attribution: 'Map data © OpenStreetMap contributors under ODbL | Map imagery © Mapbox',
maxZoom: 18
- }).addTo(map);
+ }).addTo(placesmap);
markers = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 20 });
$.getJSON(things_to_map, function(members) {
@@ -44,5 +44,5 @@ function showMap(map) {
});
});
- map.addLayer(markers);
+ placesmap.addLayer(markers);
}
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
index ffb81e6fc..3879c9d7b 100644
--- a/app/assets/stylesheets/bootstrap_and_overrides.css.less
+++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -150,7 +150,7 @@ p.stats {
margin-left: 0px;
}
-#map, #cropmap {
+#placesmap, #cropmap {
height: 500px;
}
diff --git a/app/views/places/index.html.haml b/app/views/places/index.html.haml
index 6b3e0d73c..94f8ab6f0 100644
--- a/app/views/places/index.html.haml
+++ b/app/views/places/index.html.haml
@@ -1,4 +1,4 @@
-content_for :title, "Places"
-%div#map
+%div#placesmap