Cesium JS tileset parts or any other 3D object multiple selection function

31 views
Skip to first unread message

mackevi...@gmail.com

unread,
Aug 4, 2019, 6:09:25 AM8/4/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
We have object picking example but I would like it to be able selecting multiple objects. Is it possible?




Omar Shehata

unread,
Aug 6, 2019, 1:01:05 PM8/6/19
to cesium-dev
You're in complete control of that logic in your application. Notice that this example clears all previously selected buildings on click. You can change this logic, so comment out line 93:

//silhouetteGreen.selected = [];

And then change line 114 to add onto the array instead of replacing it:

silhouetteGreen.selected.push(pickedFeature);

And that will allow you to select multiple buildings. You can also change the UI to loop over all the selected buildings to display their names/properties instead of just the last selected one. Hope this helps! What kind of application are you working on?

mackevi...@gmail.com

unread,
Aug 7, 2019, 5:38:17 PM8/7/19
to cesium-dev
Oh huge thanks OMAR!!!!

2019 m. rugpjūtis 6 d., antradienis 19:01:05 UTC+2, Omar Shehata rašė:
You're in complete control of that logic in your application. Notice that this example clears all previously selected buildings on click. You can change this logic, so comment out line 93:

//silhouetteGreen.selected = [];

And then change line 114 to add onto the array instead of replacing it:

silhouetteGreen.selected.push(pickedFeature);

And that will allow you to select multiple buildings. You can also change the UI to loop over all the selected buildings to display their names/properties instead of just the last selected one. Hope this helps! What kind of application are you working on?

Reply all
Reply to author
Forward
0 new messages