Web layers in templates: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
(Created page with "In map templates, web map layers can be set up to access various types of web map services. From Maria GDK version 3.2, accessing web maps is handled by the client. In earlier...")
 
 
(One intermediate revision by the same user not shown)
Line 38: Line 38:
   <!-- This is a web map layer accessing the publicly available Open Street service -->
   <!-- This is a web map layer accessing the publicly available Open Street service -->
   
   
   <layer type="MapLayer" name="OpenstreetMap">
   <layer type="MapLayer" name="Openstreetmap">
     <opacity>1</opacity>
     <opacity>1</opacity>
     <brightness>0</brightness>
     <brightness>0</brightness>
Line 46: Line 46:
     <compression>Any</compression>
     <compression>Any</compression>
     <minscalevisible>1</minscalevisible>
     <minscalevisible>1</minscalevisible>
     <maxscalevisible>128000000</maxscalevisible>
     <maxscalevisible>256000000000</maxscalevisible>
     <datasource>
     <datasource>
       <mapsignature>wms</mapsignature>
       <mapsignature>wms</mapsignature>
       <maptype>WmsMap</maptype>
       <maptype>WmsMap</maptype>
       <showlabels>false</showlabels>
       <showlabels>false</showlabels>
       <usecache>false</usecache>
       <property key="serviceType" value="MercatorTiled" />
       <property key="serviceType" value="OpenstreetMap" />
      <property key="tileReferenceMethod" />
       <property key="osMapStyle" value="Standard" />
       <property key="subDomains" value="a,b,c" />
       <property key="urlWithPlaceholders" value="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
     </datasource>
     </datasource>
     <visible>true</visible>
     <visible>true</visible>
    <ispreliminary>false</ispreliminary>
    <property key="resampling" value="linear" />
     <property key="coverage:show" value="false" />
     <property key="coverage:show" value="false" />
     <property key="isusermanageable" value="false" />
     <property key="isusermanageable" value="false" />
Line 167: Line 170:
   
   
</compositemaptemplate></source>
</compositemaptemplate></source>
== Datasource ==
== Datasource ==


Line 175: Line 179:
!width="34%"| Valid values
!width="34%"| Valid values
!width="30%"| Description
!width="30%"| Description
|-
|- style="vertical-align:top;"
| mapsignature
| mapsignature
| WMS
| WMS
| Tag used to identify the element as a Web Maps Layer.
| Tag used to identify the element as a Web Maps Layer.
|-
|- style="vertical-align:top;"
| maptype
| maptype
| WmsMap
| WmsMap
| Mandatory maptype key.
| Mandatory maptype key.
|-
|- style="vertical-align:top;"
| layergroupfilter
| layergroupfilter
| &lt;layerid&gt;
| &lt;layerid&gt;
| A valid layer id. Only used in WMS layers. Use one <code>layergroupfilter</code> element for each layer to include from the WMS service.
| A valid layer id. Only used in WMS layers. Use one <code>layergroupfilter</code> element for each layer to include from the WMS service.
|-
|- style="vertical-align:top;"
| property
| property
|
|
Line 263: Line 267:
| OGCWMTSMap
| OGCWMTSMap
|
|
|-
|- style="vertical-align:top;"
| ogcUri
| ogcUri
| Service URL
| Service URL
| Mandatory URL to the service
| Mandatory URL to the service
|-
|- style="vertical-align:top;"
| ogcVersion
| ogcVersion
| OGC version identifier
| OGC version identifier
| Optional value for a preferred version
| Optional value for a preferred version
|-
|- style="vertical-align:top;"
| wmtsLayer
| wmtsLayer
| &lt;layer name&gt;
| &lt;layer name&gt;
| A valid layer name just as it appears in the server capabilities section.
| A valid layer name just as it appears in the server capabilities section.
|-
|- style="vertical-align:top;"
| wmtsTileMatrixSet
| wmtsTileMatrixSet
| &lt;tile matrix set&gt;
| &lt;tile matrix set&gt;
Line 293: Line 297:
| MercatorTiled
| MercatorTiled
|
|
|-
|- style="vertical-align:top;"
| urlWithPlaceholders
| urlWithPlaceholders
| Service URL
| Service URL
| Mandatory URL to the service. Should contain placeholders for zoom level and X,Y coordinates in the form '''{z}/{x}/{y}'''. Can also contain a placeholder for subdomain '''{s}'''.
| Mandatory URL to the service. Should contain placeholders for zoom level and X,Y coordinates in the form '''{z}/{x}/{y}'''. Can also contain a placeholder for subdomain '''{s}'''.
|-
|- style="vertical-align:top;"
| tileReferenceMethod
| tileReferenceMethod
| XYZTopLeft, XYZBottomLeft, QuadKey
| XYZTopLeft, XYZBottomLeft, QuadKey
| Method for referencing tiles.
| Method for referencing tiles.
|-
|- style="vertical-align:top;"
| subDomains
| subDomains
| List of available subdomains
| List of available subdomains

Latest revision as of 09:43, 21 May 2021

In map templates, web map layers can be set up to access various types of web map services. From Maria GDK version 3.2, accessing web maps is handled by the client. In earlier versions, this was handled by a separate Windows service (add-in).

Example

This is an example template with various types of web map layers:

<compositemaptemplate name="WebMaps" id="e72fe7f2-65c3-474a-beb7-b8ad92614bd4" type="basemap">
 
  <!-- This is an OGCWMS layer accessing publicly available maps from Kartverket  -->
 
  <layer type="MapLayer" name="OGCWMSMap">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>128000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <layergroupfilter>Landareal</layergroupfilter>
      <layergroupfilter>1_nautisk_mil</layergroupfilter>
      <layergroupfilter>Fiskerigrense</layergroupfilter>
      <usecache>false</usecache>
      <property key="serviceType" value="OGCWMSMap" />
      <property key="ogcUri" value="https://wms.geonorge.no/skwms1/wms.nmg?" />
      <property key="ogcCrs" value="EPSG:32633" />
    </datasource>
    <visible>true</visible>
    <property key="coverage:show" value="false" />
    <property key="labels:fetchdata" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>
 
 
  <!-- This is a web map layer accessing the publicly available Open Street service -->
 
  <layer type="MapLayer" name="Openstreetmap">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>256000000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <property key="serviceType" value="MercatorTiled" />
      <property key="tileReferenceMethod" />
      <property key="subDomains" value="a,b,c" />
      <property key="urlWithPlaceholders" value="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
    </datasource>
    <visible>true</visible>
    <ispreliminary>false</ispreliminary>
    <property key="resampling" value="linear" />
    <property key="coverage:show" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>
 
  <!-- This is a web maps layer accessing an OGCWMTS service -->
 
  <layer type="MapLayer" name="OGCWMTSMap">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>128000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <usecache>false</usecache>
      <property key="serviceType" value="OGCWMTSMap" />
      <property key="wmtsTileMatrixSet" value="EPSG:3857" />
      <property key="wmtsLayer" value="toporaster3" />
      <property key="ogcUri" value="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?" />
    </datasource>
    <visible>true</visible>
    <property key="coverage:show" value="false" />
    <property key="labels:fetchdata" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>

  <!-- This is a web maps layer accessing a TMS service without subdomains -->

  <layer type="MapLayer" name="Hike_bike_TMS">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>128000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <usecache>false</usecache>
      <property key="serviceType" value="MercatorTiled" />
      <property key="urlWithPlaceholders" value="http://toolserver.org/tiles/hikebike/{z}/{x}/{y}.png"/>
      <property key="tileReferenceMethod" value="XYZTopLeft" />
    </datasource>
    <visible>true</visible>
    <property key="coverage:show" value="false" />
    <property key="labels:fetchdata" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>

  <!-- This is a web maps layer accessing a TMS service with three subdomains -->

  <layer type="MapLayer" name="Humanitarian_OSM_TMS">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>128000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <usecache>false</usecache>
      <property key="serviceType" value="MercatorTiled" />
      <property key="urlWithPlaceholders" value="http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png "/>
      <property key="tileReferenceMethod" value="XYZTopLeft" />
      <property key="subDomains" value="a,b,c" />
    </datasource>
    <visible>true</visible>
    <property key="coverage:show" value="false" />
    <property key="labels:fetchdata" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>

  <!-- This is a web maps layer accessing a TMS service where tiles are referenced with a QuadKey -->

  <layer type="MapLayer" name="VirtualEarth_TMS">
    <opacity>1</opacity>
    <brightness>0</brightness>
    <gamma>1</gamma>
    <contrast>0</contrast>
    <grayscale>false</grayscale>
    <compression>Any</compression>
    <minscalevisible>1</minscalevisible>
    <maxscalevisible>128000000</maxscalevisible>
    <datasource>
      <mapsignature>wms</mapsignature>
      <maptype>WmsMap</maptype>
      <showlabels>false</showlabels>
      <usecache>false</usecache>
      <property key="urlWithPlaceholders" value="http://t{s}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=1398"/>
      <property key="subDomains" value="0,1,2,3,4" />
      <property key="tileReferenceMethod" value="QuadKey" />
    </datasource>
    <visible>true</visible>
    <property key="coverage:show" value="false" />
    <property key="labels:fetchdata" value="false" />
    <property key="isusermanageable" value="false" />
  </layer>
 
</compositemaptemplate>

Datasource

The datasource element has the following sub-elements which are relevant for web maps:

Element Valid values Description
mapsignature WMS Tag used to identify the element as a Web Maps Layer.
maptype WmsMap Mandatory maptype key.
layergroupfilter <layerid> A valid layer id. Only used in WMS layers. Use one layergroupfilter element for each layer to include from the WMS service.
property Uses the attributes key and value to specify web map type.

Property

The property elements have uses key and value attributes to further specify the type of web map:

Key Valid values Description
serviceType OpenstreetMap, OGCWMSMap, OGCWMTSMap, MercatorTiled Mandatory service type identifier. The value must be one of those listed.

OpenstreetMap

Connects to the Openstreetmap standard tile layer

Key Valid values Description
serviceType OpenstreetMap
osMapStyle standard The standard tile layer of Openstreetmap, using the "Openstreetmap Carto" stylesheet.

OGCWMSMap

Connects to a Web Map Service

Key Valid values Description
serviceType OGCWMSMap
ogcUri Service URL Mandatory URL to the service
ogcVersion OGC version identifier Optional value for a preferred version
ogcCrs CRS code Optional code for a preferred coordinate system

OGCWMTSMap

Connects to a Web Map Tile Service

Key Valid values Description
serviceType OGCWMTSMap
ogcUri Service URL Mandatory URL to the service
ogcVersion OGC version identifier Optional value for a preferred version
wmtsLayer <layer name> A valid layer name just as it appears in the server capabilities section.
wmtsTileMatrixSet <tile matrix set> A valid tile matrix set identifier chosen among the ones supported for the selected layer, as stated by the server capabilities document.

MercatorTiled

Connects to a Tile Server (also called "TMS" or "slippy map")

Key Valid values Description
serviceType MercatorTiled
urlWithPlaceholders Service URL Mandatory URL to the service. Should contain placeholders for zoom level and X,Y coordinates in the form {z}/{x}/{y}. Can also contain a placeholder for subdomain {s}.
tileReferenceMethod XYZTopLeft, XYZBottomLeft, QuadKey Method for referencing tiles.
subDomains List of available subdomains Comma-separated list of subdomains, for instance "a,b,c". Generally several subdomains (server names) are provided to get around limitations on the number of simultaneous HTTP connections to each host. Applications can thus request multiple tiles from multiple subdomains faster than from one subdomain.