clamp bounds used for map data requests. no point in trying to request data outside +-90, +-180 coordinates, as it's pointless, and the server returns an error code anyway
This commit is contained in:
parent
339c7ec21e
commit
e4ad933bb2
@ -12,12 +12,12 @@ window.requestData = function() {
|
||||
requests.abort();
|
||||
cleanUp();
|
||||
|
||||
var bounds = map.getBounds();
|
||||
var bounds = clampLatLngBounds(map.getBounds());
|
||||
|
||||
var x1 = lngToTile(bounds.getNorthWest().lng, map.getZoom());
|
||||
var x2 = lngToTile(bounds.getNorthEast().lng, map.getZoom());
|
||||
var y1 = latToTile(bounds.getNorthWest().lat, map.getZoom());
|
||||
var y2 = latToTile(bounds.getSouthWest().lat, map.getZoom());
|
||||
var x1 = lngToTile(bounds.getWest(), map.getZoom());
|
||||
var x2 = lngToTile(bounds.getEast(), map.getZoom());
|
||||
var y1 = latToTile(bounds.getNorth(), map.getZoom());
|
||||
var y2 = latToTile(bounds.getSouth(), map.getZoom());
|
||||
|
||||
// will group requests by second-last quad-key quadrant
|
||||
tiles = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user