handle null geometry
This commit is contained in:
+10
-10
@@ -368,18 +368,18 @@ function readFeatureFromGeometry(
|
|||||||
name,
|
name,
|
||||||
opt_options
|
opt_options
|
||||||
) {
|
) {
|
||||||
let geometry;
|
let geometry = null;
|
||||||
const type = object.type;
|
const type = object.type;
|
||||||
const geometryReader = GEOMETRY_READERS[type];
|
if (type) {
|
||||||
if (type === 'Point' || type === 'MultiPoint') {
|
const geometryReader = GEOMETRY_READERS[type];
|
||||||
geometry = geometryReader(object, scale, translate);
|
if (type === 'Point' || type === 'MultiPoint') {
|
||||||
} else {
|
geometry = geometryReader(object, scale, translate);
|
||||||
geometry = geometryReader(object, arcs);
|
} else {
|
||||||
|
geometry = geometryReader(object, arcs);
|
||||||
|
}
|
||||||
|
geometry = transformGeometryWithOptions(geometry, false, opt_options);
|
||||||
}
|
}
|
||||||
const feature = new Feature();
|
const feature = new Feature({geometry: geometry});
|
||||||
feature.setGeometry(
|
|
||||||
transformGeometryWithOptions(geometry, false, opt_options)
|
|
||||||
);
|
|
||||||
if (object.id !== undefined) {
|
if (object.id !== undefined) {
|
||||||
feature.setId(object.id);
|
feature.setId(object.id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user