diff --git a/src/android/plugin/google/maps/PluginMap.java b/src/android/plugin/google/maps/PluginMap.java index d4188bd73..d33b37f17 100644 --- a/src/android/plugin/google/maps/PluginMap.java +++ b/src/android/plugin/google/maps/PluginMap.java @@ -186,7 +186,7 @@ public void getMap(final JSONArray args, final CallbackContext callbackContext) } - if (controls.has("myLocationButton") || controls.has("myLocation")) { + if ((controls.has("myLocationButton") && controls.getBoolean("myLocationButton")) || (controls.has("myLocation") && controls.getBoolean("myLocation"))) { // Request geolocation permission. boolean locationPermission = PermissionChecker.checkSelfPermission(cordova.getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) == PermissionChecker.PERMISSION_GRANTED;