{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/69600698","id":69600698,"diff_hunk":"@@ -212,13 +212,21 @@ - (void)setDragState:(MGLAnnotationViewDragState)dragState animated:(BOOL)animat\n         [self.mapView.calloutViewForSelectedAnnotation dismissCalloutAnimated:animated];\n         [self.superview bringSubviewToFront:self];\n     }\n-\n-    if (dragState == MGLAnnotationViewDragStateEnding)\n+    else if (dragState == MGLAnnotationViewDragStateCanceling)\n+    {\n+        self.panGestureRecognizer.enabled = NO;\n+        self.longPressRecognizer.enabled = NO;\n+        self.center = [self.mapView convertCoordinate:self.annotation.coordinate toPointToView:self.mapView];\n+        self.panGestureRecognizer.enabled = YES;\n+        self.longPressRecognizer.enabled = YES;\n+        self.dragState = MGLAnnotationViewDragStateNone;\n+    }\n+    else if (dragState == MGLAnnotationViewDragStateEnding)\n     {\n-        if ([self.mapView.delegate respondsToSelector:@selector(mapView:didDragAnnotationView:toCoordinate:)])\n+        if ([self.annotation respondsToSelector:@selector(setCoordinate:)])\n         {\n             CLLocationCoordinate2D coordinate = [self.mapView convertPoint:self.center toCoordinateFromView:self.mapView];\n-            [self.mapView.delegate mapView:self.mapView didDragAnnotationView:self toCoordinate:coordinate];\n+            [(NSObject *)self.annotation setValue:[NSValue valueWithMGLCoordinate:coordinate] forKey:@\"coordinate\"];","path":"platform/ios/src/MGLAnnotationView.mm","position":22,"original_position":22,"commit_id":"039783e1e011474aa949561b6a3d910f352d86e3","original_commit_id":"039783e1e011474aa949561b6a3d910f352d86e3","user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"body":"Clever. I wonder if there’s any difference between this and using NSInvocation.","created_at":"2016-07-05T17:06:54Z","updated_at":"2016-07-05T17:06:54Z","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/5561#discussion_r69600698","pull_request_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561","_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/69600698"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/5561#discussion_r69600698"},"pull_request":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561","id":76159331,"html_url":"https://github.com/mapbox/mapbox-gl-native/pull/5561","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/5561.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/5561.patch","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5561","number":5561,"state":"open","locked":false,"title":"[ios] fixes #5544 support canceling a drag operation and not by default","user":{"login":"frederoni","id":764476,"avatar_url":"https://avatars.githubusercontent.com/u/764476?v=3","gravatar_id":"","url":"https://api.github.com/users/frederoni","html_url":"https://github.com/frederoni","followers_url":"https://api.github.com/users/frederoni/followers","following_url":"https://api.github.com/users/frederoni/following{/other_user}","gists_url":"https://api.github.com/users/frederoni/gists{/gist_id}","starred_url":"https://api.github.com/users/frederoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederoni/subscriptions","organizations_url":"https://api.github.com/users/frederoni/orgs","repos_url":"https://api.github.com/users/frederoni/repos","events_url":"https://api.github.com/users/frederoni/events{/privacy}","received_events_url":"https://api.github.com/users/frederoni/received_events","type":"User","site_admin":false},"body":"This PR simplifies implementing draggable annotation views by removing `didDragAnnotationView:toCoordinate` and instead call `setCoordinate:` on the associated MGLAnnotation. It also adds support for canceling a drag operation by setting `dragState` to `MGLAnnotationViewDragStateCanceling` as mentioned in [#5544](https://github.com/mapbox/mapbox-gl-native/issues/5544)\r\n\r\n👀 @1ec5 @boundsj ","created_at":"2016-07-04T12:51:48Z","updated_at":"2016-07-05T17:06:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b72866599358dfbc2edc15f86983ba828dd73846","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/25","html_url":"https://github.com/mapbox/mapbox-gl-native/milestones/ios-v3.3.0","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/25/labels","id":1493571,"number":25,"title":"ios-v3.3.0","description":"","creator":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":129,"state":"open","created_at":"2016-01-08T20:04:18Z","updated_at":"2016-07-05T07:49:35Z","due_on":"2016-07-07T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561/commits","review_comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561/comments","review_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5561/comments","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/039783e1e011474aa949561b6a3d910f352d86e3","head":{"label":"mapbox:5544-simplify-draggable-annotations","ref":"5544-simplify-draggable-annotations","sha":"039783e1e011474aa949561b6a3d910f352d86e3","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Render Mapbox styles in mobile, desktop, and node applications using C++ and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2016-07-05T03:38:25Z","pushed_at":"2016-07-05T16:38:13Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":112765,"stargazers_count":1348,"watchers_count":1348,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":365,"mirror_url":null,"open_issues_count":484,"forks":365,"open_issues":484,"watchers":1348,"default_branch":"master"}},"base":{"label":"mapbox:release-ios-v3.3.0","ref":"release-ios-v3.3.0","sha":"b2197236b6592d10af6e9f6eccd9b3d4ee19aef3","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Render Mapbox styles in mobile, desktop, and node applications using C++ and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2016-07-05T03:38:25Z","pushed_at":"2016-07-05T16:38:13Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":112765,"stargazers_count":1348,"watchers_count":1348,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":365,"mirror_url":null,"open_issues_count":484,"forks":365,"open_issues":484,"watchers":1348,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/5561"},"issue":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5561"},"comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5561/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5561/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/039783e1e011474aa949561b6a3d910f352d86e3"}}}}
{"actor":{"display_login":"1ec5"}}