Skip to content

camera.fly with edge insets does not work as expected #990

Open
@richardpineo

Description

@richardpineo

Environment

  • Xcode version: 13.2.1
  • iOS version: all, but simulator iOS 15.2 exhibits it
  • Devices affected: ipad
  • Maps SDK Version: 10.2.0

Observed behavior and steps to reproduce

If you try to fly to a location or geometry with a top edge inset that is sufficiently larger than the bottom edge inset, then the animation will jerk at the end and the map will have a weird margin at the top of the view.

This code added to the viewDidLoad() method in the BasicMapExample will show the bug:

mapView.mapboxMap.onEvery(.mapLoaded) { _ in
	let options = CameraOptions(center: .init(latitude: 40, longitude: 40), padding: .init(top: 250, left: 30, bottom: 50, right: 33))
	self.mapView.camera.fly(to: options, duration: 1 )
}

Expected behavior

The map should fly to the position smoothly and not have a strange margin at the top.
If you change the top edge inset to 50 then it will work as expected.

Notes / preliminary analysis

No idea why this doesn't work but it interferes with the padding that we would like to apply to our application.

Additional links and references

edge.insets.problem.small.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something is broken!p3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions