Fix: can not tap on HTMLInfoWindow on iOS
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.5.0-beta-20190123-2007" 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-20190124-1620" 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
src/android/plugin/google/maps/MyPluginLayout.java
src/android/plugin/google/maps/MyPluginLayout.java
@@ -525,8 +525,9 @@ public class MyPluginLayout extends FrameLayout implements ViewTreeObserver.OnSc
zIndexValue = HTMLNodes.get(grandChildId).getBundle("zIndex").getInt("z");
}
rect = HTMLNodeRectFs.get(grandChildId);
- rect2 = new RectF(rect);
+ //rect2 = new RectF(rect);
//Log.d(TAG, "---findClickedDom("+ childId + ") -> " + grandChildId + ",rect = " + rect2.toShortString());
+ /*
if (overflow1 != null && !"root".equals(domId) ) {
overflow1.rect = new RectF(HTMLNodeRectFs.get(domId));
if (overflow1.cropX) {
@@ -542,7 +543,8 @@ public class MyPluginLayout extends FrameLayout implements ViewTreeObserver.OnSc
// " overflowX = " + overflowX + ", overflowY = " + overflowY +
// " cropX = " + overflow1.cropX + ", cropY = " + overflow1.cropY);
}
- if (!rect2.contains(clickPoint.x, clickPoint.y)) {
+ */
+ if (!rect.contains(clickPoint.x, clickPoint.y)) {
//Log.e(TAG, "----the click point is not in this element(" +grandChildId + "), rect = " + rect2.toShortString() + ", click = " + clickPoint.x + "," + clickPoint.y );
continue;
}
@@ -570,17 +572,17 @@ public class MyPluginLayout extends FrameLayout implements ViewTreeObserver.OnSc
}
rect = HTMLNodeRectFs.get(domId);
rect2 = new RectF(rect.left, rect.top, rect.right, rect.bottom);
- if (overflow1 != null ) {
- overflow1.rect = new RectF(HTMLNodeRectFs.get(domId));
- if (overflow1.cropX) {
- rect2.left = Math.max(rect2.left, overflow1.rect.left);
- rect2.right = Math.min(rect2.right, overflow1.rect.right);
- }
- if (overflow1.cropY) {
- rect2.top = Math.max(rect2.top, overflow1.rect.top);
- rect2.bottom = Math.min(rect2.bottom, overflow1.rect.bottom);
- }
- }
+// if (overflow1 != null ) {
+// overflow1.rect = new RectF(HTMLNodeRectFs.get(domId));
+// if (overflow1.cropX) {
+// rect2.left = Math.max(rect2.left, overflow1.rect.left);
+// rect2.right = Math.min(rect2.right, overflow1.rect.right);
+// }
+// if (overflow1.cropY) {
+// rect2.top = Math.max(rect2.top, overflow1.rect.top);
+// rect2.bottom = Math.min(rect2.bottom, overflow1.rect.bottom);
+// }
+// }
if (!rect2.contains(clickPoint.x, clickPoint.y)) {
//Log.e(TAG, "--the click point is not in this element(" +domId + "), rect = " + rect2.toShortString() + ", click = " + clickPoint.x + "," + clickPoint.y );
CACHE_FIND_DOM.put(domId, "(null)");

MODIFY
src/ios/GoogleMaps/MyPluginLayer.m
src/ios/GoogleMaps/MyPluginLayer.m
if ([@"(null)" isEqualToString:cacheResult]) {
cacheResult = nil;
}
- return nil;
+ return cacheResult;
}
OverflowCSS *overflow1 = nil;
overflow1.cropY = [@"hidden" isEqualToString:overflowY] || [@"scroll" isEqualToString:overflowY];
overflow1.rect = CGRectFromString([domInfo objectForKey:@"size"]);
} else if ([@"visible" isEqualToString:overflowX] || [@"visible" isEqualToString:overflowX]) {
- if (overflow != nil) {
+ if (overflow1 != nil) {
overflow1.cropX = ![@"visible" isEqualToString:overflowX];
overflow1.cropY = ![@"visible" isEqualToString:overflowY];
}
zIndexProp = [domInfo objectForKey:@"zIndex"];
NSArray *children = [domInfo objectForKey:@"children"];
+ int maxZIndex = -1215752192; // -1 * pow(2, 32) + 1;
if ((containMapCnt > 0 || isMapChild || [@"none" isEqualToString:pointerEvents] ||
[[zIndexProp objectForKey:@"isInherit"] boolValue]) && children != nil && children.count > 0) {
- int maxZIndex = -1215752192;
int zIndexValue;
NSString *childId, *grandChildId;
NSArray *grandChildren;
if (overflow1 && ![@"root" isEqualToString:domId]) {
- tmpRect = CGRectFromString([domInfo objectForKey:@"size"]);
+ overflow1.rect = CGRectFromString([domInfo objectForKey:@"size"]);
rect3 = [[CGDOMRect alloc] init];
- rect3.left = tmpRect.origin.x;
- rect3.top = tmpRect.origin.y;
- rect3.right = rect3.left + tmpRect.size.width;
- rect3.bottom = rect3.top + tmpRect.size.height;
+ rect3.left = overflow1.rect.origin.x;
+ rect3.top = overflow1.rect.origin.y;
+ rect3.right = rect3.left + overflow1.rect.size.width;
+ rect3.bottom = rect3.top + overflow1.rect.size.height;
if (overflow1.cropX) {
maxDomId = childId;
}
- overflow1.rect = CGRectMake(rect2.left, rect2.top, rect2.right - rect2.left, rect2.bottom - rect2.top);
-
} else {
if (zIndexValue < maxZIndex) {
- // NSLog(@"-----skip because %d is %d < %d ", childId, zIndexValue, maxZindex);
continue;
}
grandChildId = [self findClickedDom:childId withPoint:clickPoint isMapChild: isMapChild overflow:overflow1];
+ //NSLog(@"-----[570] childId = %@ grandChildId = %@", childId, grandChildId);
if (grandChildId == nil) {
grandChildId = childId;
} else {
zIndexProp = [domInfoChild objectForKey:@"zIndex"];
zIndexValue = [[zIndexProp objectForKey:@"z"] intValue];
}
+ domInfoChild = [self.pluginScrollView.HTMLNodes objectForKey:grandChildId];
rect = CGRectFromString([domInfoChild objectForKey:@"size"]);
+
rect2 = [[CGDOMRect alloc] init];
rect2.left = rect.origin.x;
rect2.top = rect.origin.y;
rect2.right = rect2.left + rect.size.width;
rect2.bottom = rect2.top + rect.size.height;
+ /*
if (overflow1 && ![@"root" isEqualToString:domId]) {
- tmpRect = CGRectFromString([domInfo objectForKey:@"size"]);
+ NSLog(@"-----[519] grandChildId = %@, size = %@", grandChildId, [domInfo objectForKey:@"size"]);
+ overflow1.rect = CGRectFromString([domInfo objectForKey:@"size"]);
rect3 = [[CGDOMRect alloc] init];
- rect3.left = tmpRect.origin.x;
- rect3.top = tmpRect.origin.y;
- rect3.right = rect3.left + tmpRect.size.width;
- rect3.bottom = rect3.top + tmpRect.size.height;
+ rect3.left = overflow1.rect.origin.x;
+ rect3.top = overflow1.rect.origin.y;
+ rect3.right = rect3.left + overflow1.rect.size.width;
+ rect3.bottom = rect3.top + overflow1.rect.size.height;
if (overflow1.cropX) {
}
}
-
+ */
if (clickPoint.x < rect2.left ||
clickPoint.y < rect2.top ||
clickPoint.x > rect2.right ||
}
- domInfo = [self.pluginScrollView.HTMLNodes objectForKey:grandChildId];
if ([@"none" isEqualToString:[domInfo objectForKey:@"pointerEvents"]]) {
continue;
}
rect2.bottom = rect2.top + rect.size.height;
- if (overflow1) {
-
- tmpRect = CGRectFromString([domInfo objectForKey:@"size"]);
- rect3 = [[CGDOMRect alloc] init];
- rect3.left = tmpRect.origin.x;
- rect3.top = tmpRect.origin.y;
- rect3.right = rect3.left + tmpRect.size.width;
- rect3.bottom = rect3.top + tmpRect.size.height;
-
-
- if (overflow1.cropX) {
- rect2.left = MAX(rect2.left, rect3.left);
- rect2.right = MIN(rect2.right, rect3.right);
- }
- if (overflow1.cropY) {
- rect2.top = MAX(rect2.top, rect3.top);
- rect2.bottom = MIN(rect2.bottom, rect3.bottom);
- }
-
- }
+// if (overflow1) {
+//
+// overflow1.rect = CGRectFromString([domInfo objectForKey:@"size"]);
+// rect3 = [[CGDOMRect alloc] init];
+// rect3.left = overflow1.rect.origin.x;
+// rect3.top = overflow1.rect.origin.y;
+// rect3.right = rect3.left + overflow1.rect.size.width;
+// rect3.bottom = rect3.top + overflow1.rect.size.height;
+//
+//
+// if (overflow1.cropX) {
+// rect2.left = MAX(rect2.left, rect3.left);
+// rect2.right = MIN(rect2.right, rect3.right);
+// }
+// if (overflow1.cropY) {
+// rect2.top = MAX(rect2.top, rect3.top);
+// rect2.bottom = MIN(rect2.bottom, rect3.bottom);
+// }
+//
+// }
if (clickPoint.x < rect2.left ||
clickPoint.y < rect2.top ||

Fix: can not tap on HTMLInfoWindow on iOS