Namespace Mapsui.Widgets.ScaleBar
Classes
ImperialUnitConverter
MetricUnitConverter
NauticalUnitConverter
ScaleBarWidget
A ScaleBarWidget displays the ratio of a distance on the map to the corresponding distance on the ground. It uses always the center of a given Viewport to calc this ratio.
Usage To show a ScaleBarWidget, add a instance of the ScaleBarWidget to Map.Widgets by
map.Widgets.Add(new ScaleBarWidget(map));
Customize ScaleBarMode: Determines, how much scalebars are shown. Could be Single or Both. SecondaryUnitConverter: First UnitConverter for upper scalebar. There are UnitConverters for metric, imperial and nautical units. SecondaryUnitConverter = NauticalUnitConverter.Instance }); MaxWidth: Maximal width of the scalebar. Real width could be smaller. HorizontalAlignment: Where the ScaleBarWidget is shown. Could be Left, Right, Center or Position. VerticalAlignment: Where the ScaleBarWidget is shown. Could be Top, Bottom, Center or Position. PositionX: If HorizontalAlignment is Position, this value determines the distance to the left PositionY: If VerticalAlignment is Position, this value determines the distance to the top TextColor: Color for text and lines Halo: Color used around text and lines, so the scalebar is better visible TextAlignment: Alignment of scalebar text to the lines. Could be Left, Right or Center TextMargin: Space between text and lines of scalebar Font: Font which is used to draw text TickLength: Length of the ticks at scalebar