Skip to content

Commit a795f15

Browse files
pjleonard37Release SDK bot for Maps SDK teamclaude
authored andcommitted
Clarify SwiftUI annotation dragging limitations (#5334)
- Remove isDraggable parameter from SwiftUI CircleAnnotation example - Add documentation note explaining dragging is not supported in SwiftUI - Update SwiftUI User Guide to clarify isDraggable and isSelected limitations 🤖 Generated with [Claude Code](https://claude.ai/code) cc @mapbox/maps-ios Co-authored-by: Release SDK bot for Maps SDK team <[email protected]> Co-authored-by: Claude <[email protected]> GitOrigin-RevId: 501a73b9e9b7c33f1848a3febea9e095f718f351
1 parent ece12e0 commit a795f15

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/Examples/SwiftUI Examples/AnnotationsExample.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct AnnotationsExample: View {
3838
Map(viewport: $viewport) {
3939
ForEvery(Self.flights, id: \.name) { flight in
4040
CircleAnnotationGroup(flight.airports, id: \.name) { airport in
41-
CircleAnnotation(centerCoordinate: airport.coordinate, isDraggable: true)
41+
CircleAnnotation(centerCoordinate: airport.coordinate)
4242
.circleColor(StyleColor(flight.color))
4343
.onTapGesture { alert = "Airport: \(airport.name)" }
4444
}

Sources/MapboxMaps/Documentation.docc/Articles/SwiftUI User Guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ MapViewAnnotation(coordinate: CLLocationCoordinate(...))
256256

257257
Layer annotations are rendered natively in the map using layers. They can be placed in between map layers, support clustering (for ``PointAnnotation``s only) and are usually more performant.
258258

259+
> Note: SwiftUI layer annotations do not support dragging functionality. The `isDraggable` and `isSelected` properties available in UIKit are not supported in SwiftUI.
260+
259261
The example below displays different types of layer annotations.
260262

261263
```swift

0 commit comments

Comments
 (0)