[GeoNode-users] MapStore2 Viewer - Custom WMTS background map

Pascal Coulon Pascal.Coulon at scisys.co.uk
Fri Apr 26 02:52:30 PDT 2019


All,

We have decided to use MapStore2 as the main viewer in Geonode (2.10RC4). We would like to set-up a custom WMTS or XYZ (tile) layer for the background map. We are based in the UK and we would need to use the Ordnance Survey OGC feed for this.

In our settings.py we have set-up the following config.

DEFAULT_MAP_CRS = "EPSG:3857"

if 'geonode_mapstore_client' not in INSTALLED_APPS:
    INSTALLED_APPS += (
        'mapstore2_adapter',
        'geonode_mapstore_client',)
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'mapstore'  # DEPRECATED use HOOKSET instead
GEONODE_CLIENT_HOOKSET = "geonode_mapstore_client.hooksets.MapStoreHookSet"
MAPSTORE_DEBUG = False

### The key to access OS API as obfuscated. #####
DEFAULT_MS2_BACKGROUNDS = [

         {
             "type":"wmts",
             "title":"Ordnance Survey",
              "allowedSRS": {
              "EPSG:3857": True
              },
             "url": [
              "https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/zxy/EPSG:3857/Outdoor 3857/${z}/${x}/${y}.png?key=xxxxx"
             ],
             "visibility": False,
             "group":"background",
              "matrixIds": [
                  "EPSG:3857",
              ],
              "tileMatrixSet": [
                 ],
             "capabilitiesURL": "https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/wmts?Request=GetCapabilities&key=XXXXXXXXXXXX"
        },


    ]

MAPSTORE_BASELAYERS = DEFAULT_MS2_BACKGROUNDS

The background data from OS does not get properly set and we get some JavaScript errors that lead us to believe that we are not setting the background layer the proper way.

Any help or recommendation would be gratefully received.

Regards,

Pascal



SCISYS UK Limited. Registered in England and Wales No. 4373530.
Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.
 
Before printing, please think about the environment.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190426/a20eda16/attachment.html>


More information about the geonode-users mailing list