minimap plugin - move to bottom-right on mobile

This commit is contained in:
Jon Atkins 2013-06-12 05:27:07 +01:00
parent 0abb1e4128
commit e85a01b284

View File

@ -44,8 +44,13 @@ 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);
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);
} else {
// mobile mode - bottom-right - so it floats above the map copyright text
new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomright'}).addTo(window.map);
}
$('head').append('<style>@@INCLUDESTRING:external/Control.MiniMap.css@@</style>');