Graphicslayer fullextent is null, confirmed Graphicslayers has graphics (polygons)

2781
1
10-31-2014 10:48 AM
JoelLenz1
New Contributor

Any help on this would be appreciated.

This does not work:

if (graphicsLayer.Graphics.Count > 0)

{

     Envelope gEnvelope = graphicsLayer.FullExtent;

     //(gEnvelope is null)

}

This Works:

if (graphicsLayer.Graphics.Count > 0)

{

          Envelope selEnv = null;

          foreach (Graphic g in graphicsLayer.Graphics)

          {

               if (selEnv == null)

               {

                    selEnv = g.Geometry.Extent;

               }

               else

               {

                    selEnv = selEnv.Union(g.Geometry.Extent);

               }

          }

          if (!selEnv.IsEmpty)

          {

               selEnv = selEnv.Expand(1.5);

               mapMain.SetView(selEnv);

          }

}

0 Kudos
1 Reply
AnttiKajanus1
Regular Contributor II

Thanks for posting this. This is currently by design (due mixed-spatialreference support / performance reasons) but we are looking into it.

0 Kudos