Add back basic zoom control
authorJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 10 Jun 2013 18:15:58 +0000 (11:15 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:31:19 +0000 (10:31 -0700)
app/assets/javascripts/index.js
app/assets/javascripts/index/map_ui.js
app/assets/stylesheets/large.css
app/assets/stylesheets/map-ui.css.scss

index 82b6d03b8dbaaf3208095d42bbe45c3b222ece75..760c95230caa2803c05ad5e31f30f9b7bfecb9a3 100644 (file)
@@ -10,11 +10,15 @@ $(document).ready(function () {
   var marker;
   var params = OSM.mapParams();
   var map = createMap("map", {
+    zoomControl: false,
     layerControl: false
   }, {
     locateControl: true
   });
 
+  L.control.zoom({position: 'topright'})
+    .addTo(map);
+
   OSM.mapUI().addTo(map);
 
   L.control.scale().addTo(map);
index 0f13adcff3ab4c928e7fb08801455c7d170e7d3c..1360c702474ac3ed40ca88f75f54e9d6ca39946a 100644 (file)
@@ -23,14 +23,16 @@ OSM.MapUI = L.Control.extend({
         e.stopPropagation();
         e.preventDefault();
 
+        var controlContainer = $('.leaflet-control-container .leaflet-top.leaflet-right');
+
         if ($(this._uiPane).is(':visible')) {
             $(this._uiPane).hide();
-            $(this._container).css({paddingRight: '0'})
+            controlContainer.css({paddingRight: '0'})
         } else {
             $(this._uiPane)
                 .show()
                 .html(JST["templates/map/layers"]());
-            $(this._container).css({paddingRight: '200px'})
+            controlContainer.css({paddingRight: '200px'})
         }
     }
 });
index cf7c0c2023cc4c3edebcb679ff4d354715b4e66d..050272b773726e60f32f21844c270f93b28e7819 100644 (file)
@@ -1,7 +1 @@
 /* Styles specific to large screens  */
-
-/* Rules for OpenLayers maps */
-
-.leaflet-control-zoom {
-  display: none;
-}
index f1b81ac38b130c5a4b6437d05dbeccd49c381636..f9db835171298d875a67d559c584d3c597624628 100644 (file)
@@ -1,3 +1,7 @@
+.leaflet-control-zoom {
+  margin-bottom: 10px;
+}
+
 .leaflet-map-ui-layers {
   box-shadow: 0 1px 7px rgba(0, 0, 0, 0.4);
   background: #f8f8f9;