Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Backport. limit wait time for baselayer (#14047) #14283

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/core_plugins/tile_map/public/maps_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,28 @@ export function MapsVisualizationProvider(serviceSettings, Notifier, getAppState
};
}

_doRenderComplete(resolve) {
if (this._baseLayerDirty) {//as long as the baselayer is dirty, we cannot fire the render complete event
setTimeout(() => {
this._doRenderComplete(resolve);
}, 10);
_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();
}
} else {
resolve();
}
}

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

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