I am using polygons in my website, built with Openlayers and ol-cesium.
These polygons used to be correct when in 3D (i.e. lines are not supposed to be straight in the 3D view).
This used to work fine until ol-cesium 2.14.0. Now I have tried to upgrade, and with 2.15.x onwards, polygon lines appear straight (i.e. screen-straight and not world-straight). I have also tried updating Openlayers and Cesium; nothing makes any difference.
var geometry = new MultiPolygon(this.paths[i]);
if (JMap.projection != 'EPSG:4326') {
geometry.transform('EPSG:4326', JMap.projection);
}
geometry.set('olcs.polygon_kind', 'rectangle');
newpolygons.push(new Feature({
geometry: geometry,
colour: i
}));
Is a behaviour change which I can revert with some flag? I have created a ticket in case it is a regression: https://github.com/openlayers/ol-cesium/issues/1214
By looking at the diff in github, we can see 2 breaking changes:
So the fixed code would be as follows:
var geometry = new MultiPolygon(this.paths[i]);
if (JMap.projection != 'EPSG:4326') {
geometry.transform('EPSG:4326', JMap.projection);
}
var feature = new Feature({
geometry: geometry,
colour: i
});
feature.set('olcs_polygon_kind', 'rectangle');
newpolygons.push(feature);