FIx #9510: EsriJSON readGeometry should not mutate input

This commit is contained in:
Michael Parry
2019-05-30 18:43:22 +02:00
parent 5222a0ffd6
commit a8e31dddee
2 changed files with 19 additions and 2 deletions

View File

@@ -256,10 +256,10 @@ function readGeometry(object, opt_options) {
const rings = convertRings(esriJSONPolygon.rings, layout);
if (rings.length === 1) {
type = GeometryType.POLYGON;
object['rings'] = rings[0];
object = Object.assign({}, object, {['rings']: rings[0]});
} else {
type = GeometryType.MULTI_POLYGON;
object['rings'] = rings;
object = Object.assign({}, object, {['rings']: rings});
}
}
const geometryReader = GEOMETRY_READERS[type];