+ map.attributionControl.setPrefix('');
+
+ map.hash = L.hash(map);
+
+ var layers = [
+ new L.OSM.Mapnik({
+ attribution: '',
+ code: "M",
+ keyid: "mapnik",
+ name: I18n.t("javascripts.map.base.standard")
+ }),
+ new L.OSM.CycleMap({
+ attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+ code: "C",
+ keyid: "cyclemap",
+ name: I18n.t("javascripts.map.base.cycle_map")
+ }),
+ new L.OSM.TransportMap({
+ attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+ code: "T",
+ keyid: "transportmap",
+ name: I18n.t("javascripts.map.base.transport_map")
+ }),
+ new L.OSM.MapQuestOpen({
+ attribution: "Tiles courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>",
+ code: "Q",
+ keyid: "mapquest",
+ name: I18n.t("javascripts.map.base.mapquest")
+ })
+ ];
+
+ for (var i = layers.length - 1; i >= 0; i--) {
+ if (i === 0 || params.layers.indexOf(layers[i].options.code) >= 0) {
+ map.addLayer(layers[i]);
+ break;
+ }
+ }
+
+ 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();
+ });
+
+ var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright';
+
+ L.OSM.zoom({position: position})
+ .addTo(map);
+
+ L.control.locate({position: position})