map.attributionControl.setPrefix('');
- new L.Hash(map);
+ map.hash = L.hash(map);
var layers = [
new L.OSM.Mapnik({
layers[0].addTo(map);
- map.noteLayer = new L.LayerGroup({code: 'N'});
+ map.noteLayer = new L.LayerGroup();
+ map.noteLayer.options = {code: 'N'};
+
map.dataLayer = new L.OSM.DataLayer(null);
+ map.dataLayer.options.code = 'D';
$("#sidebar").on("opened closed", function () {
map.invalidateSize();
L.OSM.share({
position: position,
- getShortUrl: getShortUrl,
- getUrl: getUrl,
sidebar: sidebar,
short: true
}).addTo(map);
}
initializeExport(map);
- initializeBrowse(map);
- initializeNotes(map);
+ initializeBrowse(map, params);
+ initializeNotes(map, params);
});
function updateLocation() {
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) {