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

[ios] [WiP] #5036 draggable annotation views #5272

Closed
wants to merge 1 commit into from

Conversation

frederoni
Copy link
Contributor

@frederoni frederoni commented Jun 7, 2016

This PR is still WiP or even PoC as I'm trying to figure out all implications of it and aligning it with #5245

TODO

  • Figure out if this solution will work at all.
  • Applying transformations is being omitted while dragging which could lead to unexpected behaviour if freeAxes/flat is set.
  • Current animation only scales the annotation view, but the most common use case will likely be a pin annotation being lifted. Add this functionality and demo in MBXViewController

_TBC_

/cc @friedbunny @1ec5 @boundsj

@frederoni frederoni added iOS Mapbox Maps SDK for iOS ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold annotations Annotations on iOS and macOS or markers on Android labels Jun 7, 2016
@@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
The center point (specified as a map coordinate) of the annotation. (required)
(read-only)
*/
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, readwrite) CLLocationCoordinate2D coordinate;
Copy link
Contributor

@friedbunny friedbunny Jun 7, 2016

Choose a reason for hiding this comment

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

Not all MGLAnnotation implementations allow for coordinate to be changed, so we’ve been making this mutable only as necessary.

@1ec5
Copy link
Contributor

1ec5 commented Jun 8, 2016

Should long-pressing an annotation view select the associated annotation and trigger the selection delegate methods (#5130)?

@frederoni
Copy link
Contributor Author

MKAnnotationView cannot be dragged until it has been selected. So to initiate a drag, you have to tap -> long-press -> pan. Many examples use a workaround to make annotation views draggable immediately after long-pressing by setting the selected property to true in MKMapViewDelegate didChangeDragState, didAddAnnotationViews and didDeselectAnnotationView.

I will postpone this issue due to more critical ( #5127, #5128 and #5129 ) which this issue depends on.
Will take another stab here when selected and enabled is working properly.

@frederoni frederoni closed this Jun 15, 2016
@frederoni frederoni deleted the 5036-draggable-annotatation-view branch June 15, 2016 09:51
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 iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants