You can add camera paths animations to your 3D map to provide a more immersive experience for your users. Camera path animations can fly to or fly around a point on the map.
Fly to
The following code sample demonstrates how to use the Map.flyCameraTo
method to animate the camera to fly to a specific point on
a 3D map.
Swift
Map(mode: .hybrid) .flyCameraTo( camera:Camera = .init( latitude: 47.6210296, longitude: -122.3496903, heading: 149.0, tilt: 77.0, roll: 0.0, range: 4000) duration: 5, trigger: animate, completion: { } )
Fly around
The following code sample demonstrates how use the Map.flyCameraAround
method to animate the camera to fly around a specific point on
a 3D map.
Swift
Map(mode: .hybrid) .flyCameraAround( camera:Camera = .init( latitude: 47.6210296, longitude: -122.3496903, heading: 149.0, tilt: 77.0, roll: 0.0, range: 3000) duration: 90, rounds: 3, trigger: flyAround, callback: { } )