Cannot see the blue dot and circle at Mylocation Maps

我的梦境 提交于 2019-12-02 10:34:33

Try Code samples of Google.

The ApiDemos repository on GitHub includes samples that demonstrate the use of location on a map:

You can use the My Location layer and the My Location button to provide your user with their current position on the map.

Note: Before enabling the My Location layer, you must ensure that you have the required runtime location permission.

Enable the My Location layer on the map as follows:

mMap.setMyLocationEnabled(true);

When the My Location layer is enabled, the My Location button appears in the top right corner of the map. When a user clicks the button, the camera centers the map on the current location of the device, if it is known. The location is indicated on the map by a small blue dot if the device is stationary, or as a chevron if the device is moving.

You can always check and compare your codes to the sample code to verify or check if your implementation is correct.

Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!