Finally QGIS 3 was released and I am so pleased for that. QGIS 3.0 Girona brings many features and updates such as improved geometry editing, symbols, layout, 3D layer, etc. What about plugins? I found many plugins already ported to QGIS 3, but unfortunately not all, including one of my favorite OpenLayers plugin, which can be used to add Google Maps basemap into QGIS map canvas such as Google Satellite, terrain and road map. What could we do to add those Google Maps layers in QGIS 3.0? Is there any other way around so we can still use Google Map in QGIS? The answer is Yes and I will show it in this tutorial.
Google Maps Layer is hosting somewhere in Google server and sends the tile to the user who request it. Technically we call this as Tile Map Service (TMS). So, we just need to find the TMS which Google uses to serve Google Maps layers. After searching for a while, finally I found the Google Maps Layer TMS that are listed below:
- Google Maps: https://mt0.google.com/vt/lyrs=m&x={x}&y={y}&z={z}
- Google Satellite: https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
- Google Satellite Hybrid: https://mt0.google.com/vt/lyrs=y&x={x}&y={y}&z={z}
- Google Terrain: https://mt1.google.com/vt/lyrs=t&x={x}&y={y}&z={z}
- Google Terrain Hybrid: https://mt1.google.com/vt/lyrs=p&x={x}&y={y}&z={z}
- Google Roads: https://mt1.google.com/vt/lyrs=h&x={x}&y={y}&z={z}
Google also provide some additional layer type such as traffic, transit and bycle. Add the the layer type after basemap option If you want to add it. For example, to add traffic layer over google satellite basemap, the TMS url will be:
https://mt0.google.com/vt/lyrs=s,traffic&x={x}&y={y}&z={z}
Adding Google Maps Layers in QGIS 3
Then how to add the Google Maps tile service in QGIS 3? Simply, we uses XYZ Tiles. For example we want to add a Google Maps layer as a basemap. We can do it with the following steps:1. Make a new connection, with right click the XYZ Tiles as in figure 1.
Figure 1. Make a new connection in XYZ Tiles |
Figure 2. XYZ Tiles connection details |
Figure 3. Google Maps Layers in QGIS |
With the same steps, the other Google basemap layers like Google Terrain, Google Satellite, etc, can be added to QGIS 3. I captured some of the results in the images below.
Figure 4. Google Terrain Layer in QGIS 3 |
Figure 5. Google Satellite Layer in QGIS 3 |
Furthermore you can also save the google maps layer into your machine. Check out this tutorial How to save google map satellite imagery for more explanation.
Tile+ Plugin
Before finishing this post, I would like to introduce a plugin which is called Tile+. This Plugin provides some popular basemap like OSM, Bing, ESRI, Google, Stamen and also some updated earth data like rainfall rate, earth visibility, sea surface temperature, etc. This plugin enable user to load basemap easily to QGIS 3.x map canvas just like Openlayers plugin for QGIS 2.X. You can find more information about Tile+ plugin here.