Select to view content in your preferred language

Moving layers up/down removes symbols for graphics

1040
5
Jump to solution
12-19-2012 10:13 PM
JohanCarlsson
Regular Contributor
Merry Christmas everyone! I have a question regarding moving layers:

When changing a layers index in the map, the symbology changes to something completely different. If you've added a TextSymbol to the layer being moved, you won't be able to read it at all since it changes to an entirely different symbol. Would I have to rewrite this command to iterate over each symbol and save its attributes to solve this? What kind of information is saved when moving a layer like this?

Regards
Johan Carlsson
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
2.I use a color dialog to set the color of border/fill and change opacity, no xaml-defined style.


How to do change the color? Are you changing the symbol (i.e creating a new symbol for each color) or are you changing an attribute value that is binded to the border color by your custom symbol?

Depending on how it's done, setting RendererTakesPrecedence to false might help.

View solution in original post

0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
When changing a layers index in the map, the symbology changes to something completely different


That doesn't seem to be a normal behavior.
Could you give more info on your type of layers and how to reproduce the issue?

Thanks
0 Kudos
JohanCarlsson
Regular Contributor

  1. Draw any type of graphic on a GraphicsLayer.

  2. I use a color dialog to set the color of border/fill and change opacity, no xaml-defined style. Only the initial symbology when placing the object is defined in the xaml.

  3. Change the layers index to lower/higher and the symbology resets to the basic transparent with black border.


This occurs with the default tool delivered with the viewer and when I do it myself in code behind.
Any ideas?

Additional information:

I add graphics exactly like this sample:
http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#DrawGraphics
0 Kudos
JohanCarlsson
Regular Contributor
It isn't really a problem for any other type of graphic than MapPoints though, since they change symbol to an orange pin, making text unreadable.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
2.I use a color dialog to set the color of border/fill and change opacity, no xaml-defined style.


How to do change the color? Are you changing the symbol (i.e creating a new symbol for each color) or are you changing an attribute value that is binded to the border color by your custom symbol?

Depending on how it's done, setting RendererTakesPrecedence to false might help.
0 Kudos
JohanCarlsson
Regular Contributor
How to do change the color? Are you changing the symbol (i.e creating a new symbol for each color) or are you changing an attribute value that is binded to the border color by your custom symbol?

Depending on how it's done, setting RendererTakesPrecedence to false might help.


When the symbol is first placed, the user gets to choose his/her own ARGB-value and then I set it like this:

            TextSymbol textSymbol = new TextSymbol()
            {
                FontSize = fontSize,
                Text = textBoxLabel.Text,
                Foreground = new SolidColorBrush(Color.FromArgb(255, argb.red, argb.green, argb.blue))
            };


            Graphic textLabel = new Graphic()
            {
                Symbol = textSymbol,
                Geometry = mapPoint
            };


RendererTakesPresedence = false solved this, thank you very much!
0 Kudos