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

[ios] Removes check for on-screen in setSelectedAnnotations (#9790) - #11257

Closed
julianrex wants to merge 4 commits into
release-bobafrom
jrex-9790-offscreen-annotation
Closed

julianrex wants to merge 4 commits into
release-bobafrom
jrex-9790-offscreen-annotation

Conversation

@julianrex

Copy link
Copy Markdown
Contributor
  • Removed the check for offscreen in setSelectedAnnotations (though this could be a big change for clients)
  • Added settings menu entries in iosapp, to aid testing.
  • Added test to check selection.

I think changing how the selected annotation moves (and the behaviour of the animated parameter) should be handled by #3249.

@julianrex julianrex added iOS Mapbox Maps SDK for iOS ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Feb 20, 2018
@julianrex julianrex removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Feb 20, 2018
BOOL _needsDisplayRefresh;

NSUInteger _changeDelimiterSuppressionDepth;
NSInteger _changeDelimiterSuppressionDepth;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was changed to NSInteger since there's an assert later in the code that checks for >= 0.

@julianrex
julianrex requested review from 1ec5 and friedbunny February 20, 2018 14:50
@lilykaiser lilykaiser added this to the ios-v4.0.0 milestone Feb 20, 2018

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We’ll need a blurb in the iOS and macOS changelogs, since this could be a fairly significant change in behavior for some developers.

Note that if #3249 gets pushed from the v4.0.0 milestone for any reason, we should back out this change, because the current behavior is easier to justify than what we’d get with only this PR and not #3249.

{
[self selectAnnotation:firstAnnotation animated:NO];
}
[self selectAnnotation:firstAnnotation animated:NO];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would you mind making the corresponding change to the macOS implementation of MGLMapView? Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do.

{
[self selectAnnotation:firstAnnotation animated:NO];
}
[self selectAnnotation:firstAnnotation animated:NO];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, this documentation needs to be updated:

If the given annotation is not visible within the current viewport, this
method has no effect.


- (void)selectAnOffscreenAnnotation {
id<MGLAnnotation> annotation = [self randomOffscreenAnnotation];
[self.mapView selectAnnotation:annotation animated:NO];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to the -[MKMapView selectAnnotation:animated:] documentation, MapKit’s special case is because an offscreen annotation would have no backing view:

If the specified annotation is not onscreen, and therefore does not have an associated annotation view, this method has no effect.

I think this SDK’s view-backed annotations will get selected just fine when off-screen, but I’m not sure what’ll happen once we implement #3249. This gives me pause: we should make sure #3249 is at least feasible for view-backed annotations before committing to the behavior here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, I think it's worth waiting for #3249 before accepting these changes. I'll re-add the do not merge tag.

@julianrex

Copy link
Copy Markdown
Contributor Author

I think it's worth keeping #3249 separate from this change, but agree that they should be treated as a pair.

@julianrex julianrex added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Mar 6, 2018
@lilykaiser

Copy link
Copy Markdown

Can we put this into a patch release before 4.0.0?

@friedbunny

Copy link
Copy Markdown
Contributor

@lilykaiser as a feature that will be a "fairly significant change in behavior for some developers”, this doesn’t seem appropriate for a patch release.

@julianrex

Copy link
Copy Markdown
Contributor Author

@lilykaiser @friedbunny How about a 3.8.0, if this needs to land before 4.0.0?

@friedbunny friedbunny added feature annotations Annotations on iOS and macOS or markers on Android labels Mar 16, 2018
@julianrex

Copy link
Copy Markdown
Contributor Author

Closing this PR - as these changes are being rolled into #11442 (which also addresses #3249)

@julianrex julianrex closed this Mar 16, 2018
@julianrex
julianrex deleted the jrex-9790-offscreen-annotation branch March 16, 2018 21:46
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 ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold feature iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants