@CSettle2021
I apologize for the delayed response - it took me some time to delve into your code. There were a few sections that I did not understand. For instance, the function Cesium3DTileFeature
set this._content
and this._batchId
to values that are undefined
.
function Cesium3DTileFeature(tile, batchID) { //(content, batchId)
this._content = content;
this._batchId = batchId;
}
In addition, the mouse over functionality did not seem to work.
var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function(result) {
var feature = viewer.scene.pick(result.position);
if (feature instanceof Cesium.Cesium3DTileFeature) {
var propertyNames = feature.getPropertyNames();
var length = propertyNames.length;
for (var i = 0; i < length; ++i) {
var propertyName = propertyNames[i];
console.log(propertyName + ': ' + feature.getProperty(propertyName));
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
Thus, I was not able to view details about the assets that you are using. What was the objective here?
Due to these sources of confusion, I decided to start mostly from scratch. Given your use case, I think using a Billboard
might be your best bet. This will allow you to spot the asset that you are interested in from a distance. It also helps distinguish your asset from the Cesium OSM Buildings. Moreover, you can add a properties box when the billboard is selected. This is why I ended up using it for my implementation. Here is some more information on the Billboard
object:
https://cesium.com/learn/cesiumjs/ref-doc/Billboard.html?classFilter=billb
As you can see, billboards are highly customizable. This should lend well to your application. I suggest that you customize the billboard image, textbox styling, size, etc to meet your needs. I modified the sandcastle demo that you sent me, so you should be able to see the asset that you uploaded as well as the Cesium OSM Buildings. There is also a basic implementation of making a properties box for a billboard. Here is the new demo:
Here are a few screengrabs from the sandcastle demo. As you can see here, the billboard will always face the Camera
. Thus, viewers will always know where to find the building that you have imported from Cesium ion.
The following screengrab showcases the textbox functionality. Feel free to add more information here.
You can also select the camera icon in the textbox. This will center the asset in the viewer. Feel free to customize this functionality as well. I hope this helps! Let me know if you have any other questions or concerns.
-Sam