- expiry.setYear(expiry.getFullYear() + 10);
- $.cookie("_osm_location", [lonlat.lon, lonlat.lat, zoom, layers].join("|"), {expires: expiry});
-}
+ function updateLocation() {
+ var center = map.getCenter().wrap();
+ var zoom = map.getZoom();
+ var layers = getMapLayers();
+ var extents = map.getBounds().wrap();
+
+ 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});
+ }