From b5ffcb5448d42e5a2f248ee9b39a67212cd58e50 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 30 Dec 2013 17:44:42 +0100 Subject: [PATCH] don't leave follow mode on mapmove for a variable zoom the user may want to use different zooms in follow mode (for example if he rides a bike or drives a car)...unfortunately, leaflet triggers maps movestart event _before_ the zoomstart event. this makes it impossible to differentiate between a mapmove triggered by a zoom-event or a move-event. the user can leave the follow mode by pressing the getLocation button...this should be enough. --- mobile/plugins/user-location.user.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mobile/plugins/user-location.user.js b/mobile/plugins/user-location.user.js index d4523322..11ddae14 100644 --- a/mobile/plugins/user-location.user.js +++ b/mobile/plugins/user-location.user.js @@ -60,20 +60,10 @@ window.plugin.userLocation.setup = function() { window.plugin.userLocation.circle = circle; window.plugin.userLocation.icon = icon; - window.map.on('movestart', window.plugin.userLocation.onMoveStart); window.map.on('zoomend', window.plugin.userLocation.onZoomEnd); window.plugin.userLocation.onZoomEnd(); }; -window.plugin.userLocation.onMoveStart = function(e) { - if(window.plugin.userLocation.moving) - return; - - window.plugin.userLocation.follow = false; - if(typeof android !== 'undefined' && android && android.setFollowMode) - android.setFollowMode(window.plugin.userLocation.follow); -}; - window.plugin.userLocation.onZoomEnd = function() { if(window.map.getZoom() < 16) window.plugin.userLocation.locationLayer.removeLayer(window.plugin.userLocation.circle); @@ -122,9 +112,7 @@ window.plugin.userLocation.onLocationChange = function(lat, lng) { if(map.getBounds().pad(-0.15).contains(latlng)) return; - window.plugin.userLocation.moving = true; window.map.setView(latlng); - window.plugin.userLocation.moving = false; } };