Add Google Maps to default basemap.

15 ビュー (過去 30 日間)
Sanjay
Sanjay 2019 年 11 月 14 日
コメント済み: Xiwen Kang 2022 年 9 月 7 日
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
SK- II 2021 年 3 月 24 日
Hello Sanjay:
I face the same issue to you.I'm trying sloving it.Do you have some addvice?

サインインしてコメントする。

採用された回答

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020 年 1 月 21 日
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

その他の回答 (2 件)

Sanjay
Sanjay 2020 年 1 月 21 日
Hello Sahiti,
Thanks.
I was specifically looking for the parameters for Google Maps. However Kunal Patil did send them to me.
Sanjay Abhyankar
  2 件のコメント
Julian
Julian 2020 年 5 月 14 日
Hello Sanjay,
could you share the information for everyone?
Julian
Ali Odeh
Ali Odeh 2021 年 8 月 16 日
Hi Sanjay/ Kunal,
Can you post the parameters for Google Maps?
Thanks,
Ali

サインインしてコメントする。


Ehsan Jalilvand
Ehsan Jalilvand 2021 年 9 月 23 日
編集済み: Ehsan Jalilvand 2021 年 9 月 23 日
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
  1 件のコメント
Xiwen Kang
Xiwen Kang 2022 年 9 月 7 日
Thank you very much. This is very helpful.

サインインしてコメントする。

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by