如何在二维视图中显示谷歌地图? [英] How to display google maps in 2D view?
问题描述
我在本教程后创建了一个自定义地图样式
https://www.youtube.com/watch?v=sLZxAB1el6w
我现在面临的问题是,我想在2D视图中显示地图而不是默认的地球3D视图,我不想启用指南针,我相信您可以在2个视图之间切换。
如果您可以分享有关这方面的任何信息,这将非常有帮助。
谢谢
我想你要找的是MapType:
@Override
public void onMapReady(GoogleMap map){
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
来自api文档:
public static final int MAP_TYPE_HYBRID
具有大街道透明层的卫星地图。
public static final int MAP_TYPE_NONE
无底图贴图。
public static final int MAP_TYPE_NORMAL
基本地图。
public static final int MAP_TYPE_SATELLITE
没有标签的卫星地图。
public static final int MAP_TYPE_TERRAIN
地形图。 p>
希望这有助于您。
I have created a custom map styling following this tutorial
https://www.youtube.com/watch?v=sLZxAB1el6w
The issue i am facing now is that i want to display the Map in 2D view rather than the earth 3D view by default i don't want to enable compass using which i believe you can switch between 2 views.
It would be really helpful if you could share any information regarding this.
Thanks
I think what your looking for is the MapType:
@Override
public void onMapReady(GoogleMap map) {
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
From the api docs :
public static final int MAP_TYPE_HYBRID
Satellite maps with a transparent layer of major streets.
public static final int MAP_TYPE_NONE
No base map tiles.
public static final int MAP_TYPE_NORMAL
Basic maps.
public static final int MAP_TYPE_SATELLITE
Satellite maps with no labels.
public static final int MAP_TYPE_TERRAIN
Terrain maps.
Hope this helps.
这篇关于如何在二维视图中显示谷歌地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!