windowsforms-devexpress-dot-xtramap-dot-mapcontrol-18478bc5.md
Gets or sets a rectangular area (also called scroll area) that confines the map center point.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public MapBounds ScrollArea { get; set; }
Public Property ScrollArea As MapBounds
| Type | Description |
|---|---|
| MapBounds |
The boundaries that specify the area in which the map center point can be moved around.
|
Use this property to limit scroll operations so that the map center point remains within the boundaries. To define these boundaries, specify the coordinates of the area’s top-left and bottom-right corners.
In the following animation, a rectangle depicts the scroll area boundaries and a dot indicates the map center position:
This example specifies a rectangular area that confines the map center point:
using DevExpress.XtraMap;
using System;
using System.Drawing;
using System.Windows.Forms;
//...
private void Form1_Load(object sender, EventArgs e) {
mapControl1.ScrollArea = new DevExpress.Map.MapBounds(
new GeoPoint(44.568441, -11.877712),
new GeoPoint(36.219329, 4.030490));
mapControl1.CenterPoint = new GeoPoint(40.155242, -2.912869);
mapControl1.ZoomLevel = 4.5;
}
//...
Imports DevExpress.XtraMap
Imports System.Windows.Forms
'...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
mapControl1.ScrollArea = New DevExpress.Map.MapBounds(New GeoPoint(44.568441, -11.877712), New GeoPoint(36.219329, 4.030490))
mapControl1.CenterPoint = New GeoPoint(40.155242, -2.912869)
mapControl1.ZoomLevel = 4.5
End Sub
'...
See Also