hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

README says Map event is "longpress" but it is in fact "longclick" #118

Closed de1mat closed 6 years ago

de1mat commented 6 years ago

In the README it says:

The module supports all native delegates - exposed as events. These are:

click (map, pin, infoWindow, overlay) locationclick longpress ...

After testing this multiple times with no luck I downloaded the module source code and discovered that it is in fact firing longclick not longpress.

- (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate
{
  if ([[self proxy] _hasListeners:@"longclick"]) {
    [[self proxy] fireEvent:@"longclick"
                 withObject:@{
                   @"map" : [self proxy],
                   @"latitude" : NUMDOUBLE(coordinate.latitude),
                   @"longitude" : NUMDOUBLE(coordinate.longitude)
                 }];
  }
}

PS: This needs to be corrected in the app.js example as well which currently has mapView.addEventListener('longpress', handleLongpressEvent);

hansemannn commented 6 years ago

Fixed, thanks!

de1mat commented 6 years ago

Awesome 👍

Don't forget about app.js :)

https://github.com/hansemannn/titanium-googlemaps/blob/master/example/app.js#L143