+
+ var map = L.map("map", {
+ zoomControl: false,
+ layerControl: false
+ });
+
+ map.attributionControl.setPrefix('');
+
+ 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")
+ })
+ ];
+
+ layers[0].addTo(map);
+
+ map.noteLayer = new L.LayerGroup({code: 'N'});
+ map.dataLayer = new L.OSM.DataLayer(null);
+
+ $("#map").on("resized", function () {
+ map.invalidateSize();
+ });
+
+ L.OSM.zoom({position: 'topright'})
+ .addTo(map);
+
+ L.control.locate({position: 'topright'})
+ .addTo(map);
+
+ var sidebar = L.OSM.sidebar('#map-ui');
+
+ L.OSM.layers({
+ position: 'topright',
+ layers: layers,
+ sidebar: sidebar
+ }).addTo(map);
+
+ L.OSM.key({
+ position: 'topright',
+ sidebar: sidebar
+ }).addTo(map);
+
+ L.OSM.share({
+ getShortUrl: getShortUrl,
+ getUrl: getUrl,
+ sidebar: sidebar,
+ short: true
+ }).addTo(map);
+
+ L.OSM.note({
+ position: 'topright',
+ sidebar: sidebar
+ }).addTo(map);
+
+ L.control.scale()
+ .addTo(map);
+
+ map.on('moveend layeradd layerremove', updateLocation);
+
+ map.markerLayer = L.layerGroup().addTo(map);