File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,8 @@ - (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D
189189
190190 //
191191 maxZIndex = -1 ;
192- CLLocationCoordinate2D touchPoint;
192+ CLLocationCoordinate2D touchPoint = kCLLocationCoordinate2DInvalid ;
193+
193194 for (i = 0 ; i < [boundsHitList count ]; i++) {
194195 key = [boundsHitList objectAtIndex: i];
195196 // plugin = [boundsPluginList objectAtIndex:i];
@@ -257,7 +258,7 @@ - (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D
257258
258259 }
259260
260- if (hitKey != nil ) {
261+ if (hitKey != nil && CLLocationCoordinate2DIsValid (touchPoint) ) {
261262 NSArray *tmp = [hitKey componentsSeparatedByString: @" _" ];
262263 NSString *eventName = [NSString stringWithFormat: @" %@ _click" , [tmp objectAtIndex: 0 ]];
263264 [self triggerOverlayEvent: eventName overlayId: hitKey coordinate: touchPoint];
Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ + (CLLocationCoordinate2D)isPointOnTheGeodesicLine:(GMSPath *)path coordinate:(C
296296
297297 double minDistance = 999999999 ;
298298 double distance;
299- CLLocationCoordinate2D mostClosePoint;
299+ CLLocationCoordinate2D mostClosePoint = kCLLocationCoordinate2DInvalid ;
300300
301301 for (int i = 0 ; i < [inspectPoints count ]; i++) {
302302 distance = GMSGeometryDistance ([inspectPoints coordinateAtIndex: i], point);
You can’t perform that action at this time.
0 commit comments