var layers = [
new L.OSM.Mapnik({
- attribution: copyright+" – "+donate,
+ attribution: copyright + " ♥ " + donate,
code: "M",
keyid: "mapnik",
name: I18n.t("javascripts.map.base.standard")
map.dataLayer = new L.OSM.DataLayer(null);
map.dataLayer.options.code = 'D';
- if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
- if (params.layers.indexOf(map.noteLayer.options.code) >= 0) {
- map.addLayer(map.noteLayer);
- }
-
- if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
- map.addLayer(map.dataLayer);
- }
- }
-
var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright';
L.OSM.zoom({position: position})
L.control.scale()
.addTo(map);
+ if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
+ initializeNotes(map);
+ if (params.layers.indexOf(map.noteLayer.options.code) >= 0) {
+ map.addLayer(map.noteLayer);
+ }
+
+ initializeBrowse(map);
+ if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
+ map.addLayer(map.dataLayer);
+ }
+ }
+
$('.leaflet-control .control-button').tooltip({placement: 'left', container: 'body'});
map.on('moveend layeradd layerremove', function() {
});
}
- initializeBrowse(map);
- initializeNotes(map);
-
OSM.Index = function(map) {
- var page = {}, minimized = $('#sidebar').hasClass('minimized');
+ var page = {};
page.pushstate = page.popstate = function(path) {
- if (minimized) $("#sidebar").addClass("minimized");
+ $("#content").addClass("overlay-sidebar");
+ map.invalidateSize();
+ $('#sidebar_content').load(path + "?xhr=1", function(a, b, xhr) {
+ if (xhr.getResponseHeader('X-Page-Title')) {
+ document.title = xhr.getResponseHeader('X-Page-Title');
+ }
+ });
+ };
+
+ page.unload = function() {
+ $("#content").removeClass("overlay-sidebar");
map.invalidateSize();
- $('#sidebar_content').load(path);
};
return page;
var page = {};
page.pushstate = page.popstate = function(path, type, id) {
- $("#sidebar").removeClass("minimized");
- map.invalidateSize();
- $('#sidebar_content').load(path, function() {
+ $('#sidebar_content').load(path + "?xhr=1", function(a, b, xhr) {
+ if (xhr.getResponseHeader('X-Page-Title')) {
+ document.title = xhr.getResponseHeader('X-Page-Title');
+ }
page.load(path, type, id);
});
};
map.getCenter().lat.toFixed(precision) + "," +
map.getCenter().lng.toFixed(precision)));
});
-
});