hansemannn / titanium-googlemaps

🗺 Use the Google Maps with the Titanium SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

de1mat opened this issue · comments

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);

Fixed, thanks!