Add Google Maps to default basemap.
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sanjay
am 14 Nov. 2019
Kommentiert: KSSV
am 21 Jul. 2025
Hello, I have the Mapping toolbox and a Google API key. How do I add Google as a basemap? It is not clear from the addCustombasemap documentation.
1 Kommentar
SK- II
am 24 Mär. 2021
Hello Sanjay:
I face the same issue to you.I'm trying sloving it.Do you have some addvice?
Akzeptierte Antwort
Sahithi Kanumarlapudi
am 21 Jan. 2020
In ‘addCustomBasemap(basemapName,URL)’ the parameter ‘basemapname’ refers to the name that you will use to specify your custom basemap. ‘URL’ specifies the website that provides the map data.
For example
name = 'opentopomap';
url = 'a.tile.opentopomap.org';
addCustomBasemap(name,url)
Adds the custom basemap 'opentopomap' to the list of basemaps for use with mapping functions. Now you could use this basemap with mapping functions
0 Kommentare
Weitere Antworten (2)
Ehsan Jalilvand
am 23 Sep. 2021
Bearbeitet: Ehsan Jalilvand
am 23 Sep. 2021
To add google satellite basemap you can use the following code:
ax = geoaxes;
name = 'googleSat'; url = 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}';
addCustomBasemap(name,url)
geobasemap(ax,name)
you can also use other basemaps by changing the URL and choosing a new name for them, here are some other name/URL pairs:
name = 'BingAerial'; url = 'http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1';
name = 'GoogleHybrid'; url = 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}';
name = 'openStreetMap'; url = 'http://tile.openstreetmap.org/{z}/{x}/{y}.png';
- Ehsan
2 Kommentare
KSSV
am 21 Jul. 2025
To use this along with labels: use the url:
url = 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}';
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!