managing kml entities with html checkboxes

I've thousands of kml datasources created by Google earth and these are associated with related checkbox html control.

I've no idea how managing single or multiple datasources and show or delete.

Until now i'm able to add Entities by cesiumviewer.dataSources.add() as I see in Docs.

Yes a possible solution is a html optiongroup in order to switch on any single or grouped Collection of entities, but is not my case.


Hi there,

This example is very similar to what you want! Just replace the Cesium buttons with an checkbox.

Hope that helps,

  • Rachel

Ahhh that's good Thanks!!

exclamation mark the negation operand and the entity accessing the show property... Maybe the only solution. Thumb up.
Ok i'm going to modify this.

Bad news...
below the code focuses:

<input type="checkbox" onclick=" if (this.checked) {
      var campi_detriti=new Cesium.Entity(sorgente_dati_campi_detriti);
  } ">campi caduta detriti

Maybe could be useful to inspect and fully manage any entity...

In the example on Sandcastle each entity is created by hand, there's not Datasources... Mah...

Hi Andrea,

You can actually just toggle visiblity for an entire datasource’s entity collection using = false and = true`. If you attach that code to html checkboxes, it should do what you need.

Hope that helps,

  • Rachel