Represents a scale indicator element that displays distance measurements on a map, showing both metric and imperial units with visual scale bars.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadMap.dll
Syntax:
public class MapScaleIndicatorElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementMapScaleIndicatorElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the MapScaleIndicatorElement class and associates it with the specified map element for scale calculations.
public MapScaleIndicatorElement(RadMapElement mapElement)
The RadMapElement that this scale indicator will monitor for zoom level and position changes.
Properties
Gets or sets the height of the scale indicator bars in pixels that represent the distance measurements.
public int BarHeight { get; set; }
Gets or sets the localized text displayed for feet measurements, with automatic fallback to the localization provider if not specified.
public string FeetText { get; set; }
Gets or sets the color used for drawing the imperial distance measurement bar (feet or miles).
public Color ImperialBarColor { get; set; }
Gets or sets the localized text displayed for kilometer measurements, with automatic fallback to the localization provider if not specified.
public string KilometersText { get; set; }
Gets the map element that this scale indicator is associated with for monitoring zoom levels and calculating scale measurements.
public RadMapElement MapElement { get; }
Gets or sets the localized text displayed for meter measurements, with automatic fallback to the localization provider if not specified.
public string MetersText { get; set; }
Gets or sets the color used for drawing the metric distance measurement bar (meters or kilometers).
public Color MetricBarColor { get; set; }
Methods
Calculates the appropriate distance measurements and display text based on the current map zoom level and position.
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndText()
MapScaleIndicatorElement.SizeAndText
A MapScaleIndicatorElement.SizeAndText object containing the calculated metric and imperial measurements for display.
Calculates broader distance measurements and display text using kilometer and mile units for lower zoom levels where larger scale measurements are appropriate.
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndTextInKilometersAndMiles(int maxPixels)
The maximum width in pixels available for the scale indicator display.
Returns:MapScaleIndicatorElement.SizeAndText
A MapScaleIndicatorElement.SizeAndText object containing the calculated kilometer and mile measurements for display.
Calculates precise distance measurements and display text using meter and feet units for high zoom levels where detailed measurements are needed.
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndTextInMetersAndFeet(int maxPixels)
The maximum width in pixels available for the scale indicator display.
Returns:MapScaleIndicatorElement.SizeAndText
A MapScaleIndicatorElement.SizeAndText object containing the calculated meter and feet measurements for display.
Calculates an appropriate display scale distance using predefined digit values to ensure readable and meaningful scale measurements.
Initializes the default field values and visual properties for the scale indicator element, including colors, padding, and measurement settings.
protected override void InitializeFields()
Overrides:
Measures the required size for the scale indicator element based on the calculated distance text and bar dimensions.
Paints the scale indicator element, including both metric and imperial distance bars with their corresponding text labels.