Fix: (Android/iOS/Browser) MarkerCluster.remove() causes null pointer error.
MODIFY
README.md
README.md
-# Cordova GoogleMaps plugin for Android, iOS and Browser v2.5.1-beta
+# Cordova GoogleMaps plugin for Android, iOS and Browser v2.5.2-beta
-| Download | Build test (master branch)|
+| Download | Build test (multiple_maps branch)|
|----------|---------------------------|
| [![](https://img.shields.io/npm/dm/cordova-plugin-googlemaps.svg)](https://npm-stat.com/charts.html?package=cordova-plugin-googlemaps) |[![](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps.svg?branch=multiple_maps)](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps/branches) |
---------------------------------------------------------------------------------------------------------
## Release Notes
+ - **v2.5.2**
+ - Fix: (Android/iOS/Browser) MarkerCluster.remove() causes null pointer error.
+
- **v2.5.1**
- Fix: (Android/iOS/Browser) Marker cluster does not work when you zoom in.
- Fix: (iOS) HTML click detection is incorrect.

MODIFY
package.json
package.json
{
"name": "cordova-plugin-googlemaps",
- "version": "2.5.1-beta-20190217-2219",
+ "version": "2.5.2-beta-20190219-1000",
"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.1-beta-20190217-2219" 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-20190219-1000" 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
www/MarkerCluster.js
www/MarkerCluster.js
@@ -281,7 +281,7 @@ MarkerCluster.prototype.remove = function (callback) {
});
self.trigger('remove');
- var activeMarkerId = activeMarker ? activeMarker.getId() : null;
+ var activeMarkerId = activeMarker ? activeMarker.getId() : '';
activeMarkerId = activeMarkerId.replace(/^.+\-/, '');
var marker;
if (resolution === self.OUT_OF_RESOLUTION) {
@@ -566,7 +566,8 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
//console.log('---->548');
var activeMarker = self.map.get('active_marker');
- var activeMarkerId = activeMarker ? activeMarker.getId() : null;
+ var activeMarkerId = activeMarker ? activeMarker.getId() : '';
+ activeMarkerId = activeMarkerId.replace(/^.+\-/, '');
if (prevResolution === self.OUT_OF_RESOLUTION) {
if (resolution === self.OUT_OF_RESOLUTION) {
//--------------------------------------

Fix: (Android/iOS/Browser) MarkerCluster.remove() causes null pointer error.
https://github.com/ionic-team/ionic-native-google-maps/issues/173