/
Interacting with points of interest (v2.1.x – 2.2.x)

Interacting with points of interest (v2.1.x – 2.2.x)

It’s possible to get notified about interaction with POI on the map. You can use NMMapView’s instance method - (void)addPlaceTapListener to add a listener and - (void)removeMapTapListener to remove it. The listener must implement NMPlaceTapListener interface. Multiple listeners can be added to NMMapView instance.

Example:

//anObject's class conforms to NMPlaceTapListener protocol [mapView addPlaceTapListener:anObject];

 

Optional protocol methods provide a way to notify listener:

- (void)onPlacesSingleTap:(NSArray<NMPlace *>*)places { //define single tap gesture behaviour here } - (void)onPlacesDoubleTap:(NSArray<NMPlace *>*)places; { //define double tap gesture behaviour here } - (void)onPlacesLongTap:(NSArray<NMPlace *>*)places; { //define long press gesture behaviour here }

The places argument will contain the list of all places around the tapped point.