Select to view content in your preferred language

Feature Layer polygon display problem.

2408
3
08-23-2010 05:21 AM
StephenSporik
Deactivated User
Is it possible to have a hollow fill for a feature layer polygon?  I have an esri basemap and a polygon feature layer.  I would like to show the feature layer as hollow, so the display would show the boundaries of these polygons and the basemap would be clearly visible behind.  If I set the 'Fill' property of the simple fill symbol to 'transparent' I just get a black fill.  The closest I can get to my desired effect is to set the fill to a neutral color, and then set the opacity to something less than 0.5This allows the basemap to show sometwhat but then I loose the prominence of the boundaries. And the basemap becomes less readable, and the context details are very important for this application

My other idea was to derive a line feature layer of the boundaries and set the polygon feature layer to be invisible.  I ultimately need the user to interact with the polygon layer, deriving maptips and being able to perform selections.

Is there another property of the Feature Layer that I am not aware of that lends itself to this functionality?  Do I need to implement a renderer?  How do I do that?

Thanks.


                    <esri:Map x:Name="Map" Background="White" IsLogoVisible="False" Extent="{StaticResource StartExtent}" >
                        <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                        <esri:FeatureLayer IsHitTestVisible="True" SelectionColor="Cyan" Url="http://my.." ID="Counties" Opacity="0.6" >
                         <esri:FeatureLayer.FeatureSymbol>
                          <esri:SimpleFillSymbol BorderThickness="3"/>
                         </esri:FeatureLayer.FeatureSymbol>
                        </esri:FeatureLayer>
                        <esri:FeatureLayer IsHitTestVisible="True" SelectionColor="Cyan" Url="http://my.." >
                         <esri:FeatureLayer.FeatureSymbol>
                          <esri:FillSymbol Fill="Transparent">
                           <esri:FillSymbol.BorderBrush>
                           <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black" Offset="0"/>
                            <GradientStop Color="#FF4357C2" Offset="1"/>
                            </LinearGradientBrush>
                           </esri:FillSymbol.BorderBrush>
                          </esri:FillSymbol>
                         </esri:FeatureLayer.FeatureSymbol>
                        </esri:FeatureLayer>
                        <esri:FeatureLayer IsHitTestVisible="True" SelectionColor="Cyan" Url="http://mmsbuild.spatialsys.com/arcgis/rest/services/AllianceResidential/AllianceResidential/MapServer/0" ID="Properties" />
                    </esri:Map>
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
You are correct, setting Fill to Transparent should give you the 'hollow' graphic.

Here's one way of defining your Renderer (under Resources):
<esri:SimpleFillSymbol x:Key="MySimpleFillSymbol"
                               Fill="Transparent"
                               BorderBrush="Black"
                               BorderThickness="2" />
        <esri:SimpleRenderer x:Key="MySimpleRenderer" Symbol="{StaticResource MySimpleFillSymbol}"/>


Instead of overwriting the FeatureSymbol, you can set the Renderer like so:
 <esri:FeatureLayer ID="Polygon"                               
                               Renderer="{StaticResource MySimpleRenderer}"                               Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/2" />


It's possible that your layer already defines a renderer that's why your FeatureSymbol was not used. To find out you can visit the layer's Url in your browser and look for "DrawingInfo" - this defines the layer's renderer.
0 Kudos
dotMorten_esri
Esri Notable Contributor
Just a side note: It's better to set the Fill to {x:Null} (more efficient)
0 Kudos
shariqueabdul
Emerging Contributor
Thank you very much .... morten nielsen

perfect solution for my issue .
0 Kudos