mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-19 17:43:39 +00:00
Merge branch 'vegbilder' of github.com:noenandre/iD into vegbilder
This commit is contained in:
@@ -118,7 +118,7 @@ export default {
|
||||
if ( !(key in _currScenes) ) {
|
||||
let newSceneOptions = {
|
||||
showFullscreenCtrl: false,
|
||||
autoLoad: true,
|
||||
autoLoad: false,
|
||||
compass: true,
|
||||
yaw: 0,
|
||||
type: 'equirectangular',
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user