@giro3d/giro3d
Version:
A JS/WebGL framework for 3D geospatial data visualization
32 lines (31 loc) • 1.34 kB
JavaScript
/*
* Copyright (c) 2015-2018, IGN France.
* Copyright (c) 2018-2026, Giro3D team.
* SPDX-License-Identifier: MIT
*/
import EntityInspector from './EntityInspector';
export default class ImageCollectionInspector extends EntityInspector {
constructor(parentGui, instance, imageCollection) {
super(parentGui, instance, imageCollection, {
boundingBoxColor: false,
boundingBoxes: false,
opacity: true,
visibility: true
});
const notify = () => this.notify();
const imagesCount = imageCollection.source.images.length;
const params = {
projectionDistance: imagesCount > 0 ? imageCollection.getImageProjectionDistance(0) : 0
};
this.addController(imageCollection, 'showLocationSpheres').name('Show location spheres').onChange(notify);
this.addController(imageCollection, 'showWireframes').name('Show view wireframes').onChange(notify);
this.addController(imageCollection, 'showImages').name('Show images').onChange(notify);
this.addController(imageCollection, 'imageOpacity', 0, 1, 0.01).name('Images opacity').onChange(notify);
this.addController(params, 'projectionDistance', 0, 1000, 1).onChange(() => {
for (let i = 0; i < imagesCount; i++) {
imageCollection.setImageProjectionDistance(i, params.projectionDistance);
}
notify();
});
}
}