Select to view content in your preferred language

A fix for symbol rotation... almost.  Any help?

823
1
06-18-2012 07:00 AM
KarenEllett
Regular Contributor
Right now, the code for my symbol in the Map.xml config file looks like this:

<esri:GraphicsLayer.Renderer>
<esri:UniqueValueRenderer Field="SUBTYPECD" Attribute="SUBTYPECD" DefaultLabel="Default Symbol">
  <esri:UniqueValueRenderer.DefaultSymbol>
   <esriFSSymbols:PictureMarkerSymbol>
    <esriMapping:SymbolExtensions.Json>{"type":"esriPMS","color":null,"width":21,"height":21,"angle":0,"xoffset":0,"yoffset":0}</esriMapping:SymbolExtensions.Json>
   </esriFSSymbols:PictureMarkerSymbol>
                </esri:UniqueValueRenderer.DefaultSymbol>
   <esri:UniqueValueRenderer.Infos>
   <esriMapping:UniqueValueInfoObj FieldType="Integer" Label="Overhead Fuse" SerializedValue="1">
                                <esri:UniqueValueInfo.Symbol>
                                                      <esriMapping:ImageFillSymbol Size="44" OriginX="0.5" OriginY="0.5" Source="/Images/MarkerSymbols/Electric/OverheadFuse.png"/>
                                                </esri:UniqueValueInfo.Symbol>
   </esriMapping:UniqueValueInfoObj>
  </esri:UniqueValueRenderer.Infos>
</esri:UniqueValueRenderer>
</esri:GraphicsLayer.Renderer>


With this code, there is no symbol rotation (based on the value in the field SYMBOLROTATION) but I can manipulate the symbol size in the application builder, and the symbol image shows up in the legend.

I can get the symbol to rotate if I use this code:


<esri:UniqueValueRenderer.Infos>
<esriMapping:UniqueValueInfoObj FieldType="Integer" Label="Overhead Fuse" SerializedValue="1">
            <esri:UniqueValueInfo.Symbol>
                                     <esriMapping:ImageFillSymbol Size="44" OriginX="0.5" OriginY="0.5" Source="/Images/MarkerSymbols/Electric/OverheadFuse.png">
                                         <esriMapping:ImageFillSymbol.ControlTemplate>
                                              <ControlTemplate>
                                                  <Image RenderTransformOrigin="0.5,0.5">
                                                      <Image.RenderTransform>
                                                           <RotateTransform Angle="{Binding Path=Attributes.[SYMBOLROTATION]}"/>
                                                      </Image.RenderTransform>
                                                  </Image>
                                            </ControlTemplate>
                                         </esriMapping:ImageFillSymbol.ControlTemplate>
                                      </esriMapping:ImageFillSymbol>
                             </esri:UniqueValueInfo.Symbol>
</esriMapping:UniqueValueInfoObj>
</esri:UniqueValueRenderer.Infos>


This rotates the symbol correctly, but I lose any control of the symbol in the application builder.  I don't mind too much having to change the symbol size using the xaml, but the symbol no longer shows up in the legend.  I understand why, but is there any way to tweak this so I get the best of both worlds?

Thanks!
0 Kudos
1 Reply
KarenEllett
Regular Contributor
Correction - once I set the width and height properties for the image, it displays in the legend just fine.  However the symbol on the map does not display mouseover behavior, and it can't be selected by the select tool, although it does still give a popup when clicked.  There is also a significant offset, even with the offset explicitly set to 0. Any ideas?
0 Kudos