From 0c2d538aa7394b3d040cbe40cc6b3f5d26de4850 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 22 Nov 2012 12:54:37 +0000 Subject: [PATCH] Use the small zoom control in the small screen layout --- app/assets/javascripts/map.js.erb | 2 +- app/assets/stylesheets/common.css.scss | 9 +++++++++ app/assets/stylesheets/large.css | 6 ++++++ app/assets/stylesheets/small.css.scss | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/map.js.erb b/app/assets/javascripts/map.js.erb index 00aec6484..393e9cae7 100644 --- a/app/assets/javascripts/map.js.erb +++ b/app/assets/javascripts/map.js.erb @@ -78,7 +78,7 @@ var layers = [ ]; function createMap(divName, options) { - options = $.extend({zoomControl: false, panZoomControl: true, layerControl: true}, options); + options = $.extend({zoomControl: true, panZoomControl: true, layerControl: true}, options); map = L.map(divName, $.extend({}, options, {panControl: false, zoomsliderControl: false, maxZoom: 18})); diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index c0796bdad..d3d644801 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1005,6 +1005,15 @@ p#contributorGuidance { /* Rules for the user map */ +.user_map .leaflet-control-pan, +.user_map .leaflet-control-zoomslider { + display: none; +} + +.user_map .leaflet-control-zoom { + display: block; +} + /* Rules for user popups on maps */ .user_popup { diff --git a/app/assets/stylesheets/large.css b/app/assets/stylesheets/large.css index a24a55813..5ffaee985 100644 --- a/app/assets/stylesheets/large.css +++ b/app/assets/stylesheets/large.css @@ -5,3 +5,9 @@ #small-greeting { display: none; } + +/* Rules for OpenLayers maps */ + +.leaflet-control-zoom { + display: none; +} diff --git a/app/assets/stylesheets/small.css.scss b/app/assets/stylesheets/small.css.scss index 19b4e6b89..d7600a0d6 100644 --- a/app/assets/stylesheets/small.css.scss +++ b/app/assets/stylesheets/small.css.scss @@ -92,6 +92,10 @@ h1 { border: 0; } +.leaflet-control-pan, .leaflet-control-zoomslider { + display: none; +} + .site-index .leaflet-top .leaflet-control, .site-export .leaflet-top .leaflet-control { margin-top: 10px !important; -- 2.45.1