Skip to content

Commit

Permalink
Revert "limit wait time for baselayer (elastic#14047)"
Browse files Browse the repository at this point in the history
This reverts commit 44a7107.
  • Loading branch information
chrisronline committed Oct 4, 2017
1 parent aa568db commit c29f8a9
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/core_plugins/tile_map/public/maps_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,28 +255,16 @@ export function MapsVisualizationProvider(serviceSettings, Notifier, getAppState
};
}

_doRenderCompleteWhenBaseLayerIsLoaded(resolve, endTime) {
if (this._baseLayerDirty) {
if (Date.now() <= endTime) {
setTimeout(() => {
this._doRenderCompleteWhenBaseLayerIsLoaded(resolve, endTime);
}, 10);
} else {
//wait time exceeded. If the baselayer cannot load, we will still fire a render-complete.
//This is because slow or unstable network connections cause tiles to get dropped.
//It is unfortunate that tiles get dropped, but we should not drop the render-complete because of it.
resolve();
}
_doRenderComplete(resolve) {
if (this._baseLayerDirty) {//as long as the baselayer is dirty, we cannot fire the render complete event
setTimeout(() => {
this._doRenderComplete(resolve);
}, 10);
} else {
resolve();
}
}

_doRenderComplete(resolve) {
const msAllowedForBaseLayerToLoad = 10000;
this._doRenderCompleteWhenBaseLayerIsLoaded(resolve, Date.now() + msAllowedForBaseLayerToLoad);
}

addSpatialFilter(agg, filterName, filterData) {
if (!agg) {
return;
Expand Down

0 comments on commit c29f8a9

Please sign in to comment.