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);
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.