{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/comments/108089348","pull_request_review_id":29097468,"id":108089348,"diff_hunk":"@@ -145,31 +153,21 @@ extension MGLMapView {\n             arrowStroke.lineWidth = MGLStyleValue(rawValue: 8)\n             arrowStroke.lineColor = MGLStyleValue(rawValue: NavigationUI.shared.tintColor)\n             \n-            style?.addSource(arrowSourceStroke)\n-            style?.addSource(arrowSource)\n+            if let source = style.source(withIdentifier: arrowSourceIdentifier) {\n+                let s = source as! MGLShapeSource\n+                s.shape = MGLShapeCollection(shapes: maneuverArrowPolylines)\n+            } else {\n+                style.addSource(arrowSource)\n+                style.addLayer(arrow)\n+            }\n             \n-            style?.addLayer(arrow)\n-            style?.insertLayer(arrowStroke, below: arrow)\n-        }\n-    }\n-    \n-    func removeArrow() {\n-        guard let style = style else { return }\n-        \n-        if let arrow = style.layer(withIdentifier: \"arrow\") {\n-            style.removeLayer(arrow)\n-        }\n-        \n-        if let arrow = style.layer(withIdentifier: \"arrowStroke\") {\n-            style.removeLayer(arrow)\n-        }\n-        \n-        if let arrowStrokeSourceCheck = style.source(withIdentifier: \"arrowSourceStroke\") {\n-            style.removeSource(arrowStrokeSourceCheck)\n-        }\n-        \n-        if let arrowSourceCheck = style.source(withIdentifier: \"arrowSource\") {\n-            style.removeSource(arrowSourceCheck)\n+            if let source = style.source(withIdentifier: arrowSourceStrokeIdentifier) {\n+                let s = source as! MGLShapeSource\n+                s.shape = MGLShapeCollection(shapes: maneuverArrowStrokePolylines)\n+            } else {\n+                style.addSource(arrowSourceStroke)\n+                style.insertLayer(arrowStroke, below: arrow)","path":"MapboxNavigationUI/MGLMapView.swift","position":99,"original_position":92,"commit_id":"00ac3ec744a75782783cd6a3fd6343625ca6c18d","original_commit_id":"00ac3ec744a75782783cd6a3fd6343625ca6c18d","user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars3.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":"Likewise, move all the code that sets up `arrowSourceStroke` and `arrowStroke` into this `else` block.","created_at":"2017-03-27T04:30:29Z","updated_at":"2017-03-27T04:37:06Z","html_url":"https://github.com/mapbox/MapboxNavigation.swift/pull/91#discussion_r108089348","pull_request_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91","_links":{"self":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/comments/108089348"},"html":{"href":"https://github.com/mapbox/MapboxNavigation.swift/pull/91#discussion_r108089348"},"pull_request":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91","id":112557909,"html_url":"https://github.com/mapbox/MapboxNavigation.swift/pull/91","diff_url":"https://github.com/mapbox/MapboxNavigation.swift/pull/91.diff","patch_url":"https://github.com/mapbox/MapboxNavigation.swift/pull/91.patch","issue_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/91","number":91,"state":"open","locked":false,"title":"Insert route below text on reroute","user":{"login":"bsudekum","id":1058624,"avatar_url":"https://avatars3.githubusercontent.com/u/1058624?v=3","gravatar_id":"","url":"https://api.github.com/users/bsudekum","html_url":"https://github.com/bsudekum","followers_url":"https://api.github.com/users/bsudekum/followers","following_url":"https://api.github.com/users/bsudekum/following{/other_user}","gists_url":"https://api.github.com/users/bsudekum/gists{/gist_id}","starred_url":"https://api.github.com/users/bsudekum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsudekum/subscriptions","organizations_url":"https://api.github.com/users/bsudekum/orgs","repos_url":"https://api.github.com/users/bsudekum/repos","events_url":"https://api.github.com/users/bsudekum/events{/privacy}","received_events_url":"https://api.github.com/users/bsudekum/received_events","type":"User","site_admin":false},"body":"* Cleans up the arguments for `annotate`\r\n* Removes the arrow sooner when rerouting\r\n* ^ This actually solves inserting the route line below labels. Before, we were inserting below the layer `arrow` instead.\r\n* Only redraw the arrow when it actually changes.\r\n\r\ncloses: https://github.com/mapbox/MapboxNavigation.swift/issues/90 https://github.com/mapbox/MapboxNavigation.swift/issues/89\r\n\r\n/cc @1ec5 ","created_at":"2017-03-24T23:04:20Z","updated_at":"2017-03-27T04:37:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9eb7a6a161a1b97a23a74c27da3baa39f83a221","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91/commits","review_comments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91/comments","review_comment_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/91/comments","statuses_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/statuses/00ac3ec744a75782783cd6a3fd6343625ca6c18d","head":{"label":"mapbox:arrow-line-stuff","ref":"arrow-line-stuff","sha":"00ac3ec744a75782783cd6a3fd6343625ca6c18d","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars2.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":73870932,"name":"MapboxNavigation.swift","full_name":"mapbox/MapboxNavigation.swift","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars2.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/MapboxNavigation.swift","description":"Turn-by-turn navigation logic and UI in Swift or Objective-C on iOS","fork":false,"url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift","forks_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/forks","keys_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/teams","hooks_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/hooks","issue_events_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/events","assignees_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/tags","blobs_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/languages","stargazers_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/stargazers","contributors_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/contributors","subscribers_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/subscribers","subscription_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/subscription","commits_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/merges","archive_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/downloads","issues_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/deployments","created_at":"2016-11-16T01:23:44Z","updated_at":"2017-03-26T16:56:56Z","pushed_at":"2017-03-27T02:59:05Z","git_url":"git://github.com/mapbox/MapboxNavigation.swift.git","ssh_url":"git@github.com:mapbox/MapboxNavigation.swift.git","clone_url":"https://github.com/mapbox/MapboxNavigation.swift.git","svn_url":"https://github.com/mapbox/MapboxNavigation.swift","homepage":"","size":356,"stargazers_count":32,"watchers_count":32,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":32,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"c1371f0d434a4a8272800c6ec1b1a42aa8296b5f","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars2.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":73870932,"name":"MapboxNavigation.swift","full_name":"mapbox/MapboxNavigation.swift","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars2.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/MapboxNavigation.swift","description":"Turn-by-turn navigation logic and UI in Swift or Objective-C on iOS","fork":false,"url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift","forks_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/forks","keys_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/teams","hooks_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/hooks","issue_events_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/events","assignees_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/tags","blobs_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/languages","stargazers_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/stargazers","contributors_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/contributors","subscribers_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/subscribers","subscription_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/subscription","commits_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/merges","archive_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/downloads","issues_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/deployments","created_at":"2016-11-16T01:23:44Z","updated_at":"2017-03-26T16:56:56Z","pushed_at":"2017-03-27T02:59:05Z","git_url":"git://github.com/mapbox/MapboxNavigation.swift.git","ssh_url":"git@github.com:mapbox/MapboxNavigation.swift.git","clone_url":"https://github.com/mapbox/MapboxNavigation.swift.git","svn_url":"https://github.com/mapbox/MapboxNavigation.swift","homepage":"","size":356,"stargazers_count":32,"watchers_count":32,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91"},"html":{"href":"https://github.com/mapbox/MapboxNavigation.swift/pull/91"},"issue":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/91"},"comments":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/MapboxNavigation.swift/statuses/00ac3ec744a75782783cd6a3fd6343625ca6c18d"}}}}
{"actor":{"display_login":"1ec5"}}