Write fill and outline in PolyStyle
Write styles based on style objects appropriate for geometry. Write fill and outline in PolyStyle if false (i.e. non-default) Handle MultiLineString, MultiPoint and MultiPolygon within heterogenous MultiGeometry when writing features Add getGeometriesArrayRecursive method to ol/geom/GeometryCollection to allow for nested MultiGeometry Enhanced write GeometryCollection geometries test A more rigorous write GeometryCollection geometries test including nested collections (the output is simplified to a single MultiGeomtry) Add writeFeatures to outline and fill tests, setting geometry for geometry specific tests Add <fill>0</fill> and <outline>0</outline> to some existing tests
This commit is contained in:
@@ -126,6 +126,23 @@ class GeometryCollection extends Geometry {
|
||||
return this.geometries_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array<Geometry>} Geometries.
|
||||
*/
|
||||
getGeometriesArrayRecursive() {
|
||||
/** @type {Array<Geometry>} */
|
||||
let geometriesArray = [];
|
||||
const geometries = this.geometries_;
|
||||
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
if (geometries[i].getType() === this.getType()) {
|
||||
geometriesArray = geometriesArray.concat(/** @type {GeometryCollection} */ (geometries[i]).getGeometriesArrayRecursive());
|
||||
} else {
|
||||
geometriesArray.push(geometries[i]);
|
||||
}
|
||||
}
|
||||
return geometriesArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user