[user-location] update portal distance when GPS fix is available

This commit is contained in:
fkloft 2015-02-21 14:22:29 +01:00
parent d55d363112
commit e03bbf50f1

View File

@ -112,6 +112,11 @@ window.plugin.userLocation.onLocationChange = function(lat, lng) {
window.plugin.userLocation.marker.setLatLng(latlng);
window.plugin.userLocation.circle.setLatLng(latlng);
if(window.plugin.distanceToPortal) {
window.plugin.distanceToPortal.currentLoc = latlng;
window.plugin.distanceToPortal.updateDistance();
}
if(window.plugin.userLocation.follow) {
// move map if marker moves more than 35% from the center
// 100% - 2*15% = 70% → 35% from center in either direction