Adding custom map layers

You can add custom layers to geographical maps. For example, you can add geographical information that is made available by a public server.

Before you begin

Configure an offline mapping provider, if you want the custom layer to be available offline. See Integrating an online or offline Web Map Service for more information.

About this task

V4.2 Fix Pack 4: You can define one or more custom layers and one base layer. Users can select different custom layers for their session in the geographical views.

The following mapping provider types are supported:
  • ArcGISRest
  • Web Map Service (WMS)
  • Web Mapping Tile Service (WMTS)

To add a custom map layer, complete the following steps:

Procedure

  1. Back up and edit the following file: $JazzSM_HOME/profile/installedApps/JazzSMNode01Cell/isc.ear/ncp_gis.war/resources/config.json
  2. Create a new customLayers section or uncomment one of the default sections, and specify the correct parameters.
    The WMS parameters that are accepted by OpenLayers are listed at http://openlayers.org/en/latest/apidoc/ol.source.TileWMS.html. The parameters that you must use are defined in the WMS request specification of your WMS server. Use the following syntax for parameters: "PARAM_NAME":"PARAM_VALUE". To avoid errors, use a validation tool to validate the JSON.

    The ArcGISRest parameters that are accepted by OpenLayers are listed at https://openlayers.org/en/latest/apidoc/module-ol_source_TileArcGISRest-TileArcGISRest.html.

    The WMTS parameters that are accepted by OpenLayers are listed at https://openlayers.org/en/latest/apidoc/module-ol_source_WMTS.html.

    The following example configures parameters for one WMS custom layer, one ArcGISRest custom layer, and one WMTS custom layer.

    "customLayers": [
       {
           "layerName": "Drainage Divisions",
           "layerType": "wms",
           "url": "http://geoserver.nationalmap.nicta.com.au/admin_bnds_abs/ows",
           "params": {
              "LAYERS": "admin_bnds:ADD_2011_AUST"
           }
    	"selected":"true"
       }, {
           "layerName": "Prohibited Areas",
           "layerType": "arcGISRest",
           "url": "http://services.ga.gov.au/gis/rest/services/NM_Reserves/MapServer",
           "params": {}
    
    	"selected":"false"
        }
           {
           "layerName": "New Zealand Earthquakes",
           "layerType": "wmts",
           "capabilities": {
                 "url": "https://openlayers.org/en/v4.3.4/examples/data/WMTSCapabilities.xml",
                 "layer": "layer-7328",
                 "matrixSet": "EPSG:3857"
                 }
    	"selected":"false"
           }
    ]

    If you do not supply any arcGISRest parameters, include the line but leave it empty: "params": {}. Removing or omitting sections from the file causes errors.

    The layerName parameter can be set to any unique descriptive value.

    For custom map layers, the layerType value must be one of the following supported values:
    • arcGISRest
    • wms
    • wmts

    Custom layers that have the selected parameter set to true are displayed by default in the geographical views. The user can show or hide any custom layers.

  3. If you are using a map layer server that is different from the Network Manager GUI server, configure the server details.
    1. Back up and edit the file $NMGUI_HOME/profile/etc/tnm/tnm.properties.
    2. Update the tnm.contentSecurityPolicyImgSrc property.
      The property value must include 'self' as well as zero, one, or more map layer hosts.
    3. If you are not using Open Streetmap, delete https://*.tile.openstreetmap.org from the property value.
    4. Add one or more hosts for your map servers to the property value. Include the protocol (http:// or https://) and the port, if the port differs from the default (80 for HTTP and 443 for HTTPS).
      The property value can be any valid img-src attribute of a Content-Security-Policy header. See here for the specification for this attribute: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src
  4. Define multiple layers if you want. The z-index of the layers is defined by their position in the file. To display one custom layer above another layer, define it higher in the file. The topology layer is displayed on top of the other layers, and the base layer is displayed underneath the other layers.