Skip to content

feat: add onPress and onLongPress events to MapView#35

Merged
lodev09 merged 3 commits intomainfrom
feat/map-press-events
Feb 25, 2026
Merged

feat: add onPress and onLongPress events to MapView#35
lodev09 merged 3 commits intomainfrom
feat/map-press-events

Conversation

@lodev09
Copy link
Collaborator

@lodev09 lodev09 commented Feb 25, 2026

Summary

  • Add onPress and onLongPress events to MapView returning coordinate and screen point
  • Use component-specific native event names (onMapPress, onMapLongPress, onPolygonPress) to prevent event bubbling between components
  • Fix Apple Maps tap gesture firing after long press release
  • Fix Android polygon areas blocking map press when polygon has no press handler

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

  • Tap on map → onPress fires with correct coordinate and screen point
  • Long press on map → onLongPress fires with correct coordinate and screen point
  • Tap on polygon with onPress handler → polygon press fires, map press does not
  • Tap on polygon without onPress handler → map press fires with correct coordinate
  • Long press then release → only onLongPress fires, not onPress (Apple Maps)
  • Tested on both Apple Maps and Google Maps providers on iOS
  • Tested on Android with Google Maps

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

Rename native press events so polygon onPress doesn't bubble to MapView:
- MapView: onMapPress, onMapLongPress (DirectEventHandler)
- Polygon: onPolygonPress (DirectEventHandler)

Public JS API (onPress/onLongPress) unchanged — mapping in component layer.
Polygons are always clickable to intercept taps. If not tappable,
forward to onMapClick with actual tap coordinate captured via
dispatchTouchEvent.
@lodev09 lodev09 merged commit cfa79c6 into main Feb 25, 2026
3 checks passed
@lodev09 lodev09 deleted the feat/map-press-events branch February 25, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant