You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add tap gesture support to Marker components (#6786)
Adds tap (click) gesture support to Marker components across both iOS
and Android platforms, providing API parity and consistent user
interaction patterns. To keep the Markers feature simple I've only added
support for Tap (Click) )gestures, but it would be trivial to add other gesture
types if needed.
iOS Implementation:
- Add `onTapGesture` modifier to Marker component with callback support
- Update SwiftUI MarkersExample to demonstrate interactive markers with
color changes
Android Implementation:
- Add `onClick` parameter to Marker composable with optional callback
function
- Update MarkersActivity to showcase tap functionality with random color
transitions
GitOrigin-RevId: eadd595cdec6c886a7ceca08a688bfd48afb8768
Copy file name to clipboardExpand all lines: Sources/MapboxMaps/Annotations/Marker.swift
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
import SwiftUI
2
2
3
-
/// Displays a simple map Marker at the specified coordinated.
3
+
/// Displays a simple map Marker at the specified coordinate.
4
4
///
5
5
/// `Marker` is a convenience struct which creates a simple `MapViewAnnotation` with limited customization options.
6
6
/// Use `Marker` to quickly add a pin annotation at the specific coordinates when using SwiftUI.
@@ -19,6 +19,7 @@ import SwiftUI
19
19
/// - Note: `Marker`s are great for displaying unique interactive features. However, they may be suboptimal for large amounts of data and don't support clustering.
20
20
/// Each marker creates a SwiftUI view, so for scenarios with 100+ markers, consider using ``PointAnnotation``,
21
21
/// Additionally, `Marker`s appear above all content of MapView (e.g. layers, annotations, puck). If you need to display annotation between layers or below a puck, use ``PointAnnotation``.
0 commit comments