X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/15c492ebfe7aa6527f7b24fe23056ee9947286d1..19a57c97b16d2dae962739f49732c081acaf3202:/app/views/diary_entry/new.rhtml?ds=inline
diff --git a/app/views/diary_entry/new.rhtml b/app/views/diary_entry/new.rhtml
index 7ee1eeaed..b46bb4d9f 100644
--- a/app/views/diary_entry/new.rhtml
+++ b/app/views/diary_entry/new.rhtml
@@ -12,7 +12,7 @@
Location |
-
+ |
Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %> use map |
@@ -41,12 +41,12 @@
var marker;
function init(){
- var centre = lonLatToMercator(new OpenLayers.LonLat(<%= lon %>, <%= lat %>));
+ var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
var zoom = <%= zoom %>;
var map = createMap("map");
- map.setCenter(centre, zoom);
+ setMapCenter(centre, zoom);
map.events.register("click", map, setLocation);
}
@@ -54,8 +54,7 @@
function setLocation( e ) {
closeMapPopup();
- var merc = map.getLonLatFromViewPortPx(e.xy);
- var lonlat = mercatorToLonLat(merc);
+ var lonlat = getEventPosition(e);
document.getElementById('latitude').value = lonlat.lat;
document.getElementById('longitude').value = lonlat.lon;