This hook allow you to add annotations to an exisiting AnnotationsLayer.
A scope is a user defined string, which should uniquely tie the added anotations to your component.
If your annotations belong to a specific wellbore, the wellbore name or id would work well as a scope.
A single function addAnnotations is returned, which you can call from within a useEffect
hook to set annotations. Annotations must be an array of AnnotationProps.
The addAnnotations function will return a dispose function when invoked, which you should
call within the effect dispose function.
Note that annotation positions needs to be in world space. You can optionally provide a matrixWorld to
the annotation props that can be used to transform the local postion to world position. In the components
using annotations, this is done by rendering a "dummy" Object3D and passing its matrixWorld instance to the
annotation props.
This hook allow you to add annotations to an exisiting
AnnotationsLayer. A scope is a user defined string, which should uniquely tie the added anotations to your component. If your annotations belong to a specific wellbore, the wellbore name or id would work well as a scope.A single function
addAnnotationsis returned, which you can call from within auseEffecthook to set annotations. Annotations must be an array ofAnnotationProps. TheaddAnnotationsfunction will return a dispose function when invoked, which you should call within the effect dispose function.Example
Remarks
Note that annotation positions needs to be in world space. You can optionally provide a matrixWorld to the annotation props that can be used to transform the local postion to world position. In the components using annotations, this is done by rendering a "dummy" Object3D and passing its matrixWorld instance to the annotation props.
Example
See