+ initializeExport(map);
+ initializeBrowse(map, params);
+ initializeNotes(map, params);
+});
+
+function updateLocation() {
+ updatelinks(this.getCenter().wrap(),
+ this.getZoom(),
+ this.getLayersCode(),
+ this.getBounds().wrap());
+
+ var expiry = new Date();
+ expiry.setYear(expiry.getFullYear() + 10);
+ $.cookie("_osm_location", cookieContent(this), { expires: expiry });
+
+ // Trigger hash update on layer changes.
+ this.hash.onMapMove();
+}
+
+function setPositionLink(map) {
+ return function(e) {
+ var data = $(this).data(),
+ center = L.latLng(data.lat, data.lon);
+
+ if (data.minLon && data.minLat && data.maxLon && data.maxLat) {
+ map.fitBounds([[data.minLat, data.minLon],
+ [data.maxLat, data.maxLon]]);
+ } else {
+ map.setView(center, data.zoom);
+ }
+
+ if (data.type && data.id) {
+ map.addObject(data, { zoom: true, style: { opacity: 0.2, fill: false } });
+ }
+
+ map.markerLayer.clearLayers();
+ L.marker(center, {icon: getUserIcon()}).addTo(map.markerLayer);
+
+ return e.preventDefault();
+ };
+}
+
+function submitSearch(map) {
+ return function(e) {
+ var bounds = map.getBounds();