Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

WMTS overlays

sbrunner edited this page May 2, 2012 · 8 revisions

In the tree we can have a level one LayerGroup like this:

 {
   "isExpanded": false,
   "isInternalWMS": false, // false is requied to contains WMTS layers
   "name": "Test WMTS",
   "children": [ ... ]
 }

A child is something like this:

 {
    "type": "WMTS", // required
    "url": "http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml", // capabilities URL
    "identifierAttribute": null, // same as other layers
    "no2D": false, // same as other layers (must be false)
    "kml3D": "", // same as other layers
    "id": 999, // same as other layers
    "minResolutionHint": 0.0, // same as other layers
    "maxResolutionHint": 100.0, // same as other layers
    "isChecked": true, // same as other layers
    "isVisible": true, // same as other layers
    "disclamer": true, // same as other layers
    "legend": true, // same as other layers
    "legendURL": "", // empty => get legend urls from capabilities
    "metadataURL": "", // empty => get metadata url from capabilities
    "mapserverLayers": "toto", // related mapserver layer (for print and query)
    "name": "ch.are.gemeindetyp-1990-9klassen", // name of the WMTS layer throw OpenLayers.i18n => display name 
    "matrixSet": "21791", // WMTS matrix set
    "dimensions": {"test": "toto"}, // WMTS dimensions
    "style": "", // WMTS style, empty => default
 }

OpenLayers PullRequest that can helps: https://github.com/openlayers/openlayers/pull/271

TODO

  • radio button (when the Layer group has the attribute isBaseLayer)
  • external WMS (to be more defined)
  • external WMTS (see above)
  • Legend image (use legendURL in all layer type (if possible))
  • WMS URL (print and interrogation), add WMS ans WMSLayers attributes

Example

Example from actual state of the app:

Code available in the wmts branch: https://github.com/camptocamp/c2cgeoportal/tree/wmts

 var THEMES = {
    "local": [{
        "children": [{
            "isExpanded": false,
            "isInternalWMS": false,
            "name": "Tiled",
            "isBaseLayer": true,
            "children": [{
                "name": "movd_cad_tpr_parv",
                "url": "http://c2cpc34.camptocamp.com/rmaurer_test/wsgi/mapserv_proxy",
                "isSingleTile": true,
                "id": 265,
                "identifierAttribute": null,
                "isChecked": true,
                "isVisible": true,
                "type": "external WMS",
                "legend": true,
                "imageType": "image/png"
            }, {
                "name": "ch.are.gemeindetyp-1990-9klassen",
                "url": "http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml",
                "id": 266,
                "identifierAttribute": null,
                "isChecked": true,
                "isVisible": true,
                "type": "WMTS",
                "legend": true,
                "dimensions": null
            }]
        }],
        "name": "Zonenplan",
        "icon": "http://dev.regiogis-beo.ch/sbrunner-regiogis/wsgi/proj/images/themes/zonenplan.png"
    }, 
    ...
    ]
 };
Clone this wiki locally