2

Using Google map in Leaflet

 1 year ago
source link: https://aungkoman.github.io/howto/2023/06/28/google-map-in-leaflet.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Using Google map in Leaflet

Google Map

I know this is too late to answer this question. But I want to share my knowledge in this question. For the static purpose you can freely add the google map tiles inside your leaflet. For the static tiles, you can add following code, for street,

googleStreets = L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{
    maxZoom: 20,
    subdomains:['mt0','mt1','mt2','mt3']
});
//Hybrid,

googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}',{
    maxZoom: 20,
    subdomains:['mt0','mt1','mt2','mt3']
});
//satellite,

googleSat = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{
    maxZoom: 20,
    subdomains:['mt0','mt1','mt2','mt3']
});
//Terrain

googleTerrain = L.tileLayer('http://{s}.google.com/vt/lyrs=p&x={x}&y={y}&z={z}',{
    maxZoom: 20,
    subdomains:['mt0','mt1','mt2','mt3']
});
/*
Note that difference in the "lyrs" parameter in the URL:

Hybrid: s,h;
Satellite: s;
Streets: m;
Terrain: p;
*/

Ref; https://gis.stackexchange.com/questions/225098/using-google-maps-static-tiles-with-leaflet

Written on June 28, 2023

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK