I have created a series of stacked polygons, right next to each other, as per their latitude and longitude. I would expect these to have their edges touching each other. However, they are separate.
As discussed in
http://gis.stackexchange.com/questions/191984/openlayers-3-cesium-polygon-projection-issue , the issue is that vertices are defined using latitude and longitude, whereas polygons are drawn in a different projection.
Is there a way to tell Cesium the projection to use for rendering a
polygon? Otherwise, is this something that could be added in the future?
(which we could document in a GitHub artefact).
Code used in the sandcastle:
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-30, 70, 0, 70, 0, 69, -30, 69, -30, 70]),
material : Cesium.Color.RED
}
});
viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-40, 71, 10, 71, 10, 70, -40, 70, -40, 71]),
material : Cesium.Color.RED
}
});
viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-50, 72, 20, 72, 20, 71, -50, 71, -50, 72]),
material : Cesium.Color.RED
}
});
viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-60, 73, 30, 73, 30, 72, -60, 72, -60, 73]),
material : Cesium.Color.RED
}
});
viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-70, 74, 40, 74, 40, 73, -70, 73, -70, 74]),
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);