Leaflet 1.0: revert touch style in desktop browsers, fixes #69
This commit is contained in:
parent
6c316c8688
commit
cd6c1bdc54
3 changed files with 34 additions and 0 deletions
|
|
@ -8,6 +8,14 @@
|
|||
|
||||
var mapContext;
|
||||
|
||||
function verifyTouchStyle(mapContext) {
|
||||
// revert touch style (large icons) when touch screen detection is available and negative
|
||||
// see https://github.com/nrenner/brouter-web/issues/69
|
||||
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) {
|
||||
L.DomUtil.removeClass(mapContext.map.getContainer(), 'leaflet-touch');
|
||||
}
|
||||
}
|
||||
|
||||
function initApp(mapContext) {
|
||||
var map = mapContext.map,
|
||||
layersControl = mapContext.layersControl,
|
||||
|
|
@ -340,6 +348,7 @@
|
|||
}
|
||||
|
||||
mapContext = BR.Map.initMap();
|
||||
verifyTouchStyle(mapContext);
|
||||
initApp(mapContext);
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue