Solved! Go to Solution.
Envelope env = new Envelope(); Envelope NewEnv = new Envelope(); for (int i:graphicsLayerLines.getGraphicIDs()){ Polyline p = (Polyline)graphicsLayerLines.getGraphic(i).getGeometry(); p.queryEnvelope(env); NewEnv.merge(env); } for (int i:graphicsLayerPoints.getGraphicIDs()){ Point p = (Point)graphicsLayerPoints.getGraphic(i).getGeometry(); p.queryEnvelope(env); NewEnv.merge(env); } map.setExtent(NewEnv);
Envelope env = new Envelope();
Envelope NewEnv = new Envelope();
for (int i:graphicsLayer.getGraphicIDs()){
Polygon p = (Polygon) graphicsLayer.getGraphic(i).getGeometry();
p.queryEnvelope(env);
NewEnv.merge(env);
}
MapView.setExtent(NewEnv);
Envelope env = new Envelope(); Envelope NewEnv = new Envelope(); for (int i:graphicsLayerLines.getGraphicIDs()){ Polyline p = (Polyline)graphicsLayerLines.getGraphic(i).getGeometry(); p.queryEnvelope(env); NewEnv.merge(env); } for (int i:graphicsLayerPoints.getGraphicIDs()){ Point p = (Point)graphicsLayerPoints.getGraphic(i).getGeometry(); p.queryEnvelope(env); NewEnv.merge(env); } map.setExtent(NewEnv);