Hi there! I am trying to store some hierarchal data using the Entity API. I would like to use the CompositeEntityCollection so that within that I can have, lets say, 3 child EntityCollections. Each of these child EntityCollections contains a set of Entities that I am showing on the map.
To be honest, my attempt to use this hierarchy is solely because I have found that in chrome, if there are too many entities in one EntityCollection, it will crash the browser. I was hoping to avoid this by creating a new EntityCollection once I get up to x-thousand features in the previous EntityCollection.
I am using the DataSource interface to load/unload related data and so I have access to the DataSource's "entities" property. So, I tried setting the "entities" property in my DataSource object to "CompositeEntityCollection". This seems to somewhat work... However, when I have built my hierarchy and am trying to add a entity to the child EntityCollection with "getOrCreateEntity" method, all is fine except that I can not set availability. I get:
ERROR: availability is a reserved property name.
Below is some code that reproduces the issue (instead of putting in a DataSource object, I have simply used an unattached CompositeEntityCollection)
So, my questions are:
1) Can I use CompositeEntityCollection within a DataSource?
2) Is there still an issue with chrome crashing after it loads x-thousand Entities (because of how it does hash-maps?
3) Can you set avialability on an entity created with getOrCreateEntity within an EntityCollection that is a child of a CompositeEntityCollection?
SAMPLE CODE:
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProviderViewModels : , //Disable terrain changing
infoBox : false, //Disable InfoBox widget
selectionIndicator : false //Disable selection indicator
});
//Set bounds of our simulation time
var start = Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16));
var stop = Cesium.JulianDate.addSeconds(start, 360, new Cesium.JulianDate());
var compEnts = new Cesium.CompositeEntityCollection();
var entCol = new Cesium.EntityCollection();
compEnts.addCollection(entCol,0);
var av =new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
start : start,
stop : stop
})]);
//Actually create the entity
var entity = entCol.getOrCreateEntity("boo");
entity.availability = av;