var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
stroke: Cesium.Color.HOTPINK,
fill: Cesium.Color.PINK,
strokeWidth: 3,
markerSymbol: '?'
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0.30000000000000004, -1.0 ] }, "properties": { "title": "zoo", "marker-symbol": "zoo", "marker-color": "#9195A1" } }
var viewer = new Cesium.Viewer('cesiumContainer');
var activeDataSource = null;
var geojson1 = { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0.2, 0.0 ] }, "properties": { "title": "1", "marker-symbol": "1", "marker-color": "#C49D22" } }]};
var geojson2 = { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0.30000000000000004, 0.0 ] }, "properties": { "title": "2", "marker-symbol": "2", "marker-color": "#8EE3A6" } }]};
Sandcastle.addToolbarButton('load 1', function() { var dataSource1 = new Cesium.GeoJsonDataSource('DataSource #1'); dataSource1.load(geojson1); if (activeDataSource !== null) { viewer.dataSources.remove(activeDataSource); } viewer.dataSources.add(dataSource1); activeDataSource = dataSource1;});
Sandcastle.addToolbarButton('load 2', function() { var dataSource2 = new Cesium.GeoJsonDataSource('DataSource #2'); dataSource2.load(geojson2); if (activeDataSource !== null) { viewer.dataSources.remove(activeDataSource); } viewer.dataSources.add(dataSource2); activeDataSource = dataSource2;});