fix: getMyLocation() does not work
working: still adjusting the default marker size for HtmlInfoWindow
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180120-0030" 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.2.0-beta-20180120-0054" 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="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/android/plugin/google/maps/PluginGeolocation.java
src/android/plugin/google/maps/PluginGeolocation.java
@@ -22,7 +22,6 @@ import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationCallback;
-import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;
import com.google.android.gms.location.LocationServices;
@@ -121,7 +120,7 @@ public class PluginGeolocation extends CordovaPlugin {
return;
}
}
- if (Calendar.getInstance().getTimeInMillis() - lastLocation.getTime() <= 2000) {
+ if (lastLocation != null && Calendar.getInstance().getTimeInMillis() - lastLocation.getTime() <= 2000) {
//---------------------------------------------------------------------
// If the user requests the location in two seconds from the last time,
// return the last result in order to save battery usage.
@@ -146,7 +145,7 @@ public class PluginGeolocation extends CordovaPlugin {
@Override
public void onConnected(Bundle connectionHint) {
- Log.e(TAG, "===> onConnected");
+ Log.d(TAG, "===> onConnected");
PluginGeolocation.this.sendNoResult(callbackContext);
_checkLocationSettings(isHigh, callbackContext);
@@ -176,6 +175,8 @@ public class PluginGeolocation extends CordovaPlugin {
googleApiClient.connect();
} else if (googleApiClient.isConnected()) {
_checkLocationSettings(isHigh, callbackContext);
+ } else {
+ Log.e(TAG, "===> googleApiClient.isConnected() is not connected");
}
}

MODIFY
src/android/plugin/google/maps/PluginMarker.java
src/android/plugin/google/maps/PluginMarker.java
@@ -215,8 +215,8 @@ public class PluginMarker extends MyPlugin implements MyPluginInterface {
}
} else {
try {
- result.put("width", 60 / density);
- result.put("height", 108 / density);
+ result.put("width", 25 * density);
+ result.put("height", 30 * density);
} catch (Exception e) {
e.printStackTrace();
}

MODIFY
src/ios/GoogleMaps/PluginGeolocation.m
src/ios/GoogleMaps/PluginGeolocation.m
NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
- if (timeStamp - self.lastLocation.timestamp.timeIntervalSince1970 < 2000) {
+ if (self.lastLocation && timeStamp - self.lastLocation.timestamp.timeIntervalSince1970 < 2000) {
//---------------------------------------------------------------------
// If the user requests the location in two seconds from the last time,
// return the last result in order to save battery usage.

- fix: getMyLocation() does not work
- working: still adjusting the default marker size for HtmlInfoWindow