Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

LayerBase.RectangleClip Property

Specifies a rectangle that limits the layer’s displayed area.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public Rectangle RectangleClip { get; set; }

#Property Value

Type Description
Rectangle

A rectangle that limits the layer’s displayed area.

#Remarks

The following example creates two layers within the Map Control and limits the displayed area of the second layer:

Rectangle Mask for the Map Layer

private void Form1_Load(object sender, EventArgs e) {
    ImageLayer imageLayer1 = new ImageLayer();
    BingMapDataProvider bingMapProvider1 = new BingMapDataProvider();
    bingMapProvider1.BingKey = "Your bing key here";
    bingMapProvider1.Kind = BingMapKind.Road;
    imageLayer1.DataProvider = bingMapProvider1;
    mapControl1.Layers.Add(imageLayer1);

    ImageLayer imageLayer2 = new ImageLayer();
    BingMapDataProvider bingMapProvider2 = new BingMapDataProvider();
    bingMapProvider1.BingKey = "Your bing key here";
    bingMapProvider2.Kind = BingMapKind.Hybrid;
    imageLayer2.DataProvider = bingMapProvider2;
    imageLayer2.RectangleClip = new Rectangle(200, 50, 170, 130);
    mapControl1.Layers.Add(imageLayer2);
}

The related API members:

Name

Description

ImageLayer

Displays map images obtained from map image data providers.

BingMapDataProvider

The class that loads map images from the Bing Maps data provider.

BingMapDataProvider.BingKey

Get or sets the key that is required to connect to the Bing Maps data provider.

BingMapDataProvider.Kind

Specifies the type of images that the map displays.

DevExpress.XtraMap.ImageLayer.DataProvider

Gets or sets the provider used to obtain images from an external source.

DevExpress.XtraMap.MapControl.Layers

Contains the collection of layers displayed within the MapControl.

See Also