Tutorial - Map Scale
Create a map. We increase the maximum amount you can zoom.
Create a UI layer to hold the scale widget.
Add a basic scale in the upper-left corner.
Since the default map uses a Mercator projection, if you zoom very far out and pan, you may notice the scale changing length. The scale is calculated based on its position on the map within the current display.
The scale can use U.S. Statute units instead of Système international.
Or, you can define a new set of units, such as nautical miles. You can also change the orientation of the scale.
With appropriate placement, you can have two scales that appear as a combined widget.