Add Google Maps to default basemap.
古いコメントを表示
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 件のコメント
SK- II
2021 年 3 月 24 日
Hello Sanjay:
I face the same issue to you.I'm trying sloving it.Do you have some addvice?
採用された回答
その他の回答 (2 件)
Ehsan Jalilvand
2021 年 9 月 23 日
編集済み: Ehsan Jalilvand
2021 年 9 月 23 日
1 投票
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 件のコメント
Xiwen Kang
2022 年 9 月 7 日
Thank you very much. This is very helpful.
KSSV
2025 年 7 月 21 日
To use this along with labels: use the url:
url = 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}';
カテゴリ
ヘルプ センター および File Exchange で Web Map Service についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!