added persistent zoom level option ( see https://plus.google.com/112875802603603993788/posts/K5zLYyAWQkE )
This commit is contained in:
@ -75,7 +75,7 @@ window.plugin.userLocation.onZoomEnd = function() {
|
||||
}
|
||||
};
|
||||
|
||||
window.plugin.userLocation.locate = function(lat, lng, accuracy) {
|
||||
window.plugin.userLocation.locate = function(lat, lng, accuracy, persistentZoom) {
|
||||
if(window.plugin.userLocation.follow) {
|
||||
window.plugin.userLocation.follow = false;
|
||||
if(typeof android !== 'undefined' && android && android.setFollowMode)
|
||||
@ -94,7 +94,7 @@ window.plugin.userLocation.locate = function(lat, lng, accuracy) {
|
||||
|
||||
// an extremely close view is pretty pointless (especially with maps that support zoom level 20+)
|
||||
// so limit to 17 (enough to see all portals)
|
||||
zoom = Math.min(zoom,17);
|
||||
zoom = (persistentZoom) ? map.getZoom() : Math.min(zoom,17);
|
||||
|
||||
if(window.map.getCenter().distanceTo(latlng) < 10) {
|
||||
window.plugin.userLocation.follow = true;
|
||||
|
Reference in New Issue
Block a user