moved scale bar to the bottom right on mobile. ATM the bottom right corner is used for nothing so it shouldn't clash with any other plugin
This commit is contained in:
@ -27,8 +27,8 @@ window.plugin.scaleBar.setup = function() {
|
|||||||
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
|
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
|
||||||
// system already.
|
// system already.
|
||||||
if (window.isSmartphone()) {
|
if (window.isSmartphone()) {
|
||||||
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; margin-bottom: 20px !important; } </style>');
|
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; right: 0px; margin-bottom: 20px !important; } </style>');
|
||||||
window.map.addControl(new L.Control.Scale({position: 'bottomleft', imperial: false, maxWidth: 100}));
|
window.map.addControl(new L.Control.Scale({position: 'bottomright', imperial: false, maxWidth: 100}));
|
||||||
} else {
|
} else {
|
||||||
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
|
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
|
||||||
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200}));
|
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200}));
|
||||||
|
Reference in New Issue
Block a user