5

Could someone let me know how I add a API key to QGIS 2.14.10. The diagonal API key required is still on my map layer. Bit of a novice on QGIS.

1

3 Answers 3

7

I guess you are using the QOSM plugin to display the OpenCycleMap, since the standard OSM map does not have API keys.

You can obtain an API key from the map producer Thunderforest. They provide details here, including a sample tile request URL. You can add that to the properties of the QOSM layer, inserting the line

http://a.tile.thunderforest.com/cycle/${z}/${x}/${y}.png?apikey=<insert-your-apikey-here>

and clicking on Add Custom Type. Take care of the grammar for the variables that differs from the linked site.


UPDATE

Alternatively, you can use the QuickMapServices plugin, go to Settings, Add/Edit/Remove, My services, upper right icon (Create service from existing) , select OSM TF Landscape, go to the TMS panel, and edit the URL as above.

6
  • QuickMapServices works like a charm! Find the menu under "Web" the same as "OpenLayersPlugin". Commented May 19, 2017 at 4:41
  • @AndreJ, please, can you specify where exactly to insert the line with my API key "http://.."? When I open Properties of OSM layer (left click on the layer in the Layer Panel), there is no option to insert the specified line. Thank you!
    – maycca
    Commented May 1, 2018 at 18:15
  • 1
    @maycca in the QOSM plugin, go to the settings, Custom Tile Types. With QMS, you have to create a new custom tile provider.
    – AndreJ
    Commented May 2, 2018 at 5:56
  • I recently went through this again and I found I had to remove the a. at the start of the url before it would work. The urls I got from thunderforest were https://{s}.title... QGIS did not cope with https (unknown protocol!) and until I removed the {s}. they seemed to load an empty layer. what I have now is tile.thunderforest.com/landscape/${z}/${x}/${y}.png?apikey=<insert-your-apikey-here> Commented Oct 31, 2018 at 23:56
  • @AndreJ there is no such option in the plug in setting. I have an API key from the Thunderforest website but is not clear to me where to enter it. Commented Jan 5, 2020 at 19:29
3

A very similar question was also answered here.

Again, if you are using the OpenLayers Plugin, this should work:

  1. If necessary, update OpenLayers Plugin to at least version 1.4.2
  2. Web > OpenLayer plugin > OSM/Thunderforest > Set API Key
  3. Enter API Key and confirm with OK
  4. Add the OSM layer from the OSM/Thunderforest menu again (previous layer(s) will not update even with API key entered)

PS: As already mentioned earlier, API keys are available for free from http://www.thunderforest.com/docs/apikeys/

2
  • 1
    OpenLayers doesn't seem to be a plugin in QGIS3. I think it's functionality was rolled into the QuickMapServices plugin, which has different configuration menus than explained above. See gis.stackexchange.com/questions/272778/…
    – Dave X
    Commented Mar 11, 2019 at 14:54
  • Indeed, it was replaced by core functions or QuickMapServices. Even better, I would say (this thing with the API key is imo kinda annoying, as the OSM layers are anyway public property). Still, on my QGIS 3.10.5-A Coruña the functionality is still there; looks like it just remained there with the last updates and I didn't even notice any change. :) Commented May 11, 2020 at 17:34
0

It isn't the QuickOSM plugin in QGIS3, or the Web/QuickMap Services/OSM/... menu, but with base QGIS3, under the Browser panel, you can add the apikey services as XYZ Tiles raster maps:

1) Right click Browser/XYZ Tiles 2) Choose "New Connection" 3) Add a descriptive name. E.g.: "OSM Landscape" 4) Add a URL with api key E.g.: https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=3333333e97ba38423f5bef103f39bdb3

Then you can add your new layer to your projects by working through the Layer Browser / XYZ Tiles/ Add Layer To Project.

If you are getting diagonal 'API Key Required' watermarks on your OSM layer with a 'TF ...' prefix, it's likely an add-on to a raster layer as delivered by the OSM's tileservice delivered by ThunderForest. See http://www.thunderforest.com/docs/apikeys/ for some details. I'm not sure how to reconfigure QGIS3's Web/QuickMapServices/OSM to use a Thunderforest API Key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.