- 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);
+ var extents = map.getBounds().wrap();
+
+ updatelinks(center.lng,
+ center.lat,
+ zoom,
+ layers,
+ extents.getWestLng(),
+ extents.getSouthLat(),
+ extents.getEastLng(),
+ extents.getNorthLat(),
+ params.object);