X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/331cf6b06815d3f4aa7eba426249356727931071..7ebb29d195c2761f11f7c87dec3f9559bb9a8500:/app/views/diary_entry/new.rhtml diff --git a/app/views/diary_entry/new.rhtml b/app/views/diary_entry/new.rhtml index 9f86c2ab4..b46bb4d9f 100644 --- a/app/views/diary_entry/new.rhtml +++ b/app/views/diary_entry/new.rhtml @@ -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;