From: John Firebaugh Date: Thu, 21 Nov 2013 19:31:58 +0000 (-0800) Subject: Use machine-readable lat/lon format X-Git-Tag: live~4625^2~28 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/fbd5a88b24f54002c68f9989b68c9603d3bda0ee Use machine-readable lat/lon format --- diff --git a/app/assets/javascripts/index/note.js.erb b/app/assets/javascripts/index/note.js.erb index 8c2ab5c56..1f9dbe375 100644 --- a/app/assets/javascripts/index/note.js.erb +++ b/app/assets/javascripts/index/note.js.erb @@ -61,16 +61,17 @@ OSM.Note = function (map) { content.find("textarea").val('').trigger("input"); - var data = $('.details').data(); + var data = $('.details').data(), + latLng = data.coordinates.split(','); + if (!window.location.hash) { - var coords = data.coordinates.split(','); OSM.route.moveListenerOff(); map.once('moveend', OSM.route.moveListenerOn); - map.getZoom() > 15 ? map.panTo(coords) : map.setView(coords, 16); + map.getZoom() > 15 ? map.panTo(latLng) : map.setView(latLng, 16); } if (!map.hasLayer(halo)) { - halo = L.circleMarker(data.coordinates.split(','), { + halo = L.circleMarker(latLng, { weight: 2.5, radius: 20, fillOpacity: 0.5, @@ -80,7 +81,7 @@ OSM.Note = function (map) { } if (map.hasLayer(currentNote)) map.removeLayer(currentNote); - currentNote = L.marker(data.coordinates.split(','), { + currentNote = L.marker(latLng, { icon: noteIcons[data.status], opacity: 1, clickable: true diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index 90d34b574..967487af6 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -11,7 +11,7 @@ <%= h(@note.comments.first.body.to_html) %> -
+
<%= note_event('open', @note.created_at, @note.author) %> <% if @note.status == "closed" %>