[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] Limit coordinates display to 4 decimals
From: |
Maxime Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH] Limit coordinates display to 4 decimals |
Date: |
Wed, 9 Sep 2009 14:33:04 +0200 |
---
www/media/osm_map.js | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/www/media/osm_map.js b/www/media/osm_map.js
index 3bf116c..171181a 100644
--- a/www/media/osm_map.js
+++ b/www/media/osm_map.js
@@ -40,10 +40,10 @@ function updateForm()
var bottomright = new OpenLayers.LonLat(bounds.right, bounds.bottom);
bottomright = bottomright.transform(epsg_projection,
epsg_display_projection);
- getUpperLeftLat().value = topleft.lat;
- getUpperLeftLon().value = topleft.lon;
- getBottomRightLat().value = bottomright.lat;
- getBottomRightLon().value = bottomright.lon;
+ getUpperLeftLat().value = topleft.lat.toFixed(4);
+ getUpperLeftLon().value = topleft.lon.toFixed(4);
+ getBottomRightLat().value = bottomright.lat.toFixed(4);
+ getBottomRightLon().value = bottomright.lon.toFixed(4);
}
/* update map on form field modification */
@@ -80,5 +80,6 @@ function init()
map.events.register('zoomend', map, updateForm);
map.events.register('moveend', map, updateForm);
updateMap();
+ updateForm();
}
--
1.6.3.3.210.g29cb3
- [Maposmatic-dev] [PATCH] Limit coordinates display to 4 decimals,
Maxime Petazzoni <=