Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lgl
SmartVillages2
Commits
230a2982
Commit
230a2982
authored
Jul 15, 2025
by
Matthias Betz
Browse files
changed hiding mechanism
parent
1cec716b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
230a2982
...
@@ -44,7 +44,7 @@ const hidingListener = function(tile) {
...
@@ -44,7 +44,7 @@ const hidingListener = function(tile) {
};
};
function
updateHideCondition
(
gmlId
)
{
function
updateHideCondition
(
gmlId
)
{
conditions
.
unshift
([
'
${
gml_
id} === "
'
+
gmlId
+
'
"
'
,
false
]);
conditions
.
unshift
([
'
${id} === "
'
+
gmlId
+
'
"
'
,
false
]);
}
}
function
setScale
(
scaleValue
)
{
function
setScale
(
scaleValue
)
{
...
@@ -346,6 +346,7 @@ export default function smartVillagesPlugin(config, baseUrl) {
...
@@ -346,6 +346,7 @@ export default function smartVillagesPlugin(config, baseUrl) {
id
:
objectToHide
,
id
:
objectToHide
,
loops
:
0
,
loops
:
0
,
});
});
updateHideCondition
(
objectToHide
);
}
}
if
(
objects
.
hiddenObjects
.
length
>
0
)
{
if
(
objects
.
hiddenObjects
.
length
>
0
)
{
const
primitives
=
vcMap
.
getScene
().
primitives
;
const
primitives
=
vcMap
.
getScene
().
primitives
;
...
@@ -353,10 +354,13 @@ export default function smartVillagesPlugin(config, baseUrl) {
...
@@ -353,10 +354,13 @@ export default function smartVillagesPlugin(config, baseUrl) {
const
tileSet
=
primitives
.
get
(
i
);
const
tileSet
=
primitives
.
get
(
i
);
if
(
!
(
tileSet
instanceof
Cesium3DTileset
))
{
if
(
!
(
tileSet
instanceof
Cesium3DTileset
))
{
continue
;
continue
;
}
}
tileSet
.
tileVisible
.
addEventListener
(
hidingListener
);
tileSet
.
style
=
new
Cesium3DTileStyle
({
show
:
{
conditions
:
conditions
,
},
});
}
}
}
}
}
}
reader
.
readAsText
(
file
);
reader
.
readAsText
(
file
);
...
@@ -443,21 +447,24 @@ export default function smartVillagesPlugin(config, baseUrl) {
...
@@ -443,21 +447,24 @@ export default function smartVillagesPlugin(config, baseUrl) {
id
:
'
delete
'
,
id
:
'
delete
'
,
name
:
'
Objekt verstecken
'
,
name
:
'
Objekt verstecken
'
,
callback
()
{
callback
()
{
const
gmlId
=
event
.
feature
.
getProperty
(
"
gml_
id
"
);
const
gmlId
=
event
.
feature
.
getProperty
(
"
id
"
);
if
(
gmlId
!==
undefined
)
{
if
(
gmlId
!==
undefined
)
{
updateHideCondition
();
updateHideCondition
(
gmlId
);
event
.
feature
.
tileset
.
style
=
new
Cesium3DTileStyle
({
event
.
feature
.
tileset
.
style
=
new
Cesium3DTileStyle
({
show
:
{
show
:
{
conditions
:
conditions
,
conditions
:
conditions
,
},
},
});
});
activeMap
.
layerCollection
.
requestRender
();
hidingFeatures
.
push
({
id
:
gmlId
,
loops
:
0
,
});
}
else
{
}
else
{
const
{
activeMap
}
=
vcsApp
.
maps
;
const
{
activeMap
}
=
vcsApp
.
maps
;
activeMap
.
layerCollection
.
globalHider
.
addFeature
(
"
manual
"
,
event
.
feature
);
activeMap
.
layerCollection
.
globalHider
.
addFeature
(
"
manual
"
,
event
.
feature
);
hidingFeatures
.
push
({
hidingFeatures
.
push
({
id
:
event
.
feature
.
featureId
,
id
:
event
.
feature
.
featureId
,
loops
:
3
,
loops
:
0
,
});
});
activeMap
.
layerCollection
.
globalHider
.
hideObjects
([
"
manual
"
]);
activeMap
.
layerCollection
.
globalHider
.
hideObjects
([
"
manual
"
]);
}
}
...
@@ -473,6 +480,17 @@ export default function smartVillagesPlugin(config, baseUrl) {
...
@@ -473,6 +480,17 @@ export default function smartVillagesPlugin(config, baseUrl) {
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
onVcsAppMounted
(
vcsApp
)
{
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
=
{
const
bimGroup
=
{
id
:
'
bim-functions
'
,
id
:
'
bim-functions
'
,
type
:
ToolboxType
.
GROUP
,
type
:
ToolboxType
.
GROUP
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment