Point graphics not displaying with renderer

361
2
06-08-2012 08:21 AM
EricElder
New Contributor III
I have a graphics layer that has graphics populated, but I am unable to see the graphics in the map.  I know the graphics exist because it is possible to zoom to selected graphics.  I am currently using the same working renderer methodology for lines and polygons, but it is not working for points.  The point graphics layer does show the symbol correctly in the legend, just nothing is showing up in the map.

<esri:SimpleRenderer x:Key="SelectRendererPoint">
    <esri:SimpleRenderer.Symbol>
        <esri:MarkerSymbol>
            <esri:MarkerSymbol.ControlTemplate>
                <ControlTemplate>
                    <Ellipse x:Name="Element" Width="8" Height="8" Fill="blue" Stroke="blue" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected" />
                                    <VisualState x:Name="Selected" >
                                        <Storyboard>
                                            <ColorAnimation Storyboard.TargetName="Element" 
       Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
       To="#99FFFF00" Duration="00:00:0.25"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                    </Ellipse>
                </ControlTemplate>
            </esri:MarkerSymbol.ControlTemplate>
        </esri:MarkerSymbol>
    </esri:SimpleRenderer.Symbol>
</esri:SimpleRenderer>


<esri:GraphicsLayer ID="MyGraphicsLayerPoints" Renderer="{StaticResource SelectRendererPoint}"></esri:GraphicsLayer>



What would cause the point graphics layer that contains graphics to not show the renderer symbology?
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
I tried your renderer with the following map and it worked for me.
  <esri:Map x:Name="MyMap" WrapAround="True" Background="White">
   <esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer" 
                  Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
   <esri:GraphicsLayer ID="MyGraphics" Renderer="{StaticResource SelectRendererPoint}" MouseLeftButtonDown="GraphicsLayer_MouseLeftButtonDown">
    <esri:GraphicsLayer.Graphics >
     <esri:Graphic>
      <esri:MapPoint X="-140.9" Y="63.391">
       <esri:Geometry.SpatialReference >
        <esri:SpatialReference WKID="4326" />
       </esri:Geometry.SpatialReference>
      </esri:MapPoint>
     </esri:Graphic>
    </esri:GraphicsLayer.Graphics>
   </esri:GraphicsLayer>
  </esri:Map>


  private void GraphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
  {
   e.Graphic.Selected = !e.Graphic.Selected;
  }


Did you set your Graphic.Geometry.SpatialReference? Is GraphicsLayer.Visible? Double check that you've associated the correct symbol with GraphicsLayer that has Point geometry.
0 Kudos
EricElder
New Contributor III
Well I found my mistake.  I had some C# code assigning the graphics into the wrong graphics layer.  Symbology works fine now.
0 Kudos