Merge branch 'vegbilder' of github.com:noenandre/iD into vegbilder

This commit is contained in:
Martin Raifer
2023-08-01 17:05:29 +02:00
2 changed files with 13 additions and 15 deletions

View File

@@ -118,7 +118,7 @@ export default {
if ( !(key in _currScenes) ) {
let newSceneOptions = {
showFullscreenCtrl: false,
autoLoad: true,
autoLoad: false,
compass: true,
yaw: 0,
type: 'equirectangular',

View File

@@ -307,16 +307,13 @@ function searchLimited(limit, projection, rtree) {
export default {
init: async function () {
this.event = utilRebind(this, dispatch, 'on');
if (!_vegbilderCache) {
await this.reset();
}
this.event = utilRebind(this, dispatch, 'on');
},
reset: async function () {
const availableLayers = await fetchAvailableLayers();
if (_vegbilderCache) {
for (const layer of _vegbilderCache.wfslayers.values()) {
for (const controller of layer.inflight.values()) {
@@ -325,7 +322,16 @@ export default {
}
}
const wfslayers = availableLayers.reduce((wfslayers, layerInfo) => {
_vegbilderCache = {
wfslayers: new Map(),
rtree: new RBush(),
image2sequence_map: new Map()
};
const availableLayers = await fetchAvailableLayers();
const {wfslayers} = _vegbilderCache;
for (const layerInfo of availableLayers) {
const cache = {
layerInfo,
loaded: new Map(),
@@ -334,17 +340,9 @@ export default {
sequences: []
};
wfslayers.set(layerInfo.name, cache);
return wfslayers;
}, new Map());
_vegbilderCache = {
wfslayers,
rtree: new RBush(),
image2sequence_map: new Map()
};
}
},
images: function (projection) {
const limit = 5;
return searchLimited(limit, projection, _vegbilderCache.rtree);