// lines: one fat and one thin SimpleLineSymbol sls1 = new SimpleLineSymbol(Color.gray, 10); SimpleLineSymbol sls2 = new SimpleLineSymbol(Color.yellow, 5); // a composite symbol to bring then together CompositeSymbol cs = new CompositeSymbol(); cs.add(sls1); cs.add(sls2); // some geometry Polyline line = new Polyline(); line.startPath(0, 0); line.lineTo(0, 5000000); line.lineTo(5000000, 5000000); // a graphic Graphic gr = new Graphic(line, cs); // add it to a graphics layer GraphicsLayer gl = new GraphicsLayer(); map.getLayers().add(gl); gl.addGraphic(gr);
//get graphic Graphic graphic = positionReportLayer.getGraphic(graphicId) ; //get the symbol type for the graphic Symbol milSymb = graphic.getSymbol(); //is this a composite symbol? if (milSymb instanceof CompositeSymbol) { System.out.println("this is a composite symbol"); } else { System.out.println("this must be a multi-layer symbol"); }
... if you had a Mil-std-2525c graphic you could check this by using the following code: //get graphic Graphic graphic = mgl.getMessageProcessor().getGraphic("52853229-1e87-47b2-abca-07a1a1b991dd"); //get the symbol type for the graphic Symbol milSymb = graphic.getSymbol(); //is this a multi layer symbol? if (milSymb instanceof MultiLayerSymbol) { System.out.println("this is a multi layer symbol"); }So although the MultiLayerSymbol cannot be user created (only the message processor internals can do this), you can at least see the type of symbol being used by the graphic.
The purpose of the MultiLayerSymbol is only to identify the type of graphic used in the symbology we use for Mil-Std-2525C graphics.If you are working with graphics layers then in addition to SimpleMarkerSymbols have for example: - PictureMarkerSymbols - Polylines - GraphicsCan you give me more detail of what you are trying to achieve?
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.