From c2db214bea45182802fbedaee7b8afcb34f6028c Mon Sep 17 00:00:00 2001 From: Jill Cardamon Date: Mon, 27 Sep 2021 10:45:34 -0400 Subject: [PATCH 1/2] Use showcase method to display route and destination. --- .../NavigationTutorialViewController.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift b/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift index 220362ad..ed0ae45c 100644 --- a/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift +++ b/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift @@ -123,11 +123,8 @@ class ViewController: UIViewController { // Show the start button strongSelf.startButton?.isHidden = false - // Draw the route on the map after creating it - strongSelf.drawRoute(route: route) - - // Show destination waypoint on the map - strongSelf.navigationMapView.showWaypoints(on: route) + // Showcase the route and destination waypoint, and set camera + strongSelf.navigationMapView.showcase([route], animated: true) } } } From 3c2ddf61e1278b920c4f346c6f6285efb1f0082c Mon Sep 17 00:00:00 2001 From: Jill Cardamon Date: Tue, 28 Sep 2021 09:53:45 -0400 Subject: [PATCH 2/2] Showcase all routes. --- .../NavigationTutorial/NavigationTutorialViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift b/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift index ed0ae45c..cfacd071 100644 --- a/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift +++ b/DocsCode/NavigationTutorial/NavigationTutorialViewController.swift @@ -113,7 +113,7 @@ class ViewController: UIViewController { case .failure(let error): print(error.localizedDescription) case .success(let response): - guard let route = response.routes?.first, let strongSelf = self else { + guard let routes = response.routes, let strongSelf = self else { return } @@ -124,7 +124,7 @@ class ViewController: UIViewController { strongSelf.startButton?.isHidden = false // Showcase the route and destination waypoint, and set camera - strongSelf.navigationMapView.showcase([route], animated: true) + strongSelf.navigationMapView.showcase(routes, animated: true) } } }