(iOS) update:  implement `mapView: didTapAtPoint:tapPoint` instead of  `mapView: didTapAtCoordinate:` because didTapAtCoordinate does not work well
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180127-0009" 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-20180129-1110" 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
src/ios/GoogleMaps/GoogleMapsViewController.h
src/ios/GoogleMaps/GoogleMapsViewController.h
- (id)initWithOptions:(NSDictionary *) options;
- (BOOL)didTapMyLocationButtonForMapView:(GMSMapView *)mapView;
+- (void)mapView:(GMSMapView *)mapView didTapAtPoint:(CGPoint)tapPoint;
- (void)execJS: (NSString *)jsString;
- (void) didChangeActiveBuilding: (GMSIndoorBuilding *)building;

MODIFY
src/ios/GoogleMaps/GoogleMapsViewController.m
src/ios/GoogleMaps/GoogleMapsViewController.m
/**
* @callback the my location button is clicked.
*/
-- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate {
+- (void)mapView:(GMSMapView *)mapView didTapAtPoint:(CGPoint)tapPoint {
+
+ CLLocationCoordinate2D coordinate = [self.map.projection coordinateForPoint:tapPoint];
if (self.map.isMyLocationEnabled) {
// Since the google maps sdk for iOS does not provide any events when you tap on the blue dot,
// detect the user tap on it by myself
CGPoint blueDotPoint = [self.map.projection pointForCoordinate:self.map.myLocation.coordinate];
- CGPoint tapPoint = [self.map.projection pointForCoordinate:coordinate];
if (ABS(blueDotPoint.x - tapPoint.x) < 20 * self.screenScale && ABS(blueDotPoint.y - tapPoint.y) < 20 * self.screenScale) {

MODIFY
src/ios/GoogleMaps/MyPluginLayer.m
src/ios/GoogleMaps/MyPluginLayer.m
if (CGRectContainsPoint(rect, point)) {
clickedDomId = [self findClickedDom:@"root" withPoint:point isMapChild:NO overflow:nil];
+ point2 = CGPointMake(point.x - mapCtrl.view.frame.origin.x, point.y - mapCtrl.view.frame.origin.y);
//NSLog(@"--->clickedDomId = %@", clickedDomId);
if ([mapCtrl.mapDivId isEqualToString:clickedDomId]) {
// If user click on the map, return the mapCtrl.view.
- UIView *hitView =[mapCtrl.view hitTest:CGPointMake(point.x - mapCtrl.view.frame.origin.x, point.y - mapCtrl.view.frame.origin.y) withEvent:event];
-
+ UIView *hitView =[mapCtrl.view hitTest:point2 withEvent:event];
+ [mapCtrl mapView:mapCtrl.map didTapAtPoint:point2];
return hitView;
} else {
- return [self.webView hitTest:point withEvent:event];
+ return [self.webView hitTest:point2 withEvent:event];
}
}
}
-
- (NSString *)findClickedDom:(NSString *)domId withPoint:(CGPoint)clickPoint isMapChild:(BOOL)isMapChild overflow:(OverflowCSS *)overflow {
NSDictionary *domInfo = [self.pluginScrollView.debugView.HTMLNodes objectForKey:domId];

(iOS) update:  implement `mapView: didTapAtPoint:tapPoint` instead of  `mapView: didTapAtCoordinate:` because didTapAtCoordinate does not work well