@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(); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.