Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
712
xamMap layer Background Image
posted

Hi,

I wanna display shape data on the Maplayer with an image background.

How could i set the background image of  xamMap MapLayer?

 

Thx.

Regards,

NNT

Parents
No Data
Reply
  • 2505
    Offline posted

    Hi nyinyithann,

    If I understand you correctly, you want to use an image as a particular MapLayer's background. A sample approach is the following:
            private void mapLayer_Imported(object sender, Infragistics.Controls.Maps.MapLayerImportEventArgs e)
            {
                if (e.Action == MapLayerImportAction.End)
                {
                    foreach (MapElement el in this.theMap.Layers[0].Elements)
                    {
                        if (el.Name == "ElementX")
                        {
                            ImageBrush myImg = new ImageBrush();

                            myImg.ImageSource = new BitmapImage(new Uri("/Images/image.jpg", UriKind.Relative));

                            el.Fill = myImg; 
                        }
                    }
                }
            }
    Hope that helps,
    Milana Zhileva

Children