Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER

Setting up a TMS as a background map in Qlik GeoAnalytics

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Patric_Nordstrom
Employee
Employee

Setting up a TMS as a background map in Qlik GeoAnalytics

Last Update:

Apr 2, 2021 4:15:50 AM

Updated By:

Patric_Nordstrom

Created date:

May 12, 2017 2:45:59 AM

Attachments

QGA can consume geodata from many different sources, here's what's needed to use a TMS a background map in QGA.

Sense Map chart

Start with specifying the source. In this case the source is a TMS from ArcGIS Online: World_Topo_Map.

  1. The TMS service is specified as a url with parameters for X, Y as Z, which specifies the position of the map image and the scale level. At ArcGIS Online the start tile is defined as: https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/0/0/0 with z, y...‌ as the order of the last parameters.
  2. Exchange the last part of the parameters and format as a string, this is the Tile Service URL:

    ='http://server.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}'


  3. Create a map and add a Background layer
  4. For the Background layer specify the URL.
  5. Don't forget to include the copyright text in the attribution:

    Sources: Esri, HERE, DeLorme, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), swisstopo, MapmyIndia, © OpenStreetMap contributors, and the GIS User Community

Old QGA Map extensions

Start with specifying the source. In this case the source is a TMS from ArcGIS Online: World_Topo_Map.

  1. The TMS service is specified as a url with parameters for X, Y as Z, which specifies the position of the map image and the scale level. At ArcGIS Online the start tile is defined as: https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/0/0/0 with z, y...‌ as the order of the last parameters.
  2. Exchange the last part of the parameters and format as a string, this is the Tile Service URL:

    ='http://server.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}'

  3. Create a map view and a geodata layer
  4. For the geodata layer specify the Tile Service URL and Source format: TMS and Tile Size: 256.
  5. Don't forget to include the copyright text some where in the app, in this case the attribution should be:

    Sources: Esri, HERE, DeLorme, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), swisstopo, MapmyIndia, © OpenStreetMap contributors, and the GIS User Community

 

See also the two attachments, example apps for Qlik Sense and QlikView.¨

 

Authentication in ArcGIS

Special note regarding Authentication in ArcGIS (Thanks to ssamuels for the solution)

 

The authentication when working with secured map services from ESRI can be solved by setting up a REST connection in the loadscript to retrieve a new access token from the REST API of ArcGIS Online. This is done by sending a GenerateToken request to the URL "https://www.arcgis.com/sharing/generateToken?parameters".  The REST call must be a POST request over https and takes the following parameters:

username - Username of the user who wishes to get a token.

password - Password of user who wishes to get a token.

referer - The base URL of the web application that will invoke the services

expiration - The token expiration time in minutes (default value for this parameter is 60 minutes)

f - The response format. The value for this parameter must be "json".

 

The resulting access token is stored in the data model and can be used as a text variable to append to the location service url in the GeoAnalytics extension.

Tags (3)
Comments
Patric_Nordstrom
Employee
Employee

The current way is to retrieve the token at load time and save in a variable but that requires most likely longer expiration time than 5 minutes. The timeout is set in the ArcGIS server.

Thanks,

Patric

marcos_herrera
Partner - Creator III
Partner - Creator III

Hello Patric

I'm trying with this URL from an ArcGIS local server https://srv-wadaptor.dipol.loc/arcgisfed/rest/services/MapasBase/World_Topo_Map/MapServer/0 but now works, can you help me to create the correct URL please

0 Likes
Patric_Nordstrom
Employee
Employee

@marcos_herrera the url is internal so I can't try it. 

Ues the info above and compare your url, it shouldn't be too hard to decipher.

Thanks

Patric

0 Likes
Matsa
Creator
Creator

Hello @Patric_Nordstrom , Thank you for the explnation.

I tried to use: 

http://aaa.aaa.com/arcgismap/rest/services/aaa/aaa/MapServer/0/tile/{z}/{y}/{x}.png

which is accessible for me( I replace 'a' with some words in order to keep our client privacy)

But I could not see the map.
In your opinion what could be a problem?

Thank you in advance.

Regards.

Matsa

0 Likes
marcos_herrera
Partner - Creator III
Partner - Creator III

Hello @Patric_Nordstrom 

The option worked for me with the URL and using Geo Analytics Plus because the customer does not have access to internet, i have a little problem now, when the Map Object tries to use TMS as a background,  first tries to search the Base Map on Qlik Cloud GA and for this reason the background takes around 2 minutes to show ArcGis Base map. Is Possible disable the Qlik Cloud GA Search?

 

Thanks

 

 

0 Likes
Patric_Nordstrom
Employee
Employee

@Matsa open the devtools network tab and check that the images load correctly.

 

@marcos_herrera the QGA map view requires a QGA Server, either maps.qlikcloud.com or an on-premise QGA Server. I recommend to use the native map chart instead, it can connect to a WMS and can work without internet connection. Without Internet only the stored geometries and any local map background maps will show. Name lookup and Qlik basemaps will not show.

0 Likes
Version history
Last update:
‎2021-04-02 04:15 AM
Updated by: