miahmartin

Ordering layers from webmap and a graphics layer.

Discussion created by miahmartin on Oct 11, 2011
Latest reply on Oct 14, 2011 by JNery-esristaff
Hello.  I'm having an issue with the ordering of my layers.  When I add the layers from my WebMap on ArcGIS.com with my Graphics Layer the graphics layer ends  up on the bottom so I can not add graphic features to it.  How can I make sure the Graphics layer is on top.  I'm adding the webmap layers with the C# code below and the graphics layer is being added in the the xml content panel also shown below.  Also, instead of a graphics layer, can you edit or add features in a Map Notes layer with the windows phone ArcGIS API 2.2'

Thank you

public MainPage()
        {
            InitializeComponent();
            MyDrawObject = new Draw(MyMap)
            {
                LineSymbol = LayoutRoot.Resources["DrawLineSymbol"] as LineSymbol,
                FillSymbol = LayoutRoot.Resources["DrawFillSymbol"] as FillSymbol
            };

            MyDrawObject.DrawComplete += MyDrawObject_DrawComplete;

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;
            webMap.GetMapAsync("04c0d99256cb440faa52f8e542efdeb1");
        }

        void MyDrawObject_DrawComplete(object sender, GetMapCompletedEventArgs e)
        {
            if (e.Error == null)
                ContentPanel.Children.Add(e.Map);
        }


        void webMap_GetMapCompleted(object sender, GetMapCompletedEventArgs e)
        {
            if (e.Error == null)
                ContentPanel.Children.Add(e.Map);
        }


<!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1">
            <esri:Map x:Name="MyMap">
                <esri:Map.Layers>
                    <esri:GraphicsLayer ID="MyGraphicsLayer" />
                </esri:Map.Layers>
            </esri:Map>
        </Grid>

Outcomes