Issue
Is it possible to show location icon just like official android application see image for further reference.
I'm using below code to show icon but not working
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
Solution
I got the solution
According to google api to enable location button you must enable location layer and
To enable the My Location layer in your application, you must first add the ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions to your application as a child of the element in your Android manifest.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Take a look at here
https://developers.google.com/maps/documentation/android/location
Answered By - Key_coder
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.