Select to view content in your preferred language

Get annotation feature extent

251
4
Jump to solution
a week ago
MinhHoangf
Emerging Contributor

Hello everyone, i'm working with annotation layer and annotation feature.

I added an annotation feature to annotation layer. Now i want to get it's precise extent. I tried inpector.GetAnnotationProperties().Shape, but it returns a MapPoint, not the boundary of text. If i use inspector["Shape"] or inspector.GeometryAttribute.CurrentValue, it returns a polygon, but not exactly bound the text, like in image below:

9150b64a415bcb05924a.jpg

My question is, how to get annotation feature boundary, exactly cover the text, like this image

77bc59f0c3e149bf10f0.jpg

0 Kudos
1 Solution

Accepted Solutions
CraigWilliams
Esri Contributor

See GetDrawingOutline on the AnnotationLayer (inherited from BasicFeatureLayer) which has options for how detailed of a shape you'd like.

View solution in original post

0 Kudos
4 Replies
Aashis
by Esri Contributor
Esri Contributor

Have you tried the  CIMTextGraphic.Shape ?

 

0 Kudos
MinhHoangf
Emerging Contributor

Yes, it returns a MapPoint. I also tried AnnotationFeature.GetGraphicOutline(), but it returns same polygon as inspector["Shape"].

0 Kudos
CraigWilliams
Esri Contributor

See GetDrawingOutline on the AnnotationLayer (inherited from BasicFeatureLayer) which has options for how detailed of a shape you'd like.

0 Kudos
MinhHoangf
Emerging Contributor

It works perfectly. Thank you very much.

0 Kudos