Prevent undefined error
MODIFY
README.md
README.md
- Update: (js) ionic 4 hides Google Maps view.
- Fix: (Browser) `MarkerCluster.remove()` does not work on browser platform.
- Fix: (Android/iOS/Browser) App crashes (or error) if no panorama available.
+ - Fix: (Android/iOS/Browser) `INFO_CLICK` does not work on marker cluster.
- **v2.4.6**
- Fix: (iOS) Only `src/ios/check_sdk_version.js` error.

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.5.0-beta-20190101-0109" 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.0-beta-20190102-1842" 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/js_CordovaGoogleMaps-for-android_ios.js
www/js_CordovaGoogleMaps-for-android_ios.js
@@ -822,7 +822,7 @@ CordovaGoogleMaps.prototype._remove = function(mapId) {
var self = this;
delete window.plugin.google.maps[mapId];
var map = self.MAPS[mapId];
-
+ if (map) {
var div = map.getDiv();
if (!div) {
div = document.querySelector('[__pluginMapId="' + mapId + '"]');
@@ -839,6 +839,7 @@ CordovaGoogleMaps.prototype._remove = function(mapId) {
delete self.domPositions[elemId];
}
});
+ }
self.MAPS[mapId].destroy();
delete self.MAPS[mapId];

MODIFY
www/js_CordovaGoogleMaps-for-browser.js
www/js_CordovaGoogleMaps-for-browser.js
@@ -175,6 +175,7 @@ CordovaGoogleMaps.prototype.getPanorama = function(div, streetViewOptions) {
CordovaGoogleMaps.prototype._remove = function(mapId) {
var self = this;
var map = self.MAPS[mapId];
+ if (map) {
var div = map.getDiv();
if (!div) {
@@ -185,6 +186,7 @@ CordovaGoogleMaps.prototype._remove = function(mapId) {
}
self.MAPS[mapId].destroy();
+ }
delete self.MAPS[mapId];
map = undefined;
};

Prevent undefined error