Bug fix: HTMLInfoWindows are overlaying each other on iOS when clicking directly on the next marker
MODIFY
README.md
README.md
@@ -111,3 +111,15 @@ function onBtnClicked() {
### Documentation
[All documentations are here!!](https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md)
+
+-----
+
+### Buy me a beer
+
+I have been spend tons of time for this plugin project, but even though the plugin is still free.
+
+I appreciate if you donate some amount to help this project from this button.
+
+[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=SQPLZJ672HJ9N&lc=US&item_name=cordova%2dgooglemaps%2dplugin&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
+
+The donated amount is used for buying testing machine (such as iPhone, Android) or new software.

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta2-20170714-1033" 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-20170714-1245" 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
@@ -166,6 +166,8 @@ var HTMLInfoWindow = function() {
isInfoOpenFired = true;
self.trigger(event.INFO_OPEN);
}
+
+ cordova.fireDocumentEvent('plugin_touch', {});
});
self.on(event.INFO_CLOSE, function() {
isInfoOpenFired = false;
@@ -188,6 +190,7 @@ HTMLInfoWindow.prototype.close = function() {
if (!self.isInfoWindowShown() || !marker) {
return;
}
+ marker.set("infoWindow", undefined);
this.set('marker', undefined);
var map = marker.getMap();
@@ -223,8 +226,10 @@ HTMLInfoWindow.prototype.open = function(marker) {
return;
}
var map = marker.getMap();
- var self = this;
+ var self = this,
+ markerId = marker.getId();
+ marker.set("infoWindow", self);
map.fromLatLngToPoint(marker.getPosition(), function(point) {
map.set("infoPosition", {x: point[0], y: point[1]});

MODIFY
www/Marker.js
www/Marker.js
@@ -51,6 +51,8 @@ var Marker = function(map, id, markerOptions) {
if (markerOptions.infoWindow) {
console.log("[deprecated] the infoWindow option is deprecated. Please use event listener.");
+ }
+
self.on(event.INFO_OPEN, function() {
if (map.get("active_marker_id") === id) {
return;
@@ -70,7 +72,6 @@ var Marker = function(map, id, markerOptions) {
self.on(event.MARKER_CLICK, function() {
self.trigger(event.INFO_OPEN);
});
- }
self.on("position_changed", function(oldValue, position) {
@@ -265,7 +266,8 @@ Marker.prototype.hideInfoWindow = function() {
};
Marker.prototype.isInfoWindowShown = function() {
var map = this.getMap();
- return map && map.get('active_marker_id') === this.id;
+ return map && (map.get('active_marker_id') === this.id ||
+ this.get("infoWindow"));
};
Marker.prototype.isVisible = function() {
return this.get("visible") === true;

Bug fix: HTMLInfoWindows are overlaying each other on iOS when clicking directly on the next marker (#1555)