GeoPrisma logo

Map

Note

This widget is deprecated. Use the MapPanel and Layer widgets instead.

Widget that will create a basic OpenLayers map with OpenLayers layer objects.

The GeoPrisma Map widget configures the OL map object with its OPTIONS. A LAYERS node contains the configuration for each layers. Note that the layers are created in the order specified in the LAYERS node.

NB: Vector layers added to the map currently use the MapFish protocol.

Notice

This widget basically wraps the OpenLayers map object so valid options and parameters can be deduced by looking at the OpenLayers documentation

See more developer details in the Map.xslt file.

Map Options

All the options of the Map widget set the corresponding OpenLayers Map object options in the constructor. the list of supported options is:

maxextent:Comma separated value of coordinates
maxresolution:number
numzoomlevels:number
projection:EPSG string of the projection
displayprojection:
 EPSG string of the projection to display
resolutions:Comma separated list of all resolution numbers
restrictedextent:
 Comma separated value of coordinates
scales:Comma separated list of all scale numbers
units:string of the unit
alloverlays:boolean
addLayers:(Boolean) Defaults to true. Add layers when they are created or not. Only thoses created by this widget are affected by this option.
<map>
    <options>
        <maxextent>-180,-90,180,90</maxextent>
        <!-- Other map option here -->
    </options>
</map>

Layers

Each <layer> node define an OpenLayers Layer object. All the options defined in the layer node are applied to the layer constructor. There’s also 2 parameters mandatory to the layer creation:

resourcenames/resourcename:
 Name of the resource to add in the map. Combined with the wms servicetype, there can be multiple resources in one layer.
servicetype:Type of layer to add. Currently the servicetype supported are: wms, tilecache, featureserver and gymo.
<map>
    <layers>
        <layer>
            <resourcenames>
                <resourcename>Resource1</resourcename>
            </resourcenames>
            <servicetype>tilecache</servicetype>
            ...
        </layer>
    </layers>
</map>

Layer Options

extractattributes:
 

boolean

format:

string

isbaselayer:

boolean

layername:

String of the unique layer object name. (Default is the resource name)

maxfeatures:

number

maxresolution:

number

minresolution:

number

maxscale:

number

minscale:

number

minzoomlevel:

number

opacity:

float

projection:

EPSG string of the projection

scales:

Comma separated list of all scale numbers

buffer:

integer

singletile:

boolean

sphericalmercator:
 

boolean

strategies:

All strategy used on a featureserver layer.

cluster:

boolean

stylemap:

Only for featureserver layer

group:
(String) The group the layer is member of. Used by LayerTreeBuilder

widget. Its value must be alphanumeric characters seperated by ‘/’ to allow sub-groups.

  • Simple stylemap

    <stylemap>
         <renderers>
             <renderer>
                 <renderintent>default</renderintent>    <!-- Mandatory, can be 'default', 'select', 'temporary', 'delete' -->
                 <style>
                     <fillcolor>FF0000</fillcolor>
                 </style>
             </renderer>
         </renderers>
     </stylemap>
    
    <stylemap>
         <renderers>
             <renderer>
                 <renderintent>default</renderintent>    <!-- Mandatory, can be 'default', 'select', 'temporary', 'delete' -->
                 <style>                                 <!-- (all styles supported by SVG/VML and some more options) -->
                     <fillcolor>FF0000</fillcolor>       <!-- RGB string -->
                     <fillopacity>0.6</fillopacity>      <!-- Number between 0 and 1 -->
                     <pointRadius></pointRadius>
                     <strokedashstyle></strokedashstyle>
                     <strokelinecap></strokelinecap>
                     <strokeopacity></strokeopacity>
                     <strokewidth></strokewidth>
                     <strokecolor>FF0000</strokecolor>   <!-- RGB string -->
                     <radius></radius>                   <!-- Only with cluster. Starting radius of the point-->
                     <maxradius></maxradius>             <!-- Only with cluster. Maximum radius of the point-->
                 </style>
             </renderer>
         </renderers>
     </stylemap>
    
  • uniquevaluerules stylemap: If you want to define a unique style to a given property, add them here

    <stylemap>
        <renderers>
            ...
        </renderers>
        <uniquevaluerules>
            <uniquevaluerule>
                <renderintent>default</renderintent> <!-- Mandatory, can be 'default', 'select', 'temporary', 'delete' -->
                <property>rol_co_cla</property>
                <symbolizers>
                    <symbolizer>
                        <value>AUT</value>
                        <style>
                            <strokecolor>284386</strokecolor>
                            ...
                        </style>
                    </symbolizer>
                </symbolizers>
            </uniquevaluerule>
        </uniquevaluerules>
    </stylemap>
    
  • context stylemap: If you want to use function to get style option value

    <stylemap>
        <renderers>
            <renderer>
                <renderintent>default</renderintent>
                <style>
                    <fillcolor>${getFillColor}</fillcolor>
                    <strokecolor>${getStrokecolor}</strokecolor>
                    <fillopacity>${getFillOpacity}</fillopacity>
                    <context>
                        <functions>
    
                            <!-- `result` value is returne when feature `attribute` = `equal` else `defaultresult` -->
                            <attributegualfunction>
                                <name>getFillColor</name>
                                <attribute>dumpingid</attribute>
                                <egual>15</egual>
                                <result>#FF0000</result>
                                <defaultresult>#ee9900</defaultresult>
                            </attributegualfunction>
    
                            <!-- `result` value is returne when feature fid = `equal` else `defaultresult` -->
                            <fidegualfunction>
                                <name>getStrokecolor</name>
                                <egual>15</egual>
                                <result>#FF00FF</result>
                                <defaultresult>#00FFFF</defaultresult>
                            </fidegualfunction>
    
                            <function>
                                <name>getFillOpacity</name>
                                <code>return 0.6;</code>      <!-- Javascript code -->
                            </function>
    
                        </functions>
                    </context>
                </style>
            </renderer>
        </renderers>
    </stylemap>
    

    Note

    The ‘attributegualfunction’ and ‘fidegualfunction’ nodes are deprecated. Use ‘function’ node instead.

transitioneffect:
 

String (either default or resize)

transparent:

boolean

typename:

???

visibility:

boolean (Is the layer visible on load. True by default)

<map>
    <layers>
        <layer>
            <options>
                <layername>ResourceVMap0_TC</layername>
                <isbaselayer>true</isbaselayer>
                <projection>EPSG:4326</projection>
                ...
            </options>
        </layer>
    </layers>
</map>

XML Sample

<map>
    <name>DefaultMap</name>
    <options>
        <maxextent>-180,-90,180,90</maxextent>
        <!-- Other map option here -->
    </options>
    <layers>
        <layer>
            <resourcenames>
                <resourcename>ResourceVMap0</resourcename>
            </resourcenames>
            <servicetype>tilecache</servicetype>
            <options>
                <layername>ResourceVMap0_TC</layername>
                <isbaselayer>true</isbaselayer>
                <projection>EPSG:4326</projection>
            </options>
        </layer>
    </layers>
</map>

Mandatory Options

Same as OpenLayers Map object.

Service Type

featureserver, wms, tilecache, gymo

Widget Action

read

Table Of Contents

Previous topic

WFSFilterBuilder

Next topic

MapFishLayerTree

This Page