This file contains hidden or 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
Map() {} | |
.mapStyle(.standard) |
This file contains hidden or 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
Map(position: .camera(defaultMapCamera)) {} | |
.mapStyle(.hybrid(elevation: .realistic)) | |
let defaultMapCamera = MapCamera( | |
centerCoordinate: Constants.london, | |
distance: 800, | |
heading: .zero, | |
pitch: 30 | |
) |
This file contains hidden or 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
Map() { | |
pubAnnotations | |
} |
This file contains hidden or 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
[ | |
{ | |
"pubName": "The Shakespeare", | |
"description": "The Shakespeare is a large, historic pub...", | |
"station": "Victoria", | |
"coordinate": { | |
"longitude": -0.144825, | |
"latitude": 51.4962508 | |
}, | |
"address": "99 Buckingham Palace Rd, London SW1W 0RP", |
This file contains hidden or 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
KeyframeTrack(\.pitch) { | |
LinearKeyframe(45, duration: 2.5) | |
LinearKeyframe(0, duration: 2.5) | |
} |
This file contains hidden or 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
KeyframeTrack(\.distance) { | |
CubicKeyframe(600, duration: 2) | |
LinearKeyframe(600, duration: 3) | |
SpringKeyframe(4_000, duration: 1) | |
} |
This file contains hidden or 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
KeyframeTrack(\.centerCoordinate) { | |
CubicKeyframe(selectedPub?.coordinate, | |
duration: 6) | |
} |
This file contains hidden or 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
.mapCameraKeyframeAnimator(trigger: selectedPub, | |
keyframes: { camera in | |
KeyframeTrack(\.centerCoordinate) { } | |
KeyframeTrack(\.distance) { } | |
KeyframeTrack(\.pitch) { } | |
}) |
This file contains hidden or 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
@State private var selectedPub: Pub? | |
// ... | |
.mapCameraKeyframeAnimator(trigger: selectedPub, | |
keyframes: { camera in | |
}) |
This file contains hidden or 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
// ... | |
.overlay(alignment: .bottomTrailing) { | |
lookAroundPreview | |
} | |
@ViewBuilder | |
private var lookAroundPreview: some View { | |
LookAroundPreview(scene: $scene, | |
allowsNavigation: true, | |
badgePosition: .bottomTrailing) |