Commit 230a2982 authored by Matthias Betz's avatar Matthias Betz
Browse files

changed hiding mechanism

parent 1cec716b
......@@ -44,7 +44,7 @@ const hidingListener = function(tile) {
};
function updateHideCondition(gmlId) {
conditions.unshift(['${gml_id} === "' + gmlId + '"', false]);
conditions.unshift(['${id} === "' + gmlId + '"', false]);
}
function setScale(scaleValue) {
......@@ -346,6 +346,7 @@ export default function smartVillagesPlugin(config, baseUrl) {
id: objectToHide,
loops: 0,
});
updateHideCondition(objectToHide);
}
if (objects.hiddenObjects.length > 0) {
const primitives = vcMap.getScene().primitives;
......@@ -353,10 +354,13 @@ export default function smartVillagesPlugin(config, baseUrl) {
const tileSet = primitives.get(i);
if (!(tileSet instanceof Cesium3DTileset)) {
continue;
}
tileSet.tileVisible.addEventListener(hidingListener);
}
tileSet.style = new Cesium3DTileStyle({
show: {
conditions: conditions,
},
});
}
}
}
reader.readAsText(file);
......@@ -443,21 +447,24 @@ export default function smartVillagesPlugin(config, baseUrl) {
id: 'delete',
name: 'Objekt verstecken',
callback() {
const gmlId = event.feature.getProperty("gml_id");
const gmlId = event.feature.getProperty("id");
if (gmlId !== undefined) {
updateHideCondition();
updateHideCondition(gmlId);
event.feature.tileset.style = new Cesium3DTileStyle({
show: {
conditions: conditions,
},
});
activeMap.layerCollection.requestRender();
hidingFeatures.push({
id: gmlId,
loops: 0,
});
} else {
const { activeMap } = vcsApp.maps;
activeMap.layerCollection.globalHider.addFeature("manual", event.feature);
hidingFeatures.push({
id: event.feature.featureId,
loops: 3,
loops: 0,
});
activeMap.layerCollection.globalHider.hideObjects(["manual"]);
}
......@@ -473,6 +480,17 @@ export default function smartVillagesPlugin(config, baseUrl) {
* @returns {Promise<void>}
*/
async onVcsAppMounted(vcsApp) {
for (const map of vcsApp.maps) {
console.log(map);
}
const map = vcsApp.maps.getByType("CesiumVisualisationType");
console.log(map);
// tileset.allTilesLoaded.addEventListener(function() {
// console.log('All tiles are loaded');
// });
const bimGroup = {
id: 'bim-functions',
type: ToolboxType.GROUP,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment