$('.leaflet-control .control-button').tooltip({placement: 'left', container: 'body'});
- map.on('moveend layeradd layerremove', updateLocation);
+ map.on('moveend layeradd layerremove', function() {
+ updatelinks(
+ map.getCenter().wrap(),
+ map.getZoom(),
+ map.getLayersCode(),
+ map._object);
+
+ var expiry = new Date();
+ expiry.setYear(expiry.getFullYear() + 10);
+ $.cookie("_osm_location", cookieContent(map), { expires: expiry });
+
+ // Trigger hash update on layer changes.
+ map.hash.onMapMove();
+ });
if (OSM.PIWIK) {
map.on('layeradd', function (e) {
}
}
- if (params.box) {
- L.rectangle(params.box, {
- weight: 2,
- color: '#e90',
- fillOpacity: 0
- }).addTo(map);
- }
-
if (params.marker) {
marker.setLatLng([params.mlat, params.mlon]).addTo(map);
}
if ('undefined' !== typeof initializeChangesets) initializeChangesets(map);
});
-
-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();
-}