mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-23 17:22:24 -04:00
Rename map on /places to #placesmap
The way the javascript is compiled means it's a good idea to make sure everything is as distinct as possible.
This commit is contained in:
@@ -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 © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors under <a href="http://www.openstreetmap.org/copyright">ODbL</a> | Map imagery © <a href="http://mapbox.com">Mapbox</a>',
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ p.stats {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
#map, #cropmap {
|
||||
#placesmap, #cropmap {
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-content_for :title, "Places"
|
||||
|
||||
%div#map
|
||||
%div#placesmap
|
||||
|
||||
|
||||
Reference in New Issue
Block a user