MapControl.ScrollArea Property
Gets or sets a rectangular area (also called scroll area) that confines the map center point.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
MapBounds | The boundaries that specify the area in which the map center point can be moved around. |
Remarks
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:
Example
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;
}
//...
See Also