Programatically select a 3D building

36 views
Skip to first unread message

martin....@googlemail.com

unread,
Feb 19, 2020, 5:50:02 AM2/19/20
to cesium-dev
On initialisation and loading of a layer which has 3D buildings I want to select one or more buildings programatically. 

Basically achieving the same result as single or double clicking a building 

Is this possible?

thanks for any help! 



Omar Shehata

unread,
Feb 19, 2020, 10:58:45 AM2/19/20
to cesium-dev
Do you have some ID for the building you want to highlight? If so, the easiest way would be to use the 3D Tiles styling language, to highlight the building:


If you want to do a post processing feature like here: https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Feature%20Picking.html

You would need some way to get access to the Cesium3DTileFeature, which would involve iterating over all the tiles in view as discussed here:


Let me know which approach works for you.

martin....@googlemail.com

unread,
Feb 20, 2020, 2:22:13 AM2/20/20
to cesium-dev
Hi 

thank you for useful links I think it might help solve my requirement. However I have no reference to a Tileset as I am using the 3dCityDB code to initialise a CitydbKmlLayer.

I can't find a way to get the tilesets.  Do you know how to to get a reference to them?

thanks again.



On Wednesday, 19 February 2020 22:58:45 UTC+7, Omar Shehata wrote:
Do you have some ID for the building you want to highlight? If so, the easiest way would be to use the 3D Tiles styling language, to highlight the building:


If you want to do a post processing feature like here: https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Feature%20Picking.html

You would need some way to get access to the Cesium3DTileFeature, which would involve iterating over all the tiles in view as discussed here:


Let me know which approach works for you.

Omar Shehata

unread,
Feb 20, 2020, 12:43:16 PM2/20/20
to cesium-dev
Have you tried uploading your CityGML buildings to Cesium ion (https://cesium.com/ion/) ? That will create a 3D Tileset of buildings. 
Reply all
Reply to author
Forward
0 new messages