limit zoom level on 'locate' function on mobile - otherwise you can end up *way* too close with maps supporting high zoom levels (e.g. bing, nokia ovi)
This commit is contained in:
parent
e536fb6d12
commit
4828fd3fba
@ -79,6 +79,11 @@ window.plugin.userLocation.locate = function(lat, lng, accuracy) {
|
|||||||
var zoom = window.map.getBoundsZoom(L.latLngBounds(
|
var zoom = window.map.getBoundsZoom(L.latLngBounds(
|
||||||
[lat - latAccuracy, lng - lngAccuracy],
|
[lat - latAccuracy, lng - lngAccuracy],
|
||||||
[lat + latAccuracy, lng + lngAccuracy]));
|
[lat + latAccuracy, lng + lngAccuracy]));
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
window.map.setView(latlng, zoom);
|
window.map.setView(latlng, zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user