joe.radjavitch@grt.com

GraphicsLayer problem

Discussion created by joe.radjavitch@grt.com on Jan 30, 2014
Hello,

I am having a problem with my GraphicsLayer. I open a MapView and add a graphic when the user taps the map.
There is also functionality to change the base map. If the user stays on the initial base map, the graphics display properly.

However, if the user changes the base map, the graphics are not displayed. I put a breakpoint in my code to verify the graphics still exist in the layer and the layer is still in the map (it is the last layer in the map).

Here is my reorder code:

 private void orderArcmap(Boolean isChangeBase) {

  int startPoint;
  
  if (isChangeBase) {
   arcMap.removeAll();
   startPoint = 0;
  } else {
   while (arcMap.getLayers().length > 1) {
    arcMap.removeLayer(arcMap.getLayers().length - 1);
   }

   startPoint = 1;
  }

  for (int i = startPoint; i < 4; i++) {
   for (Map.Entry<Layer, Integer> entry : layerMap.entrySet()) {
    if (entry.getValue() == i) {
     arcMap.addLayer(entry.getKey());
    }
   }
  }

  arcMap.addLayer(arcGisGraphicLayers);
  arcMap.refreshDrawableState();
  arcMap.postInvalidate();
 }


Any ideas where I should look to fix my problem?

Thanks,
JR

Outcomes