Versions Compared

Key

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

...

Code Block
xml
xml
titleBasic configuration to setup a selection map engine on the server
linenumberstrue

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:selection="urn:com.cohga.server.map.selection#1.0">

  <selection:mapengine id="selection">
    <!-- Selection specific configuration if required -->
  </selection:mapengine>

</config>

...

Code Block
xml
xml
titleSetting maximum scale for selections to be drawn at
linenumberstrue
   <selection:mapengine id="selection">
    <maxscale>50000</maxscale>
  </selection:mapengine>

...

Code Block
xml
xml
titleSetting time and selection size limits
linenumberstrue

  <selection:mapengine id="selection">
    <limit>5000</limit>
    <timeout>5</timeout>
  </selection:mapengine>

...

Code Block
xml
xml
titleTurning off antialiasing
linenumberstrue

  <selection:mapengine id="selection">
    <antialiasing>false</antialiasing>
  </selection:mapengine>

...

Code Block
xml
xml
titleChanging number of features rendered in each batch
linenumberstrue
   <selection:mapengine id="selection">
    <batchsize>2500</batchsize>
  </selection:mapengine>

...

Code Block
xml
xml
titleChanging the format of the generated image
linenumberstrue

  <selection:mapengine id="selection">
      <format>image/png32</format>
  </selection:mapengine>

...

Code Block
xml
xml
titleChanging the basic rendering styles of point, lines and polygons
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <point>
      <active>
        <strokecolour>white</strokecolour>
        <strokewidth>1</strokewidth>
        <strokeopacity>0</strokeopacity>
        <fillcolour>cyan</fillcolour>
        <fillopacity>1</fillopacity>
        <mark>circle</mark>
        <marksize>12</marksize>
      </active>
      <inactive>
        <strokecolour>cyan</strokecolour>
        <strokewidth>2</strokewidth>
        <strokeopacity>1</strokeopacity>
        <fillcolour>white</fillcolour>
        <fillopacity>0</fillopacity>
        <mark>circle</mark>
        <marksize>12</marksize>
      </inactive>
    </point>
    <line>
      <active>
        <strokecolour>cyan</strokecolour>
        <strokewidth>3</strokewidth>
        <strokeopacity>0.75</strokeopacity>
      </active>
      <inactive>
        <strokecolour>#00ffff</strokecolour>
        <strokewidth>2</strokewidth>
        <strokeopacity>0.25</strokeopacity>
      </inactive>
    </line>
    <polygon>
      <active>
        <strokecolour>#00ffff</strokecolour>
        <strokewidth>3</strokewidth>
        <strokeopacity>0.75</strokeopacity>
        <fillcolour>#00ffff</fillcolour>
        <fillopacity>0.125</fillopacity>
      </active>
      <inactive>
        <strokecolour>#00ffff</strokecolour>
        <strokewidth>2</strokewidth>
        <strokeopacity>0.25</strokeopacity>
        <fillcolour>#00ffff</fillcolour>
        <fillopacity>0.025</fillopacity>
      </inactive>
    </polygon>
  </override>
</selection:mapengine>

...

Occasionally if you're using a spatial engine that does not support specific geometry types, point, line and polygon, but instead just a generic geometry type (this includes SQL Server) then you may need to tell the selection map engine what type of renderer to use for a particular entity.

...

Code Block
xml
xml
2Title Overriding the rendering type for an entity - pre 1.3.3
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <property>polygon</property>
    <road>line</road>
    <trafficlight>point</trafficlight>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleOverriding the rendering type for an entity - 1.3.3 and later
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <entity id="property">polygon</entity>
    <entity id="road">line</entity>
    <entity id="trafficlight">point</entity>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleOverriding an entities rendering using CSS properties - pre 1.3.3
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <property>
      <active>
        <strokecolour>green</strokecolour>
        <strokewidth>3</strokewidth>
        <strokeopacity>0.75</strokeopacity>
        <fillcolour>green</fillcolour>
        <fillopacity>0.125</fillopacity>
      </active>
      <inactive>
        <strokecolour>green</strokecolour>
        <strokewidth>2</strokewidth>
        <strokeopacity>0.25</strokeopacity>
        <fillcolour>green</fillcolour>
        <fillopacity>0.025</fillopacity>
      </inactive>
    </property>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleOverriding an entities rendering using CSS properties - 1.3.3 and later
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <entity id="property">
      <active>
        <strokecolour>green</strokecolour>
        <strokewidth>3</strokewidth>
        <strokeopacity>0.75</strokeopacity>
        <fillcolour>green</fillcolour>
        <fillopacity>0.125</fillopacity>
      </active>
      <inactive>
        <strokecolour>green</strokecolour>
        <strokewidth>2</strokewidth>
        <strokeopacity>0.25</strokeopacity>
        <fillcolour>green</fillcolour>
        <fillopacity>0.025</fillopacity>
      </inactive>
    </entity>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleReferencing a SLD file - pre 1.3.3
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <property>property.sld</property>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleReferencing a SLD file - 1.3.3 or later
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <entity id="property">property.sld</entity>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleEmbedding a SLD file
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <property><![CDATA[
      <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <NamedLayer>
          <Name>property</Name>
          <UserStyle>
          <!-- Rest of SLD content here -->
          </UserStyle>
        </NamedLayer>
      </StyledLayerDescriptor>
    ]]></property>
  </override>
</selection:mapengine>

...

Code Block
xml
xml
titleReferencing a SLD file with override tag - 1.3.3 or later
linenumberstrue

<selection:mapengine id="selection">
  <override>
    <entity id="property">property.sld</entity>
  </override>
</selection:mapengine>
Code Block
xml
xml
titleReferencing a SLD file without override tag - 1.3.3 or later
linenumberstrue

<selection:mapengine id="selection">
  <entity id="property">property.sld</entity>
</selection:mapengine>

...

Code Block
xml
xml
titleNew 'selection' map engine added to client
linenumberstrue
     <client:config id="...">
        ...
        <view id="com.cohga.html.client.map.mapView">
            ...
            <mapEngine id="raster">
               <options>
                 <selection>false</selection>
                 <alpha>false</alpha>
               </options>
            </mapEngine>

            <mapEngine id="vector">
               <options>
                 <selection>false</selection>
                 <alpha>true</alpha>
               </options>
            </mapEngine>

            </mapEngine id="selection">
                <options>
                    <!-- tell the client map engine that this layer is for handing selections -->
                    <selection>true</selection>
                    <!-- ensure the the client knows that this map engine supports transparency -->
                    <alpha>true</alpha>
                </options>
            </mapEngine>
        </view>
    </client:config>

...

Code Block
xml
xml
2Setting the toc model to alter the 'selection' map engine
linenumberstrue

    <toc:model id="toc.main">
        <!-- set the default map engine for entries that don't have one set -->
        <mapengine>vector</mapengine>

        <entry label="Selection" exclusive="true">
            <!-- change the map engine for every entry in this group to use the selection map engine-->
            <mapengine>selection</mapengine>
            <entry layer="_selection.active" label="Active" checked="true"/>
            <entry layer="_selection.all" label="All" checked="false"/>
            <entry label="Selected" checked="false">
                <!-- individual selection layer here -->
                ...
            </entry>
        </entry>

        <!-- regular layer entries here -->
        ...

        <entry label="Raster" exclusive="true">
            <!-- use the raster map engine for every entry in here -->
            <mapengine>raster</mapengine>
            ...
        </entry>
    </toc:model>