Bug fix: HTMLInfoWindow
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta2-20170624-1408" 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.0.0-beta2-20170625-1805" 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/HtmlInfoWindow.js
www/HtmlInfoWindow.js
@@ -212,10 +212,10 @@ HTMLInfoWindow.prototype.open = function(marker) {
map.bindTo("infoPosition", self);
marker.bindTo("infoWindowAnchor", self);
marker.bindTo("icon", self);
- marker.on(event.INFO_CLOSE, self.close.bind(self));
+ //marker.on(event.INFO_CLOSE, self.close.bind(self));
self.set("marker", marker);
map.set("active_marker_id", marker.getId());
- self.trigger("infoWindowAnchor_changed");
+ self.trigger.call(self, "infoWindowAnchor_changed");
});
};

MODIFY
www/Map.js
www/Map.js
@@ -39,8 +39,11 @@ var Map = function(id) {
writable: false
});
- self.on("active_marker_id_changed", function() {
- exec(null, null, self.id + "-marker", 'setActiveMarkerId', [self.get("active_marker_id")]);
+ self.on("active_marker_id_changed", function(prevId, newId) {
+ if (prevId in self.MARKERS) {
+ self.MARKERS[prevId].trigger.call(self.MARKERS[prevId], event.INFO_CLOSE);
+ }
+ exec(null, null, self.id + "-marker", 'setActiveMarkerId', [newId]);
});
};

MODIFY
www/Marker.js
www/Marker.js
@@ -62,7 +62,6 @@ var Marker = function(map, id, markerOptions) {
}
});
self.on(event.INFO_CLOSE, function() {
- map.set('active_marker_id', undefined);
if (markerOptions.infoWindow) {
markerOptions.infoWindow.close(self);
@@ -257,6 +256,10 @@ Marker.prototype.showInfoWindow = function() {
return this;
};
Marker.prototype.hideInfoWindow = function() {
+ var map = this.getMap();
+ if (map) {
+ map.set('active_marker_id', undefined);
+ }
exec(null, this.errorHandler, this.getPluginName(), 'hideInfoWindow', [this.getId()]);
return this;
};

Bug fix: HTMLInfoWindow