New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Zoom Control & Location Button Customization #104
Conversation
Allowing the user to set not only `MyLocationEnabled` but also `ZoomControlsEnabled` and `MyLocationButtonEnabled`
Zoom Controls & Location Button
Not sure about `isZoomControlsEnabled` & `isMyLocationButtonEnabled` will need to look more into the Google Maps JS API
@@ -267,11 +264,7 @@ public void onMapClick(LatLng latLng) { | |||
} | |||
|
|||
@Override public void setMyLocationEnabled(boolean enabled) { | |||
if (myLocationEnabled != enabled) { | |||
if (RuntimePermissionUtils.checkLocationPermissions(getActivity(), this)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the myLocationEnabled
flag here on NativeGoogleMapFragment
doesn't require location permissions. If anything I think this check should live on within onLocationPermissionsGranted
here https://github.com/forrestbice/AirMapView/blob/30b6f1e28836e6c9e737cd41548b64b761b23035/library/src/main/java/com/airbnb/android/airmapview/NativeGoogleMapFragment.java#L270 but since the caller is responsible for calling onLocationPermissionsGranted
it seemed fine to offload the responsibility of the permission check as well. Note: The //noinspection MissingPermission
lint flag was already present within onLocationPermissionsGranted
|
||
@Override public void setMyLocationButtonEnabled(boolean enabled) { | ||
// no-op | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these not supported by the google maps js api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to find it but I'm not super familiar with the JS library. Was looking here https://developers.google.com/maps/documentation/javascript/reference. Let me know if I should be looking elsewhere
@felipecsl if you're willing to look at my comment responses I'll go ahead and rebase this to resolve conflicts |
Closing this as I never got a response from @felipecsl. However, if you're able to take a look I'll rebase this when I can. Closing for now. |
Allowing the user to set not only
MyLocationEnabled
but alsoZoomControlsEnabled
andMyLocationButtonEnabled
Attempts to address #103