Bug fix: can not click on the elements in HtmlInfoWindow
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180124-1000" 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.2.0-beta-20180124-1147" 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
@@ -65,9 +65,9 @@ var HTMLInfoWindow = function() {
anchorDiv.setAttribute("class", "pgm-anchor");
anchorDiv.style.overflow="visible";
anchorDiv.style.position="absolute";
- //anchorDiv.style.display = "inline-block";
- anchorDiv.style.width = '1px';
- anchorDiv.style.height = '1px';
+ anchorDiv.style["z-index"] = 0;
+ anchorDiv.style.width = 0;
+ anchorDiv.style.height = 0;
//anchorDiv.style.border = "1px solid green";
//anchorDiv.style.backgroundColor = "rgba(125, 125, 255, 0.5)";

MODIFY
www/Map.js
www/Map.js
@@ -36,12 +36,10 @@ var Map = function(id, _exec) {
infoWindowLayer.style.position = "absolute";
infoWindowLayer.style.left = 0;
infoWindowLayer.style.top = 0;
- infoWindowLayer.style.right = 0;
- infoWindowLayer.style.bottom = 0;
- infoWindowLayer.style.width = "100%";
- infoWindowLayer.style.height = "100%";
- infoWindowLayer.style.zIndex = -100000;
- infoWindowLayer.style["pointer-events"] = "none";
+ infoWindowLayer.style.width = 0;
+ infoWindowLayer.style.height = 0;
+ infoWindowLayer.style.overflow = "visible";
+ infoWindowLayer.style["z-index"] = 0;
Object.defineProperty(self, "_layers", {
value: {
@@ -182,9 +180,18 @@ Map.prototype.getMap = function(mapId, div, options) {
//------------------------------------------------------------------------
var div = self.get("div");
if (common.isDom(div)) {
+
+ // Insert the infoWindow layer
if (self._layers.info.parentNode) {
self._layers.info.parentNode.removeChild(self._layers.info.parentNode);
}
+ var positionCSS;
+ for (var i = 0; i < div.children.length; i++) {
+ positionCSS = common.getStyle(div.children[i], "position");
+ if (positionCSS === "static") {
+ div.children[i].style.position = "relative";
+ }
+ }
div.insertBefore(self._layers.info, div.firstChild);
@@ -680,9 +687,18 @@ Map.prototype.setDiv = function(div) {
self.set("div", null);
} else {
div.setAttribute("__pluginMapId", self.id);
+
+ // Insert the infoWindow layer
if (self._layers.info.parentNode) {
self._layers.info.parentNode.removeChild(self_.layers.info.parentNode);
}
+ var positionCSS;
+ for (var i = 0; i < div.children.length; i++) {
+ positionCSS = common.getStyle(div.children[i], "position");
+ if (positionCSS === "static") {
+ div.children[i].style.position = "relative";
+ }
+ }
div.insertBefore(self._layers.info, div.firstChild);
// Webkit redraw mandatory
@@ -693,7 +709,7 @@ Map.prototype.setDiv = function(div) {
self.set("div", div);
- var positionCSS = common.getStyle(div, "position");
+ positionCSS = common.getStyle(div, "position");
if (!positionCSS || positionCSS === "static") {
div.style.position = "relative";
}

Bug fix: can not click on the elements in HtmlInfoWindow