ClassMapScaleIndicatorElement
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
MapScaleIndicatorElement(RadMapElement)
Initializes a new instance of the MapScaleIndicatorElement class and associates it with the specified map element for scale calculations.
Declaration
public MapScaleIndicatorElement(RadMapElement mapElement)
Parameters
mapElement
The RadMapElement that this scale indicator will monitor for zoom level and position changes.
Properties
BarHeight
Gets or sets the height of the scale indicator bars in pixels that represent the distance measurements.
FeetText
Gets or sets the localized text displayed for feet measurements, with automatic fallback to the localization provider if not specified.
ImperialBarColor
Gets or sets the color used for drawing the imperial distance measurement bar (feet or miles).
KilometersText
Gets or sets the localized text displayed for kilometer measurements, with automatic fallback to the localization provider if not specified.
MapElement
Gets the map element that this scale indicator is associated with for monitoring zoom levels and calculating scale measurements.
MetersText
Gets or sets the localized text displayed for meter measurements, with automatic fallback to the localization provider if not specified.
MetricBarColor
Gets or sets the color used for drawing the metric distance measurement bar (meters or kilometers).
Methods
CalculateDistanceAndText()
Calculates the appropriate distance measurements and display text based on the current map zoom level and position.
Declaration
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndText()
Returns
MapScaleIndicatorElement.SizeAndText
A MapScaleIndicatorElement.SizeAndText object containing the calculated metric and imperial measurements for display.
CalculateDistanceAndTextInKilometersAndMiles(int)
Calculates broader distance measurements and display text using kilometer and mile units for lower zoom levels where larger scale measurements are appropriate.
Declaration
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndTextInKilometersAndMiles(int maxPixels)
Parameters
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.
CalculateDistanceAndTextInMetersAndFeet(int)
Calculates precise distance measurements and display text using meter and feet units for high zoom levels where detailed measurements are needed.
Declaration
protected virtual MapScaleIndicatorElement.SizeAndText CalculateDistanceAndTextInMetersAndFeet(int maxPixels)
Parameters
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.
GetDisplayScaleDistance(double)
Calculates an appropriate display scale distance using predefined digit values to ensure readable and meaningful scale measurements.
InitializeFields()
Initializes the default field values and visual properties for the scale indicator element, including colors, padding, and measurement settings.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the required size for the scale indicator element based on the calculated distance text and bar dimensions.
PaintElement(IGraphics, float, SizeF)
Paints the scale indicator element, including both metric and imperial distance bars with their corresponding text labels.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
graphics
The IGraphics object used for drawing the scale indicator.
angle
The rotation angle for the element.
scale
The scaling factor for the element.
Overrides