Fix background tile issues caused by the cache not properly updating upon load/error with D3 v6

This commit is contained in:
Quincy Morgan
2020-10-26 14:52:58 -04:00
parent 15c8e060f8
commit 792a4e8594
3 changed files with 14 additions and 6 deletions

View File

@@ -121,7 +121,7 @@ export function rendererTileLayer(context) {
});
}
function load(d) {
function load(d3_event, d) {
_cache[d[3]] = true;
d3_select(this)
.on('error', null)
@@ -130,7 +130,7 @@ export function rendererTileLayer(context) {
render(selection);
}
function error(d) {
function error(d3_event, d) {
_cache[d[3]] = false;
d3_select(this)
.on('error', null)

View File

@@ -431,7 +431,9 @@ export default {
.attr('crossorigin', 'anonymous')
.attr('href', context.asset(viewercss))
.on('load.serviceMapillary', loaded)
.on('error.serviceMapillary', reject);
.on('error.serviceMapillary', function() {
reject();
});
// load mapillary-viewerjs
head.selectAll('#ideditor-mapillary-viewerjs')
@@ -442,7 +444,9 @@ export default {
.attr('crossorigin', 'anonymous')
.attr('src', context.asset(viewerjs))
.on('load.serviceMapillary', loaded)
.on('error.serviceMapillary', reject);
.on('error.serviceMapillary', function() {
reject();
});
})
.catch(function() {
_loadViewerPromise = null;

View File

@@ -585,7 +585,9 @@ export default {
.attr('crossorigin', 'anonymous')
.attr('href', context.asset(pannellumViewerCSS))
.on('load.serviceStreetside', loaded)
.on('error.serviceStreetside', reject);
.on('error.serviceStreetside', function() {
reject();
});
// load streetside pannellum viewer js
head.selectAll('#ideditor-streetside-viewerjs')
@@ -596,7 +598,9 @@ export default {
.attr('crossorigin', 'anonymous')
.attr('src', context.asset(pannellumViewerJS))
.on('load.serviceStreetside', loaded)
.on('error.serviceStreetside', reject);
.on('error.serviceStreetside', function() {
reject();
});
})
.catch(function() {
_loadViewerPromise = null;