使用谷歌地图API的图形页面未经允许图形、页面、地图、API

2023-09-07 17:25:03 作者:ノ阿狸宝宝的小短裤﹌

有谁知道是否有可能使用Android的的图形页面没有给它定位的权限?我只是想呈现一个地图,并留下一个标记,就可以了。我不要求以任何方式用户的位置。

Does anyone know if it's possible to use the Google Maps API for Android's MapView without giving it location permission? I just want to render a map and place a marker on it. I am not asking for the user's location in any way.

我不能使用MapFragment因为我这屋里面来看另一个片段,并且不支持嵌套的片段,直到Android的4.2。

I cannot use the MapFragment because I am housing this view inside another Fragment, and nested fragments aren't supported until Android 4.2.

推荐答案

按照指定Android权限部分:

在以下位置权限的建议,但你可以忽略他们,如果你的应用程序不会访问用户的当前位置,以编程方式或通过启用我的位置层。

The following location permissions are recommended, but you can omit them if your application doesn't access the user's current location, either programmatically or by enabling the My Location layer.

,它应该请求许可的唯一情况是,如果你正在调用 setMyLocationEnabled(真)。

The only case where it should request the permission is if you are calling setMyLocationEnabled(true).