Adding a scale ruler
Create a
ScaleLine
object
Set its
geodesic
property to
true
so that the scale line takes the projection into account
Add it to the map
Define a custom style to change the ruler position