Point Label Rotation

578
2
05-22-2019 04:12 PM
AndyWright
Occasional Contributor

I've got a point feature layer that I've added to the map from an offline SQLite geodatabase generated from a feature service.  I've set up labeling on the layer with the placement properties set to use the value from a rotation field to rotate the text.  The points are rotating fine from that same field, but the point labels stay horizontal.  Is this something 100.5 API does not support or am I missing something here?

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi Andy,

Are you working with JSON to create label definitions?

Here's an example fragment of JSON for labelAngleInfo an angleExpressionInfo that uses Arcade to define an angle expression:

```

"labelAngleInfo": {
"angleExpressionInfo": {
"expression": "if($feature.type == 11, $feature.SITE_ANGLE, 90-2*$feature['other angle'])",
"title": "Geology dir (site)"
},
"rotationType": "arithmetic"
}

```

The Arcade angle expression must evaluate to a number (angle in degrees) e.g.
- A single fieldname would be represented as $feature.SITE_ANGLE
- A single angle for all features would be represented as 25.5
- A more complex example might be if($feature.type == 11, $feature.SITE_ANGLE, 90-2*$feature["other angle"])

This capability may not have made it into all parts of the platform yet, but it should be supported in ArcGIS Runtime (e.g. mobile map packages from Pro / service).

Cheers

Mike

0 Kudos
AndyWright
Occasional Contributor

Thanks for the feedback Michael.  We are still using ArcMap MXDs as our source for feature services.  We have customers that do not have portals federated with ArcGIS Server so we need to support publishing directly to ArcGIS Server for our customers who do not have that architecture.  Lowest common denominator type of thing.  We are also not generating mobile map packages from our feature services - just SQLites.  So I think I'm out of luck on this for now then ...

0 Kudos