Skip to content

Commit

Permalink
draw-tools: decrease number of Leaflet.draw touch bugs workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe committed May 9, 2019
1 parent 22f787c commit b791a71
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions plugins/draw-tools.user.js
Expand Up @@ -582,22 +582,10 @@ window.plugin.drawTools.snapToPortals = function() {
window.plugin.drawTools.save();
}

window.plugin.drawTools.drawstart = function (e) {
var mouseActive = L.Browser.touch && matchMedia('(hover:hover)').matches; // workaround for https://github.com/IITC-CE/ingress-intel-total-conversion/issues/162
if (mouseActive || e.layerType === 'circle' || e.layerType === 'rectangle') {
e.target.touchExtend.enable()
} else {
e.target.touchExtend.disable()
};
}

window.plugin.drawTools.boot = function() {
// workaround for https://github.com/Leaflet/Leaflet.draw/issues/923
map.addHandler('touchExtend', L.Map.TouchExtend);

// trying to circumvent touch bugs: https://github.com/Leaflet/Leaflet.draw/issues/789
map.on('draw:drawstart', plugin.drawTools.drawstart);

// add a custom hook for draw tools to share it's activity with other plugins
pluginCreateHook('pluginDrawTools');

Expand Down

0 comments on commit b791a71

Please sign in to comment.