I changed the Id of the 3dtile layer into the example of 3D Tile Feature Picking but got an error and didn’t show the highlight as shown below, I tried the console variable pickedFeature the result is as follows:
Hi @Yen_Woody
That particular Sandcastle is created specifically with that NYC buildings tileset in mind. If you use another asset, it may not have the same metadata and that may be the cause of the crash. Would you be able to share a complete Sandcastle with your particular asset? I cannot access the asset shown in your screenshot because it does not have the correct access token associated with it. Based on the console output, it does seem like the tileset is being picked correctly.
I’m Sorry , this is my sample code: Cesium Sandcastle
upppp
@Yen_Woody Does your tileset have any features? From a quick look, it seems like the featuresLength
in the batch table is 0
, indicating that there are none in the primitives being picked.
i tried using another 3dtile id and it still shows the highlight normally, the 3dtile layer in the example is still showing but not highlighting, it’s strange @ sanjeetsuhag
i found the way to do it
if (pickedFeature.content instanceof Cesium.Batched3DModel3DTileContent) {
console.log(pickedFeature);
silhouetteGreen.selected = [pickedFeature.content._model];
}