limit portals drawn to the map in dense areas, to avoid slowing down leaflet too much
unfortunately, this wasn't as much of a speed boost as i'd hoped. just downloading/processing the data for 20,000+ portals from the server, even if only 2000 are displayed, still takes a LONG time for #526
This commit is contained in:
@ -147,6 +147,7 @@ window.MapDataRequest.prototype.refresh = function() {
|
||||
this.render.startRenderPass();
|
||||
this.render.clearPortalsBelowLevel(minPortalLevel);
|
||||
|
||||
|
||||
// calculate the full bounds for the data - including the part of the tiles off the screen edge
|
||||
var dataBounds = L.latLngBounds([
|
||||
[tileToLat(y2+1,zoom), tileToLng(x1,zoom)],
|
||||
@ -156,6 +157,9 @@ window.MapDataRequest.prototype.refresh = function() {
|
||||
//setTimeout (function(){ map.removeLayer(debugrect2); }, 10*1000);
|
||||
this.render.clearEntitiesOutsideBounds(dataBounds);
|
||||
|
||||
this.render.resetPortalClusters();
|
||||
|
||||
|
||||
console.log('requesting data tiles at zoom '+zoom+' (L'+minPortalLevel+'+ portals), map zoom is '+map.getZoom());
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user