I have two data sources viz, firstDataSource and secondDataSource, the firstDataSource being the one that was added to the viewer first.
I am having problem in the order of entities while adding to these datasources.
The following link has the sample example:
Steps:
1. Click "Add to secondDataSourceFirst" - This removes any existing entities from the datasources and, adds green polygon to secondDataSource first and then adds blue polygon to firstDataSource.
2. Click "Add to firstDataSourceFirst" - This removes any existing entities from the datasources and, adds blue polygon to firstDataSource first and then adds green polygon to secondDataSource.
At this point, note that entities are displayed on the map in the order of datasources added (not in the order of entities added), which means green polygon (from secondDataSource) is always at the top.
3. Click "Clear" - This removes all existing entities from the datasources.
4. Click "Add only to firstDataSource" - This removes any existing entities from firstDataSource and adds blue polygon to firstDatasource.
5. Click "Add only to secondDataSource" - This removes any existing entities from secondDataSource and adds green polygon to secondDataSource.
At this point, note that the order of entities is same as after step 2.
4. Click "Clear" again.
5. Click "Add only to secondDataSource".
6. Click "Add only to firstDataSource".
Expected: Green polygon should be at the top.
Actual: Blue polygon is at the top.
I am not sure if this is a bug in Cesium or there is something that I am missing. Any help would be really appreciated.
Thanks,
Hari