-function updateLocation() {
- var lonlat = unproj(map.getCenter());
- var zoom = map.getZoom();
- var layers = getMapLayers();
- var extents = unproj(map.getExtent());
- var expiry = new Date();
-
- updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top, params.object_type, params.object_id);
-
- expiry.setYear(expiry.getFullYear() + 10);
- $.cookie("_osm_location", [lonlat.lon, lonlat.lat, zoom, layers].join("|"), {expires: expiry});
-}
+ function updateLocation() {
+ var center = map.getCenter();
+ var zoom = map.getZoom();
+ var layers = getMapLayers();
+ var extents = map.getBounds();
+
+ updatelinks(center.lng,
+ center.lat,
+ zoom,
+ layers,
+ extents.getWestLng(),
+ extents.getSouthLat(),
+ extents.getEastLng(),
+ extents.getNorthLat(),
+ params.object);
+
+ var expiry = new Date();
+ expiry.setYear(expiry.getFullYear() + 10);
+ $.cookie("_osm_location", [center.lng, center.lat, zoom, layers].join("|"), {expires: expiry});
+ }