How to add selection point to annotations?

I want to add selection point in AnnotationCreatePerimeterMeasurement and AnnotationCreateAreaMeasurement. As pointed in below figure, I want to add further more selection points.

image

Hi there!

To do this you need to create a custom SelectionModel, and then assign it to the annotation.

There is a sample repo here which contains some examples, specifically this one.

This guide also has some information on creating custom selection models.

Thanks,
Logan

Hi Logan,
I have gone through the documentation. But it seems it doesn’t properly explain my needs.
We are using angular 9, typescript. However I did something here. Let me know further steps:

private getController(annotation: any) {
    let x = annotation.X;
    let y = annotation.Y;
 
    const width = annotation.Width;
    const height = annotation.Height;

    x -= width * 0.5;
    y -= height * 0.5;
    return new this.viewerInstance.Annotations.Rect(x, y, x + width, y + height);
  }

on annotationSelection:

this.viewerInstance.annotManager.on(AnnotationManagerConstants.ANNOTATION_SELECTED, (annotations, action) => {
        if (action === 'selected') {
          const model= new this.viewerInstance.Annotations.SelectionModel(annotations[0], true, true, docViewer);
          const test2 = this.getControlHandler(annotations[0]);
          let test3 = new this.viewerInstance.Annotations.ControlHandle(test2.x1,test2.x2,test2.y1,test2.y2);
        

Also how to get vertices of annotation.
Annotation.vertices[this.index].x
I am getting vertices as undefined.

Here I had passed the selected annotation.
Let me know what to do next? Or is this correct way

Regards
Kiran