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
Sending SymbolElement front to MapElement
posted

After importing shape file to xamMap, I tried to add some bubble SymbolElements.

But bubbles are behind SurfaceElements. How could i bring bubble to front ?

I tried  setting value to ZIndex of SymbolElement. But it doesn't work.

 

Thanks for your help.

 

Regards,

Nyi Nyi

Parents
No Data
Reply
  • 2505
    Offline posted

    Hi Nyi Nyi,

    If you use one layer to both contain your shapefile and add SymbolElements to, you only have to make sure that you add the SymbolElements after MapLayerImportAction.End as explained here:
    http://help.infragistics.com/NetAdvantage/DV/2010.3/CLR4.0/?page=xamWebMap_Add_Symbol_Element.html

    In case you use two layers, one for the shapefile and another for the SymbolElements, a sample approach is the following:
    XAML:
        <Grid x:Name="LayoutRoot" Background="White">
            <igMap:XamMap x:Name="map1">
                <igMap:XamMap.Layers>
                    <igMap:MapLayer x:Name="statesLayer" Imported="statesLayer_Imported">
                        <igMap:MapLayer.Reader>
                            <igMap:ShapeFileReader Uri="Shapefiles/usa/usa_st"/>
                        </igMap:MapLayer.Reader>
                    </igMap:MapLayer>
                   
                    <igMap:MapLayer x:Name="symbolLayer"/>
                </igMap:XamMap.Layers>
            </igMap:XamMap>
        </Grid>
    Code Behind:
            private void statesLayer_Imported(object sender, Infragistics.Controls.Maps.MapLayerImportEventArgs e)
            {
                if (e.Action == MapLayerImportAction.End)
                {
                    Point origin = map1.MapProjection.ProjectToMap(new Point(-101.6015625, 42.032974332441405));
                    SymbolElement element = new SymbolElement() { SymbolOrigin = origin, Caption = "Marker", SymbolType = MapSymbolType.Bubble, SymbolSize = 10 };

                    map1.Layers[1].Elements.Add(element);

                    Rect worldRect = map1.Layers[1].WorldRect;
                    worldRect.Union(element.WorldRect);

                    map1.Layers[1].WorldRect = worldRect;
                }
            }

    Best regards,

    Milana Zhileva

Children