Merge pull request #683 from fkloft/controls

Fix Leaflet controls
This commit is contained in:
Jon Atkins 2013-12-04 16:21:42 -08:00
commit f2e597370e
2 changed files with 15 additions and 10 deletions

View File

@ -41,6 +41,7 @@ window.plugin.miniMap.setup = function() {
var mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', maxZoom: 18, subdomains: mqSubdomains};
var mqMap = new L.TileLayer(mqTileUrlPrefix+'/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt);
setTimeout(function() {
if(!isSmartphone()) {
// desktop mode - bottom-left, so it doesn't clash with the sidebar
new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomleft'}).addTo(window.map);
@ -48,10 +49,9 @@ window.plugin.miniMap.setup = function() {
// mobile mode - bottom-right - so it floats above the map copyright text
new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomright'}).addTo(window.map);
}
}, 0);
$('head').append('<style>@@INCLUDESTRING:external/Control.MiniMap.css@@</style>');
};
var setup = window.plugin.miniMap.setup;

View File

@ -27,6 +27,11 @@ window.plugin.zoomSlider.setup = function() {
@@INCLUDERAW:external/L.Control.Zoomslider.js@@
try { console.log('done loading Leaflet.zoomslider JS'); } catch(e) {}
// prevent Zoomslider from being activated by default (e.g. in minimap)
L.Map.mergeOptions({
zoomsliderControl: false
});
if(map.zoomControl._map) {
window.map.removeControl(map.zoomControl);
}