Restricting annotations

This is a tile view for example.

This is just a tile view for the WSI. It is a WSI but zoomed in to max level and with restricted coordinates of that tile.
So the issue is, while creating an annotation on this view, If I drag my curser out of this view, the annotation is still created on the big WSI image (ImageView) as big as the curser was dragged. I want to avoid this behavior.
Is there a way so that I can restrict the annotation to only this view?

You would have to add some code to accomplish this. The code would depend on your desired behavior – should the mouse “stick” to the edges of your area? Or should an annotation dragged outside the area be discarded? Or should the annotation be modified to crop it to the area after it is drawn? Either way, this would probably involve hooking one of the geojs events (for instance geo.event.annotation.coordinates or the annotation’s mouse click handler).

– David

1 Like