WMS-C use

WMS-C support is part of the minimum, standard and extended APIs. WMS-C delivery is deprecated for the upcoming release of the Geoportal services.

Foreword

It is important to note that Geoportal layers are projected under a specific projection (IGNF:GEOPORTAL*, IGNF:MILLER, See RIG). As such, any other image based service (like WMS, WMS-C and al) has to be :

  • either in the same projection (mandatory for IGNF:MILLER);
  • or in plate-carre (EPSG:4326 or equivalent).

    The Geoportal API also allows to display Geoportal's layers (IGNF:GEOPORTAL*) in plate-carre (IGNF:RGF93G, compatible with EPSG:4326) and other layers must be under the same plate-carre projection.

2D Web Javascript API

Configuration

Adding a WMS-C layer is as simple as that :

myMap.getMap().addLayer(
    "WMS-C",
    layer_name,
    "url_to_wmsc",
    wmsc_parameters,
    layer_options
);
  • the layer_name parameter holds the text that will be displayed by the layers switcher. This name may be a string or an (See multi-lingual) ;
  • the url_to_wmsc parameter holds the WMS-C URL ;
  • the wms_parameters holds all parameters needed to define the WMS-C like layers, format, transparency, etc ...
  • the layer_options holds parameters for managing the WMS behavior like gridOrigin, resolutions, projection, units, maxExtent, minZoomLevel, maxZoomLevel, opacity, isBaseLayer, visibility, originators, etc ... It is worth noting that maxExtent should be expressed in the chosen projection spatial reference system.
    • The gridOrigin parameter indicates the tile cache origin. It is (0, 0) in the projection spatial reference system by default.
    • The resolutions parameter is an array of floats. By default, the layer's resolutions are the same as the Geoportal's resolutions :
      ZoomResolution (m)ProjectionScale
      039135.7500000MILLER1 : 156 543 000
      119567.8750000MILLER1 : 78 271 500
      29783.9375000MILLER1 : 39 135 750
      34891.9687500MILLER1 : 19 567 875
      42445.9843750MILLER1 : 9 783 938
      52048.0000000GEOPORTAL###1 : 8 192 000
      61024.0000000GEOPORTAL###1 : 4 096 000
      7512.0000000GEOPORTAL###1 : 2 048 000
      8256.0000000GEOPORTAL###1 : 1 024 000
      9128.0000000GEOPORTAL###1 : 512 000
      1064.0000000GEOPORTAL###1 : 256 000
      1132.0000000GEOPORTAL###1 : 128 000
      1216.0000000GEOPORTAL###1 : 64 000
      138.0000000GEOPORTAL###1 : 32 000
      144.0000000GEOPORTAL###1 : 16 000
      152.0000000GEOPORTAL###1 : 8 000
      161.0000000GEOPORTAL###1 : 4 000
      170.5000000GEOPORTAL###1 : 2 000
      180.2500000GEOPORTAL###1 : 1 000
      190.1250000GEOPORTAL###1 : 500
      200.0625000GEOPORTAL###1 : 250

    Layer's resolutions can be both different in value and length from the Geoportal's ones, Geoportal.Layer.Grid class finds the closest resolution for the current Geoportal resolution in order to overlay them.

    All in all, there is no significant difference between OpenLayers.Layer.WMS use and Geoportal.Layer.WMSC use expect for the geographic rights management that is :

  • either added automagically by the standard and extended API ;
  • or added manually (by the developper) as follow (See operating for more information) :
    • add a GeoRM option in the layer_options ;
    • assign the following code to the GeoRM option :
      GeoRM: Geoportal.GeoRMHandler.addKey(
          gGEOPORTALRIGHTSMANAGEMENT.apiKey,
          gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.url,
          gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.ttl,
          myMap)
Spain and France maps overlay example :

The following code snippet shows Geoportal WMS-C displayed in plate-carre and an overlay of a spanish WMS-C also in plate-carre :

...
myMap= new Geoportal.Viewer.Default("map", {
    mode:"normal",
    territory:"FXX",
    projection:"IGNF:RGF93G"
});
...
var ideeResolutions= [
        0.703125,
        0.3515625,
        0.17578125,
        0.087890625,
        0.0439453125,
        0.02197265625,
        0.010986328125,
        0.0054931640625,
        0.00274658203125,
        0.001373291015625,
        0.0006866455078125,
        0.00034332275390625,
        0.000171661376953125,
        0.0000858306884765625,
        0.00004291534423828125,
        0.000021457672119140625,
        0.0000107288360595703125,
        0.00000536441802978515625,
        0.000002682209014892578125,
        0.0000013411045074462890625,
        0.00000067055225372314453125,
        0.000000335276126861572215625,
        0.0000001676380634307861078125,
        0.00000008381903171539305390625,
        0.000000041909515857696526953125
];
var idee= myMap.getMap().addLayer(
    "WMS-C",
    {
        'IDEE-Base':
        {
            'fr':"Cartes de base IDEE",
            'en':"IDEE base maps",
            'es':"Cartografia base IGN"
        }
    },
    "http://www.idee.es/wms-c/IDEE-Base/IDEE-Base",
    {
        layers:'Todas',
        format:'image/png',
        transparent:true
    },
    {
        singleTile: false,
        projection:'EPSG:4326',
        // extent in EPSG:4326 :
        maxExtent: new OpenLayers.Bounds(-18.865234375,25.892578125,4.865234375,46.107421875),
        gridOrigin: new OpenLayers.LonLat(0,0),
        nativeResolutions:ideeResolutions.slice(0),
        opacity:0.30,
        units:'degrees',
        isBaseLayer: false,
        visibility:false,
        originators:[
            {
                pictureUrl:'http://www.idee.es/images/Logo_IDEE.gif',
                url:'http://www.idee.es/index.jsp?lang=FR'
            }
        ]
    });
...