Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix for camera movement when selecting visible annotations #11731

Merged
merged 4 commits into from
Apr 24, 2018

Conversation

julianrex
Copy link
Contributor

@julianrex julianrex commented Apr 19, 2018

The drifting of the camera seen in the WebAPIDataExample of ios-sdk-examples was triggered by the following conditions:

  1. The annotation was selected BEFORE it had been added. This causes positioningRect used in selectAnnotation:animated: is different depending on if addAnnotation has been called first. #11476
  2. The annotation view was created with -initWithFrame: rather that one of the provided initializers. This defaults the enabled to NO, contrary to the header docs.
  3. There are content insets (e.g. a navigation bar).

This PR adds tests to capture this situation (it's slightly different on macos), and the associated fixes.

@julianrex julianrex requested review from friedbunny and jmkiley April 19, 2018 04:42
@julianrex julianrex added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS annotations Annotations on iOS and macOS or markers on Android labels Apr 19, 2018
@julianrex
Copy link
Contributor Author

julianrex commented Apr 19, 2018

re: -initWithFrame: see #11734

@julianrex julianrex added this to the ios-v4.0.1 milestone Apr 19, 2018
Copy link
Contributor

@friedbunny friedbunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix and tests (especially) look good! (Though I’m not entirely familiar with the macOS implementation.)

@julianrex julianrex merged commit 5b5549d into release-boba Apr 24, 2018
@julianrex julianrex deleted the jrex-default-callout-positioning-rect branch April 24, 2018 15:01
julianrex pushed a commit that referenced this pull request Apr 24, 2018
julianrex added a commit that referenced this pull request Apr 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants