-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare 11.6.0 rc.1 on release (#2248)
Co-authored-by: Johann Muszynski <[email protected]> Co-authored-by: Ivan Persidsky <[email protected]> Co-authored-by: Roman Laitarenko <[email protected]> Co-authored-by: Thibaud Lopez Schneider <[email protected]> Co-authored-by: Patrick Leonard <[email protected]>
- Loading branch information
1 parent
86476e9
commit 31b2336
Showing
71 changed files
with
469 additions
and
829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Apps/Examples/Examples/SwiftUI Examples/LocationOverrideExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import SwiftUI | ||
import MapboxMaps | ||
|
||
/// The example demonstrates how to override the default location provider using SwiftUI and Combine. | ||
@available(iOS 14.0, *) | ||
struct LocationOverrideExample: View { | ||
private class LocationProvider { | ||
@Published var location = Location(coordinate: .zero) | ||
@Published var heading = Heading(direction: 0, accuracy: 0) | ||
} | ||
|
||
@State private var provider = LocationProvider() | ||
|
||
var body: some View { | ||
MapReader { proxy in | ||
Map { | ||
/// The location indicator puck position and heading is controlled by the location provider. | ||
Puck2D(bearing: .heading) | ||
} | ||
.onMapTapGesture { context in | ||
/// As a demonstration, override location with the last tap coordinate. | ||
let direction = provider.location.coordinate.direction(to: context.coordinate) | ||
provider.location = Location(coordinate: context.coordinate) | ||
provider.heading = Heading(direction: direction, accuracy: 0) | ||
} | ||
.onAppear { | ||
/// Override the location and Heading provider with Combine publishers. | ||
proxy.location?.override( | ||
locationProvider: provider.$location.map {[$0]}.eraseToSignal(), | ||
headingProvider: provider.$heading.eraseToSignal()) | ||
} | ||
} | ||
.ignoresSafeArea() | ||
.safeOverlay(alignment: .bottom) { | ||
Text("Tap on map to move the puck") | ||
.floating() | ||
.padding(.bottom, 30) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.