Add camera path animations

Select platform: Android iOS

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.

Map(mode: .hybrid)
.flyCameraTo(
  camera: .init(
    center: .init(
      latitude: 47.6210296,
      longitude: -122.3496903,
      altitude: 585),
    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.

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,
    repeatCount: 3,
    trigger: flyAround,
    completion: {}
  )