Class ZoomInOutWidget
Widget which shows two buttons (horizontal or vertical) with a "+" and a "-" sign. With this, the user could zoom the map in and out.
Usage To show a ZoomInOutWidget, add a instance of the ZoomInOutWidget to Map.Widgets by
map.Widgets.Add(new ZoomInOutWidget(map));
Customize Size: Height and Width of the buttons Orientation: Orientation of the buttons. Could be Horizontal or Vertical. Vertical is default. StrokeColor: Color of button frames TextColor: Color of "+" and "-" signs BackColor: Color of button background Opacity: Opacity of buttons ZoomFactor: Factor for changing Resolution. Default is 2;
Inherited Members
Namespace: Mapsui.Widgets.Zoom
Assembly: Mapsui.dll
Syntax
public class ZoomInOutWidget : Widget, IWidget, IWidgetTouchable, INotifyPropertyChanged
Properties
| Edit this page View SourceBackColor
Color of background
Declaration
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Opacity
Opacity of background, frame and signs
Declaration
public float Opacity { get; set; }
Property Value
Type | Description |
---|---|
float |
Orientation
Orientation of buttons
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation |
Size
Width and height of buttons
Declaration
public float Size { get; set; }
Property Value
Type | Description |
---|---|
float |
StrokeColor
Color of button frames
Declaration
public Color StrokeColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
TextColor
Color of "+" and "-" sign
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Methods
| Edit this page View SourceHandleWidgetTouched(Navigator, MPoint)
Function, which is called, when a Widget is hidden
Declaration
public override bool HandleWidgetTouched(Navigator navigator, MPoint position)
Parameters
Type | Name | Description |
---|---|---|
Navigator | navigator | Navigator of MapControl |
MPoint | position | Screen position |
Returns
Type | Description |
---|---|
bool | True, if the Widget had handled the touch event |
Overrides
Events
| Edit this page View SourcePropertyChanged
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |
WidgetTouched
Event handler which is called, when buttons are touched. If there isn't one, than the default handler is used, which change the Resolution of Viewport.
Declaration
public event EventHandler<WidgetTouchedEventArgs>? WidgetTouched
Event Type
Type | Description |
---|---|
EventHandler<WidgetTouchedEventArgs> |