Select to view content in your preferred language

No Example MultiLayerSymbol

3466
10
Jump to solution
12-12-2012 10:19 PM
kishanchintala
Deactivated User
Hi,

I started using ArcGGIS runtime API, I fell there so many gaps in API ( Like documentaton is too week, not like ArcGIS Standered and we can not extend some of the classes like SimpleMarkersymbol). Now i am facing problem how i can use MultiLayerSymbol, there is no example, if any one have MultiLayerSymbol example please send to me.

Thanks in advance.
Kishan.
0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor
At 10.1.1 you could draw a line as you describe above which is yellow with a grey outline.  To do this you would need to draw 2 lines.  Draw a grey one first and then a yellow one after which share the same geometry.

In the next release we may be able to have a thing called a "CompositeSymbol", so you might be able to write code like this.

  // 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);


This code above would create an interesting looking road.  I think it's a Roman road!  The values used for the size are pixels.

[ATTACH=CONFIG]24640[/ATTACH]

Would this be a useful implementation?

View solution in original post

10 Replies
MarkBaird
Esri Regular Contributor
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
- Graphics

Can you give me more detail of what you are trying to achieve?
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
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
- Graphics

Can you give me more detail of what you are trying to achieve?


Hi, Mark,

Can you elaborate a bit on what you mean by "type of graphic"? Is this done by accessing its map of property values? How exactly do you get a MultiLayerSymbol from a created military symbol of the message group layer?

Thanks, again for your assistance and efforts. Have a happy new year!
0 Kudos
MarkBaird
Esri Regular Contributor
Each Graphic has a symbol. 

If you have a graphics layer and you add some Polylines then you are likely to use a SimpleLineSymbol.

If you have points in a graphics layer, you might use a SimpleMarkerSymbol.

Internally the message processor uses MultiLayerSymbols, but there isn't anything you can do with these in the API.  It's just been put there to allow future developments.
0 Kudos
MarkBaird
Esri Regular Contributor
You can of course check the type of Symbol in a Graphic.

So for example if you have created a Polygon graphic with a simple fill symbol you can check this as follows:

        //get symbol test
        Symbol symb = complexPolyGraphic.getSymbol();
       
        //is it a simple fill symbol?
        if (symb instanceof SimpleFillSymbol)
        {
         System.out.println("this is a simple fill symbol");
        }


Alternatively 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.
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
Thanks, Mark.

Good luck with QA; look forward to next release!
0 Kudos
JeremieJoalland1
Deactivated User
Just to be sure Mark, for the current release 10.1.1, could you confirm to me that it's not possible to do complex symbol for graphics (in GraphicLayer) like this :

MultiLayerSymbol included :
- 1 SimpleLineSymbol - color Yellow - width 3
- 1 SimpleLineSymbol - color Gray - width 4

so for exemple, my roads look like straight yellow line with gray outline ? (as I would like to do for Marker with a green square with black outline for exemple)... then it's easy to just change inside color of symbols, and keep same outline color, to differentiate graphics.

If not possible at this time, I really hope it will be included to the next release, as it seems to me basic symbology for graphics... like it's possible in ArcgIS Engine (in fact, I'm trying to convert simple case of style/symbolizer from Styled Layer Descriptor file - OGC XML Schema, into ArcGIS Runtime Symbols, and most of cases in my case there are lots of multi layer symbols based on 2 simple symbol).

another question is about the width/size unit for ArcGIS Symbols ? is it Pixel or Points (1/72 inches) ?
0 Kudos
MarkBaird
Esri Regular Contributor
At 10.1.1 you could draw a line as you describe above which is yellow with a grey outline.  To do this you would need to draw 2 lines.  Draw a grey one first and then a yellow one after which share the same geometry.

In the next release we may be able to have a thing called a "CompositeSymbol", so you might be able to write code like this.

  // 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);


This code above would create an interesting looking road.  I think it's a Roman road!  The values used for the size are pixels.

[ATTACH=CONFIG]24640[/ATTACH]

Would this be a useful implementation?
JeremieJoalland1
Deactivated User
thanks. Great if it's coming in 10.2 !!

this CompositeSymbol seems to be exactly what we are looking for... and we will definitely need it, as current simple symbols are too limited for us.
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
... 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.


Mark,

Apparently, your code won't work on tactical graphics at 10.2 because the symbol property off a graphic is null. So, it seems that you'd have to check for null values as well to assume it may have been created by the message processor component. Any reason why that is? Is there an alternative to this?

Thanks,

Carlos
0 Kudos