diff --git a/src/utils/annotation.ts b/src/utils/annotation.ts index 6ed9853d..8e86d253 100644 --- a/src/utils/annotation.ts +++ b/src/utils/annotation.ts @@ -93,9 +93,9 @@ export function geojsAnnotationFactory( return geojs.annotation.pointAnnotation(annotationOptions); case AnnotationShape.Polygon: - newGeoJSAnnotation = geojs.annotation.polygonAnnotation(options); - newGeoJSAnnotation!.options("vertices", coordinates); - break; + annotationOptions.vertices = coordinates; + return geojs.annotation.polygonAnnotation(annotationOptions); + case AnnotationShape.Line: annotationOptions.vertices = coordinates; return geojs.annotation.lineAnnotation(annotationOptions);