Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleCustomised Countries Layer
collapsetrue
<StyledLayerDescriptor version="1.0.0">
   <NamedLayer>
    <Name>Countries</Name>
    <UserStyle>
      <Name>Countries</Name>
      <FeatureTypeStyle>
        <Rule>
          <Name>.</Name>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#FF0000</CssParameter>
              <CssParameter name="fill-opacity">0.25</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#FF0000</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
              <CssParameter name="stroke-opacity">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
          <Filter xmlns:gml="http://www.opengis.net/gml">
            <PropertyIsEqualTo>
              <PropertyName>{unique_field}</PropertyName>
              <Literal>{unique_id}</Literal>
            </PropertyIsEqualTo>
          </Filter>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
  <NamedLayer>
    <Name>{layer_name}</Name>
    <UserStyle>
      <Name>{layer_name}</Name>
      <FeatureTypeStyle>
        <Rule>
          <Name>.</Name>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#00FF00</CssParameter>
              <CssParameter name="fill-opacity">0.25</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#00FF00</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
              <CssParameter name="stroke-opacity">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
          <Filter xmlns:gml="http://www.opengis.net/gml">
            <PropertyIsEqualTo>
              <PropertyName>{unique_field}</PropertyName>
              <Literal>{unique_id}</Literal>
            </PropertyIsEqualTo>
          </Filter>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

...

  • Navigate to the D:\Astun\iShareGIS\n.n\WebApps\WebService\SLD\selection folder where you will see three .xml files, one for each of the Geometry Types.
  • Copy one or all of the files, depending upon the Geometry Type whose Feature highlighting you wish to customise, into the custom\SLD\selection folder e.g. D:\Astun\iShareGIS\n.n\WebApps\WebService\custom\SLD\selection. We recommend copying the file(s) to the custom folder before making any changes to prevent upgrading to a newer version of iShare reversing your changes.
  • Now open the xml file in a text editor such as Notepad++
  • Change the entries for the {layer_name} such as the fill and stroke colour, opacity and width as required. We have changed both fill and stoke colours to red (#FF0000) in our example e.g.. 
Code Block
titleChanging the Default entries
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>{layer_name}</Name>
    <UserStyle>
      <Name>{layer_name}</Name>
      <FeatureTypeStyle>
        <Rule>
          <Name>.</Name>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#FF0000</CssParameter>
              <CssParameter name="fill-opacity">0.25</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#FF0000</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
              <CssParameter name="stroke-opacity">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
          <Filter xmlns:gml="http://www.opengis.net/gml">
            <PropertyIsEqualTo>
              <PropertyName>{unique_field}</PropertyName>
              <Literal>{unique_id}</Literal>
            </PropertyIsEqualTo>
          </Filter>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

...