(update) improve the touch performance
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.1.2-beta-20171227-1634" 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.1.2-beta-20171227-1830" 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/Common.js
www/Common.js
@@ -311,7 +311,7 @@ function getZIndex(dom) {
}
if (z === "auto") {
- z = 1;
+ z = 0;
} else if (z === "inherit") {
z = 0;
} else if (z === "initial" || z === "unset") {

MODIFY
www/googlemaps-cdv-plugin.js
www/googlemaps-cdv-plugin.js
@@ -550,19 +550,32 @@ if (!cordova) {
};
if (element.children.length > 0) {
- var child;
- for (var i = 0; i < element.children.length; i++) {
+ var child, maxChild, childId, maxChildId = null;
+ var maxZIndex = Math.log(0);
+ for (var i = element.children.length - 1; i >= 0; i--) {
child = element.children[i];
if (doNotTraceTags.indexOf(child.tagName.toLowerCase()) > -1 ||
!common.shouldWatchByNative(child)) {
continue;
}
- var childId = getPluginDomId(child);
+ zIndex = common.getZIndex(child);
+ if (zIndex > maxZIndex) {
+ maxChildId = getPluginDomId(child);
+ maxZIndex = zIndex;
+ maxChild = child;
+ }
+ if (child.hasAttribute("__pluginMapId")) {
+ childId = getPluginDomId(child);
domPositions[elemId].children.push(childId);
traceDomTree(child, childId);
}
}
+ if (maxChildId) {
+ domPositions[elemId].children.push(maxChildId);
+ traceDomTree(maxChild, maxChildId);
+ }
+ }
}
// This is the special event that is fired by the google maps plugin

(update) improve the touch performance #1756