remove partial portal zoom level boost from code - moving complete code into a plugin
log data vs map zoom to console
This commit is contained in:
parent
24445d922b
commit
1507347acd
@ -66,6 +66,7 @@ window.requestData = function() {
|
|||||||
|
|
||||||
//we query the server as if the zoom level was this. it may not match the actual map zoom level
|
//we query the server as if the zoom level was this. it may not match the actual map zoom level
|
||||||
var z = getPortalDataZoom();
|
var z = getPortalDataZoom();
|
||||||
|
console.log('requesting tiles at zoom '+z+' (L'+getMinPortalLevelForZoom(z)+'+ portals), map zoom is '+map.getZoom());
|
||||||
|
|
||||||
var x1 = lngToTile(bounds.getWest(), z);
|
var x1 = lngToTile(bounds.getWest(), z);
|
||||||
var x2 = lngToTile(bounds.getEast(), z);
|
var x2 = lngToTile(bounds.getEast(), z);
|
||||||
|
@ -245,11 +245,7 @@ window.renderLimitReached = function(ratio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.getPortalDataZoom = function() {
|
window.getPortalDataZoom = function() {
|
||||||
var mapZoom = map.getZoom();
|
var z = map.getZoom();
|
||||||
|
|
||||||
// modify here if we want to force portal detail level zoom above the map zoom. this can increase the
|
|
||||||
// requests to the niantic servers so isn't done by default
|
|
||||||
var z = mapZoom;
|
|
||||||
|
|
||||||
// limiting the mazimum zoom level for data retrieval reduces the number of requests at high zoom levels
|
// limiting the mazimum zoom level for data retrieval reduces the number of requests at high zoom levels
|
||||||
// (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?)
|
// (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?)
|
||||||
@ -260,13 +256,6 @@ window.getPortalDataZoom = function() {
|
|||||||
// request zoom 15 tiles. however, there are quirks in the current data stream, where small fields aren't
|
// request zoom 15 tiles. however, there are quirks in the current data stream, where small fields aren't
|
||||||
// returned by the server. using larger tiles always would amplify this issue.
|
// returned by the server. using larger tiles always would amplify this issue.
|
||||||
|
|
||||||
// (this is not triggered by default, as both z and mapZoom are the same)
|
|
||||||
// if the data zoom is above the map zoom we can step back if the detail level is the same
|
|
||||||
// with the new cache code this works rather well
|
|
||||||
while (z > mapZoom && getMinPortalLevelForZoom(z) == getMinPortalLevelForZoom(z-1)) {
|
|
||||||
z = z-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//sanity check - should never happen
|
//sanity check - should never happen
|
||||||
if (z < 0) z=0;
|
if (z < 0) z=0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user