Skip to main content

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

ImageLayer Class

Displays map images obtained from map image data providers.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public class ImageLayer :
    LayerBase,
    IImageLayerRenderParametersProvider

#Example

This example demonstrates how to monitor the service request state.

To do this, handle the ImageLayer.RequestDataLoading event. Specify the wait form which will be shown when data is loading. Handle the LayerBase.DataLoaded event to determine the state of the wait form after the map data is obtained.

using DevExpress.XtraMap;
using System;
using System.Windows.Forms;


namespace RequestDataLoadingExample {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {
            ImageLayer layer = new ImageLayer();
            mapControl1.Layers.Add(layer);
            BingMapDataProvider provider = new BingMapDataProvider();
            provider.BingKey = "YOUR_BING_KEY";
            layer.DataProvider = provider;
            layer.RequestDataLoading += OnRequestDataLoading;
            layer.DataLoaded += OnDataLoaded;
        }
        void OnRequestDataLoading(object sender, EventArgs e) {
            Cursor.Current = Cursors.WaitCursor;
            if (!splashScreenManager1.IsSplashFormVisible)
                splashScreenManager1.ShowWaitForm();
        }
        void OnDataLoaded(object sender, DataLoadedEventArgs e) {
            Cursor.Current = Cursors.Default;
            splashScreenManager1.CloseWaitForm();
        }

    }
}
See Also