Closed RebinX1 closed 10 months ago
Hi, thank you for the feedback, the API is missing currently. Internal ticket https://mapbox.atlassian.net/browse/MAPSIOS-577
@Re-Core in the upcoming release you will be able to set gesture handlers via https://docs.tilestream.net/ios/maps/api/latest/documentation/mapboxmaps/map/gesturehandlers(_:) ,
you can try the fresh version from main
branch
So i implemented the full mapbox v11 to my swiftUI App using the swiftUI implementation and its working great, but the issue is i want to listen when my user make pinch or pan or zoom on the map using the Gesture provided by mapbox, however i did not find any proper documentation on how to achieve that in SwiftUI.
I tried using SwiftUI Gesture and mimic some of the Old mapbox Gesture listener but its causing me weird behavior:
`MapReader { proxy in Map(viewport: $viewPort, content: { if isTrafficLayerInitilized {
// .mapStyle(.standard(lightPreset: .dawn)) .mapStyle(MapStyle(uri: customStyle!)) .ornamentOptions(configureOrnamentOptions()) .onStyleLoaded(action: { _ in proxy.map.map { mapBoxViewModel.initStyleLayer($0) landmarkViewModel.getAllLandMarks($0) } configureMap() }) .onMapLongPressGesture(perform: { mapContentGesture in reportViewModel.fetchManualReports(coordinate: mapContentGesture.coordinate) navigationViewModel.generateRoute(to: mapContentGesture.coordinate)