Add: markercluster.addMarkers() method
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="cluster-20170823-1528" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="cluster-20170823-1657" 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
www/MarkerCluster.js
www/MarkerCluster.js
@@ -141,7 +141,7 @@ var MarkerCluster = function(map, markerClusterId, markerClusterOptions, _exec)
writable: false
});
- self.addMarker = function(markerOptions) {
+ self.addMarker = function(markerOptions, skipRedraw) {
idxCount++;
var resolution = self.get("resolution");
@@ -162,7 +162,18 @@ var MarkerCluster = function(map, markerClusterId, markerClusterOptions, _exec)
//marker.set("geocell", geocell, true);
//marker.set("position", markerOptions.position, true);
self._markerMap[markerId] = markerOptions;
+ if (skipRedraw) {
+ return;
+ }
+ self.redraw(true);
+ };
+ self.addMarkers = function(markers) {
+ if (utils.isArray(markers) || Array.isArray(markers)) {
+ for (var i = 0; i < markers.length; i++) {
+ self.addMarker(markers[i], true);
+ }
self.redraw(true);
+ }
};
map.on(event.CAMERA_MOVE_END, self._onCameraMoved.bind(self));

Add: markercluster.addMarkers() method (#18)