Implement support for polygon annotations

This commit is contained in:
Tim van der Meij 2017-09-23 16:50:49 +02:00
parent 99b17a494d
commit 8ccad276b2
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
3 changed files with 32 additions and 3 deletions

View file

@ -90,6 +90,9 @@ class AnnotationFactory {
case 'PolyLine':
return new PolylineAnnotation(parameters);
case 'Polygon':
return new PolygonAnnotation(parameters);
case 'Highlight':
return new HighlightAnnotation(parameters);
@ -940,6 +943,15 @@ class PolylineAnnotation extends Annotation {
}
}
class PolygonAnnotation extends PolylineAnnotation {
constructor(parameters) {
// Polygons are specific forms of polylines, so reuse their logic.
super(parameters);
this.data.annotationType = AnnotationType.POLYGON;
}
}
class HighlightAnnotation extends Annotation {
constructor(parameters) {
super(parameters);