Restore attribution on main map
authorJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 10 Jun 2013 20:55:27 +0000 (13:55 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:36:08 +0000 (10:36 -0700)
app/assets/javascripts/index.js
app/assets/javascripts/map.js.erb

index e4dbb84d02b141d0ff15eee918f040b96c09a292..3edfaeeaf867e7f96b4105d80a89d3a23f97edcd 100644 (file)
@@ -12,13 +12,13 @@ $(document).ready(function () {
   var params = OSM.mapParams();
 
   map = L.map("map", {
-    attributionControl: false,
     zoomControl: false,
     layerControl: false
   });
 
-  layers = mapLayers();
+  map.attributionControl.setPrefix('');
 
+  layers = mapLayers();
   layers[0].layer.addTo(map);
 
   $("#map").on("resized", function () {
index 323d16378479ff78adb0d3cb1043ffc89c8a8b4a..a7e9f6f5040b549f966e67ab5215b10ad636ae0a 100644 (file)
@@ -17,27 +17,29 @@ var objectLoader;
 
 function mapLayers() {
   return [{
-    layer: new L.OSM.Mapnik(),
+    layer: new L.OSM.Mapnik({
+      attribution: ''
+    }),
     keyid: "mapnik",
     layerCode: "M",
     name: I18n.t("javascripts.map.base.standard")
   }, {
     layer: new L.OSM.CycleMap( {
-        attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+      attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
     }),
     keyid: "cyclemap",
     layerCode: "C",
     name: I18n.t("javascripts.map.base.cycle_map")
   }, {
     layer: new L.OSM.TransportMap({
-        attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+      attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
     }),
     keyid: "transportmap",
     layerCode: "T",
     name: I18n.t("javascripts.map.base.transport_map")
   }, {
     layer: 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'>",
+      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'>",
     }),
     keyid: "mapquest",
     layerCode: "Q",