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:
Skud
2014-07-04 10:47:50 +10:00
parent 9f1a7aad63
commit c8dbdbe298
3 changed files with 9 additions and 9 deletions

View File

@@ -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 &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors under <a href="http://www.openstreetmap.org/copyright">ODbL</a> | Map imagery &copy; <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);
}

View File

@@ -150,7 +150,7 @@ p.stats {
margin-left: 0px;
}
#map, #cropmap {
#placesmap, #cropmap {
height: 500px;
}

View File

@@ -1,4 +1,4 @@
-content_for :title, "Places"
%div#map
%div#placesmap