(Android) Fix: setMyLocationEnabled(false) does not work
MODIFY
package.json
package.json
{
"name": "cordova-plugin-googlemaps",
- "version": "2.5.2-beta-20190219-1000",
+ "version": "2.5.2-beta-20190228-1054",
"description": "Google Maps native SDK for Android and iOS, and Google Maps JavaScript API v3 for browser.",
"cordova": {
"id": "cordova-plugin-googlemaps",

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.5.2-beta-20190220-1210" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.5.2-beta-20190228-1054" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="Promise" src="www/Promise.js" />
<asset src="www/promise-7.0.4.min.js.map" target="promise-7.0.4.min.js.map" />

MODIFY
src/android/plugin/google/maps/PluginMap.java
src/android/plugin/google/maps/PluginMap.java
@@ -1806,22 +1806,6 @@ public class PluginMap extends MyPlugin implements OnMarkerClickListener,
public void setMyLocationEnabled(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
final JSONObject params = args.getJSONObject(0);
- Boolean isMyLocationEnabled = false;
- if (params.has("myLocation")) {
- //Log.d(TAG, "--->myLocation = " + params.getBoolean("myLocation"));
- isMyLocationEnabled = params.getBoolean("myLocation");
- }
-
- Boolean isMyLocationButtonEnabled = false;
- if (params.has("myLocationButton")) {
- //Log.d(TAG, "--->myLocationButton = " + params.getBoolean("myLocationButton"));
- isMyLocationButtonEnabled = params.getBoolean("myLocationButton");
- }
- // Request geolocation permission.
- if (!isMyLocationButtonEnabled && !isMyLocationEnabled) {
- callbackContext.success();
- return;
- }
boolean locationPermission = PermissionChecker.checkSelfPermission(cordova.getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) == PermissionChecker.PERMISSION_GRANTED;
//Log.d(TAG, "---> setMyLocationEnabled, hasPermission = " + locationPermission);
@@ -1883,6 +1867,7 @@ public class PluginMap extends MyPlugin implements OnMarkerClickListener,
}
});
}
+
/**
* Clear all markups
* @param args Parameters given from JavaScript side

(Android) Fix: setMyLocationEnabled(false) does not work (#2567)