QlikMaps for Multilayer: WMS Layers

Using the WMS Layers control, you can add custom WMS layers and custom popups to your map.

For more information on WMS layers, visit QlikMaps for Multilayer: Overview.

Keep the following in mind when using WMS Layers.

1. WMS/WMTS Layers may rely on publicly-available servers. Data availability is not a guarantee.

2. Some servers provide HTTPS connections while others are only HTTP; this may cause issues in some environments that do not allow content from mixed HTTP and HTTPS servers.

3. External layers must use the EPSG: 4326 coordinate system.

4. Some external layers only work at certain zoom levels set by the server.

WMS Layers

WMS Layers

Layer

This is where you add the expression for the WMS layer logic.

NOTE: The expression requires more than a simple URL, please refer to the template below for the correct syntax.

Layer expression

This is the template from the Layer expression, repeated here for your reference.

/*
This template creates a WMS layer that shows Census tracts and labels.  It uses the following parameters:
  "url": The URL in quotes for a WMS Server.  (MANDATORY)
     NOTE:  A valid WMS URL should will return a valid response for: <url>?SERVICE=WMS&REQUEST=GetCapabilities 
  "name": The name in quotes that will appear in the layer selector.  It should be a unique name.  (MANDATORY)
  "layers": The layer or layers requested from the WMS Server.  It must be in the following format:  ["layer1", "layer2"]  (MANDATORY)
  "isDefault": Tells QlikMaps whether or not show the layer by default.  Should be "yes" or "no" in quotes.  (OPTIONAL, defaults to "no")

Example 1:
"url": "http://tigerweb.geo.census.gov/ArcGIS/services/tigerWMS_Census2010/MapServer/WMSServer",
"name": "Census Tracts", 
"layers": ["Census Tracts", "Census Tracts Labels"], 
"isDefault": "off"

Example 2:
"url": "http://gis.srh.noaa.gov/arcgis/services/RIDGERadar/MapServer/WMSServer", 
"name": "Doppler Radar", 
"layers": ["0"], 
"isDefault": "off"
*/

HTTP(S) logic

Because some HTTPS environments (i.e. accessed through AccessPoint) may not load HTTP or HTTPS content, you may need to account for that in your WMS expression. Below is an expression that returns an HTTPS link when loaded in AccessPoint, and an HTTP link when loaded in the Desktop client.

=if( Index( DocumentPath(), '\') = 0,
'"url": "https://tigerweb.geo.census.gov/ArcGIS/services/tigerWMS_Census2010/MapServer/WMSServer",
"name": "Census Tracts", 
"layers": ["Census Tracts", "Census Tracts Labels"], 
"isDefault": "off"'
,
'"url": "http://tigerweb.geo.census.gov/ArcGIS/services/tigerWMS_Census2010/MapServer/WMSServer",
"name": "Census Tracts", 
"layers": ["Census Tracts", "Census Tracts Labels"], 
"isDefault": "off"'
)

This is where you add the Popup expression.

NOTE: This expression must return a valid URL, please refer to the template for information on creating a valid URL.

NOTE: The popup logic will request the "NAME" field, whether it is in your expression or not.

This is the template from the Popup expression, repeated here for your reference.

=/*  
This template uses a REST query to create a popup for the WMS layer.  
QlikMaps will execute the REST query based upon the point a user clicks on.  
Use the "outfields" parameter in the URL to control what fields appear in the popup.  Set "outfields" = "*" to display all available fields.

Example 1: Show all available fields in popup:
http://tigerweb.geo.census.gov/arcgis/rest/services/tigerWMS_Census2010/MapServer/14/query?outFields=*
Example 2: Show COUNTY, HU100, and POP100 fields in popuphttp://tigerweb.geo.census.gov/arcgis/rest/services/tigerWMS_Census2010/MapServer/14/query?outFields=COUNTY,HU100,POP100*/