Here I am not getting the annotation.getContents(). Its undefined and also scale and precision is undefined. I want it to work same as other non overlapped annotations. I want to get the measured value (… sq. meter) of a overlapped annotation(small top annotation in fig.) as an independent annotation with all the scale and precision data.
A small code snippet to solve this would be appreciable.
If I create annotations over another annotation (filled - area), then I am unable to get the measured content like (… sq. m ) of that drawn annotation which I had drawn over the annotation
I still cannot reproduce your issue, however it looks like you have a timing issue in your code that might be causing the issue.
exportAnnotations is async but annotations.forEach is syncronous, meaning you are calling this.annotationChanged.emit(annotationsArray); before all the promises are resolved.
You need to wait for all the exportAnnotations promises to resolve before you can call this.annotationChanged.emit(annotationsArray);.
You could update your code to something like this:
I am still unable to reproduce your issue. One other thing I see with your code is that you’re only checking the type of first annotation in the array, but then looping over all of them and trying to call getContents etc. If an annotation that is not a measurement annotation is in that array, getContents() etc would be expected to be null.
Can you make sure all annotations in the annotations array are actually what you expect?
Yes, I have checked it properly. Please see the above attached xfdf datas of the two annotations. In that one annotation has all the necessary data like scale precision and sq.m. while other annotation doesn’t have all these scale and precisions and sq.m…
Above both annotations have same ToolName.
Still unable to get embedded/ overlapped annotation’s proper xfdf data.