Click event on polylines from GeoJSON file

I've scoured the docs and examples but can't get this to work. I have a geoJSON file that has a featureCollection:

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "Name": "Sample name", "Description": "Sample description" }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -121.679276, 48.920131, 926.9 ], [ -121.677559, 48.932763, 1010.5 ], [ -121.664513, 48.939528, 1021.7 ], [ -121.654041, 48.944715, 1190.1 ], [ -121.645458, 48.944151, 1219.9 ], [ -121.641853, 48.948886, 1581.4 ], [ -121.643398, 48.951817, 1736.4 ], [ -121.643742, 48.956552, 1942.0 ], [ -121.645115, 48.96106, 1837.6 ], [ -121.646317, 48.967259, 1835.0 ], [ -121.642712, 48.971316, 1881.6 ], [ -121.640995, 48.974471, 2058.3 ], [ -121.648205, 48.97909, 2391.1 ] ] ] } },
[... additional content truncated ...]

Currently I have it displaying on my map and when you click a polyline you get the Cesium UI widget that shows the properties for the line. What I would like is to be able to show some custom UI when you click on one of the lines. But I can't seem to figure out how to listen clicks on these polylines since they were added via Cesium.GeoJsonDataSource.

Thanks for you help!

Bobby

If you want to customize the data shown in the built-in Cesium Info Box, you can add a “description” GeoJSON property to your features (note that it expects lowercase “description”, not “Description” as in your example. not sure if there’s a convention for property names)

If you want to display your own independent UI, you could consider checking the “selectedEntity” property on Viewer. (this property is added by “viewerEntityMixin” which I assume you’re already using)

You can also subscribe to changes to that observable property:

Cesium.knockout.getObservable(viewer, ‘selectedEntity’).subscribe(function(entity) {

if (entity !== undefined) {

console.log(entity.id);

}

});

Great, thanks Scott!