@Override public void onMouseClicked(MouseEvent mouseEvent) { for(Layer l : msgGroupLayer.getLayers()){ if(l instanceof com.esri.map.GraphicsLayer){ GraphicsLayer gl = (GraphicsLayer)l; gl.setSelectionColor(Color.WHITE); int[] ids = gl.getGraphicIDs(mouseEvent.getX(), mouseEvent.getY(), 0); for(int i : ids){ gl.select(i); } } } super.onMouseClicked(event); }
Hi Carlos.With Final, this worked for me, highlighting all of graphics used in the MessageProcessorApp sample: try{ for(Layer l : msgGroupLayer.getLayers()){ if(l instanceof com.esri.map.GraphicsLayer){ GraphicsLayer gl = (GraphicsLayer)l; SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.YELLOW,20,Style.CIRCLE); gl.setSelectionSymbol(sms); int[] ids = gl.getGraphicIDs(); for(int i : ids){ gl.select(i); } } } }catch(Exception e){ e.printStackTrace(); }Is this helpful at all?
try{ for(Layer l : msgGroupLayer.getLayers()){ if(l instanceof com.esri.map.GraphicsLayer){ GraphicsLayer gl = (GraphicsLayer)l; SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.YELLOW,20,Style.CIRCLE); gl.setSelectionSymbol(sms); int[] ids = gl.getGraphicIDs(); for(int i : ids){ gl.select(i); } } } }catch(Exception e){ e.printStackTrace(); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.