- if (params.box) {
- $(window).load(function() { addBoxToMap(bbox) });
- }
- } else {
- setMapCenter(new OpenLayers.LonLat(params.lon, params.lat), params.zoom);
+ 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;