GeoJsonDataSource & CZML loading bug
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
The below Sandcastle example doesn't work as expected. Whichever button you hit first causes the second button to not load it's data correctly. This is due to the way entity event caching works and the fact that both objects have the same identifier. Reported on [stack overflow](http://stackoverflow.com/questions/31426796/loading-updated-data-with-geojsondatasource-in-cesium-js).
``` javascript
var viewer = new Cesium.Viewer('cesiumContainer');
var source = new Cesium.GeoJsonDataSource("name123");
viewer.dataSources.add(source);
Sandcastle.addToolbarButton('Load 1', function(){
source.load({
type: "FeatureCollection",
crs: {
type: "name",
properties: {
name: "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
features: [{
type: "Feature",
properties: {
foo: 123
},
geometry: {
type: "Point",
coordinates: [0.1275, 51.5072] // London
},
id: "123"
}]
});
});
Sandcastle.addToolbarButton('Load 2', function() {
source.load({
type: "FeatureCollection",
crs: {
type: "name",
properties: {
name: "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
features: [{
type: "Feature",
properties: {
foo: 456
},
geometry: {
type: "Point",
coordinates: [-75.1890, 42.3482] // New York
},
id: "123"
}]
});
});
```
Contributor guide
Research direction
Start with the Sandcastle reproduction in the issue and inspect GeoJsonDataSource.load alongside the entity event caching behavior. Verify both buttons after either load order, and consider the work complete when each load displays its own data correctly despite the shared identifier.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100