Update PluginPolyline.java
Patch from
MODIFY
src/android/plugin/google/maps/PluginPolyline.java
src/android/plugin/google/maps/PluginPolyline.java
@@ -271,6 +271,7 @@ public class PluginPolyline extends MyPlugin implements MyPluginInterface {
@Override
public void run() {
List<LatLng> path = polyline.getPoints();
+ if (path.size() > index) {
path.remove(index);
if (path.size() > 0) {
self.objects.put(propertyId, PluginUtil.getBoundsFromPath(path));
@@ -280,6 +281,7 @@ public class PluginPolyline extends MyPlugin implements MyPluginInterface {
polyline.setPoints(path);
}
+ }
});
this.sendNoResult(callbackContext);
}
@@ -300,10 +302,12 @@ public class PluginPolyline extends MyPlugin implements MyPluginInterface {
@Override
public void run() {
List<LatLng> path = polyline.getPoints();
+ if (path.size() > index) {
path.add(index, latLng);
polyline.setPoints(path);
self.objects.put(propertyId, PluginUtil.getBoundsFromPath(path));
}
+ }
});
this.sendNoResult(callbackContext);
}
@@ -321,6 +325,7 @@ public class PluginPolyline extends MyPlugin implements MyPluginInterface {
@Override
public void run() {
List<LatLng> path = polyline.getPoints();
+ if (path.size() > index) {
path.set(index, latLng);
// Recalculate the polygon bounds
@@ -329,6 +334,7 @@ public class PluginPolyline extends MyPlugin implements MyPluginInterface {
polyline.setPoints(path);
}
+ }
});
this.sendNoResult(callbackContext);
}

Update PluginPolyline.java

Patch from https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/eafc184fbd874c5c22aeaa3d19e06a4c99c2a5ad