Customizing map tiles in QGIS

Basically, there are at least 2 ways of loading map tiles into QGIS. The first way is using the XYZ tiles in the Browser panel. The second way is to install the QuickMapServices plugin.
In the beginning, I will focus on the first option. In the XYZ tiles, you can pick up any map you want. The problem at the very beginning of using QGIS is, that in default only OpenStreetMap is available. However, you can load as many maps as you can (Pic. 1).

QGIS XYZ tiles new connection

Pic. 1 The XYZ tiles list and new connection.

By right-clicking on the XYZ Tiles section you have 3 options. Surely the most important is New Connection…, although sometimes you can use Load Connections… and set a new map by uploading ap tiles stored in the .xml files as discussed in this link and also here.
The tab below (Tab. 1) shows the list of all common map tiles connections, which can be used in QGIS.

Tab 1  list of connections

You can simply copy the link and place it in the input presented in the image below (Pic. 2).

QGIS 3x new connections

Pic. 2 Creating a new XYZ connection in QGIS. The most important inputs are bounded red.

Now the second way seems to be more beneficial, because of the range of map canvas provided. This is the QuickMapServices (QMS) plugin developed by Nextgis.com, which can be installed from the Plugins panel. Next, the installed plugin can be found in the Web section (Pic. 3).

QGIS Quick Map Services plugin place

Pic. 3 The place where a user can find the QMS plugin in QGIS.

Now, the most important thing is the spectrum of options (map services) available in this plugin. Formerly a user could count on a wide dropdown list of various base maps. Now, this list is slimmed down significantly, as we can see just a few options available (Pic. 3). Instead of this huge list of base maps, we can use the Search QMS option, where after starting to type something a user receives the list of possible map tiles to load (Pic. 4).

QGIS QuickMapServices search basemaps

Pic. 3 Searching basemaps in QuickMapServices (QMS) plugin.

 

The primary feature which came out of this huge upgrade of the plugin is the flexibility within the choice of basemaps. The list, which is provided initially, even with the search results applied isn’t closed down. There is still an option to add your own basemap, which must be approved by the QMS community. One of the ways is selecting Add to Search from the main options (Pic. 2). This option redirects you to this link, which requires setting up your private account. Next someone, who has appropriate privileges must approve your map. Another way is adding the base map via Github. The wide possibility of adding various map tiles makes the QMS plugin significantly maintained by the community.

Let’s consider other, non-standard ways of providing map tiles to our QGIS project.
There is another way, which would allow the user to load the map tiles smoothly. It’s the Tile+ plugin. After installation, we can find it in the Plugins dropdown and use it as shown in the image (Pic. 4) or video below.

QGIS Tile+ plugin map selection

Pic. 4 The usage of Tile+ plugin – finding the plugin after installation and selecting the map tiles.

The Tile+ plugin is something new, which can be treated as the successor of the TileLayerPlugin, compatible with QGIS versions 2x.

Another method for adding the map tiles to the QGIS project is using the Python console, where the user can provide the Python code available under this link. In this event, he is getting most of the available XYZ tiles (Pic. 5).

QGIS XYZ tiles Python console

Pic. 5 Getting XYZ tiles by using Python in QGIS (opengislab.com).

Each provided map can be managed quickly by using some hotkeys, which make a nice shortcut for our work.
By using the mouse, you can zoom in and out. It happens so quickly. In order to have the zoom level changes under control, we can keep the Ctrl when scrolling our mouse. The full specificity of hotkeys used for browsing the main map is listed in the table below (Tab. 2).

Tab. 2 Hot keys for general QGIS map canvas

Apart from successfully providing our map canvas, we need to be aware of some styling possible. The key thing is, that our map canvas can be customized widely, containing about 50% of the options available for the raster layer.

Map canvas symbology and transparency options

Pic. 6 Customizing of the QGIS map canvas options: upper image – Symbology, lower image – Transparency.

 

OpenStreetMap default and customized QGIS

Pic. 7 The OpenStreetMap canvas is default and customized below.

Moreover, we can fetch the random map tile to our project or even more than 1. They are in fact quite heavy but can be useful simultaneously when needed. Every individual setting applied here goes straight to the print layout or export map as the image. Apart from the coloration important is the map transparency, which might be useful, especially for overlays i.e. with satellite imagery (Pic. 8, 9).

QGIS Mapy.cz and satellite imagery

Pic. 8 Combining the Mapy.cz map tiles with Google Satellite imagery underneath. The “Darken” blending mode has been applied with 50% of transparency, making just tourist trails and some peaks visible.

OpenStreetMap + Satellite imagery in QGIS

Pic. 9 The combination of modified OpenStreetMap overlaying Google Satellite imagery in QGIS.

Mariusz Krukar

Links:

  1. https://mariosmsk.wordpress.com/2019/07/01/how-to-add-xyz-tiles-with-two-ways-qgis/
  2. https://stuyts.xyz/2020/07/02/how-to-import-many-new-wms-wmts-wfs-or-xyz-tile-services-into-qgis/
  3. https://silverspringenergy.com/adding-xyz-tiles-to-a-qgis-project/
  4. https://digital-geography.com/qgis-quickmapservices/
  5. https://nextgis.com/blog/quickmapservices/
  6. https://opensourceoptions.com/blog/how-to-add-basemaps-in-qgis/
  7. https://github.com/nextgis/quickmapservices_contrib
  8. https://geographicalanalysis.com/gis-blog/download-tile-plus-plugin-qgis/
  9. https://opengislab.com/blog/2018/4/15/add-basemaps-in-qgis-30
  10. https://atcoordinates.info/2020/12/17/adding-basemaps-to-qgis-with-web-mapping-services/
  11. https://raw.githubusercontent.com/klakar/QGIS_resources/master/collections/Geosupportsystem/python/qgis_basemaps.py
  12. https://gis.stackexchange.com/questions/169286/raster-layer-not-visible-after-changing-color-rendering-in-qgis

 

Forums:

  1. https://www.reddit.com/r/QGIS/comments/9ht36l/satellite_imagery_xyz_tiles/
  2. https://gis.stackexchange.com/questions/20191/adding-basemaps-from-google-or-bing-in-qgis
  3. https://gis.stackexchange.com/questions/320921/citation-of-base-maps
  4. https://gis.stackexchange.com/questions/82075/adding-custom-map-tile-layer-using-qgis

 

Youtube: