I am seeing an issue that I can't explain loading GeoJson using the GeoJson.load prototype. I am using the GeoJson provided in the cesium distro - Specs/Data/test.geojson. I am only seeing an error when using the load prototype:
var testGeoJson=[ {
"type" : "FeatureCollection",
"features" : [{
"type" : "Feature",
"geometry" : {
"type" : "Point",
"coordinates" : [102.0, 0.5]
},
"properties" : {
"prop0" : "value0"
}
}, {
"type" : "Feature",
"geometry" : {
"type" : "LineString",
"coordinates" : [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]
},
"properties" : {
"prop0" : "value0",
"prop1" : 0.0
}
}, {
"type" : "Feature",
"geometry" : {
"type" : "Polygon",
"coordinates" : [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]
},
"properties" : {
"prop0" : "value0",
"prop1" : {
"this" : "that"
}
}
}, {
"type" : "Feature",
"geometry" : {
"type" : "Topology",
"transform" : {
"scale" : [1, 1],
"translate" : [0, 0]
},
"objects" : {
"polygon" : {
"type" : "Polygon",
"arcs" : [[0, 1, 2, 3]]
}
},
"arcs" : [[[0, 0], [1, 0], [0, 1], [-1, 0], [0, -1]], [[0, 0], [1, 0], [0, 1]], [[1, 1], [-1, 0], [0, -1]], [[1, 1]], [[0, 0]]]
}
}]
}];
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.removeAll();
var jsonDataSource = new Cesium.GeoJsonDataSource();
jsonDataSource.load(testGeoJson, 'Test GeoJSON');
The exception returned when loading the GeoJson is:
uncaught exception: DeveloperError: Unsupported GeoJSON object type: undefined
at Cesium/Cesium.js:406
When I load the same GeoJSON using the loadUrl prototype, everything works properly.
- Jason
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.