ব্যবহারকারীর রুটে নেভিগেট করার সাথে সাথে পরিবর্তিত বিভিন্ন ইভেন্ট শুনতে এবং প্রতিক্রিয়া জানাতে আপনার অ্যাপকে সক্ষম করতে এই নির্দেশিকাটি ব্যবহার করুন। এই নির্দেশিকাটি একটি রুট সংজ্ঞায়িত করে না, শুধুমাত্র একটি রুট বরাবর ইভেন্টগুলির প্রতিক্রিয়া জানায়৷
ওভারভিউ
iOS-এর জন্য নেভিগেশন SDK আপনাকে ব্যবহারকারীর অবস্থানের সাথে যুক্ত শ্রোতাদের এবং রুট বরাবর অবস্থা এবং গুরুত্বপূর্ণ সময় এবং দূরত্বের ডেটা সরবরাহ করে। মানচিত্রের ভিউ কন্ট্রোলারে, আপনার অ্যাপটিকে এই শ্রোতাদের জন্য প্রোটোকল গ্রহণ করতে হবে: GMSRoadSnappedLocationProviderListener
এবং GMSNavigatorListener
।
এই তালিকাটি নেভিগেশন ইভেন্টগুলির জন্য উপলব্ধ শ্রোতা পদ্ধতিগুলি দেখায়:
-
GMSNavigatorListener.didArriveAtWaypoint
, একটি গন্তব্যে পৌঁছে গেলে ট্রিগার হয়। -
GMSNavigatorListener.navigatorDidChangeRoute
, যখন রুট পরিবর্তন হয় তখন ট্রিগার হয়। -
GMSNavigatorListener.didUpdateRemainingTime
, নির্দেশিকা সক্রিয় থাকাকালীন পরবর্তী গন্তব্য পরিবর্তনের সময় হিসাবে বারবার বলা হয়। -
GMSNavigatorListener.didUpdateRemainingDistance
, নির্দেশিকা সক্রিয় থাকাকালীন পরবর্তী গন্তব্যের দূরত্ব পরিবর্তন হিসাবে বারবার বলা হয়। -
GMSNavigatorListener.didUpdateDelayCategory
, নির্দেশিকা সক্রিয় থাকাকালীন পরবর্তী গন্তব্যে বিলম্বের বিভাগ পরিবর্তিত হলে বলা হয়। -
GMSNavigatorListener.didChangeSuggestedLightingMode
, যখন আনুমানিক আলোর অবস্থা আপডেট করা হয় তখন ট্রিগার হয়৷ উদাহরণস্বরূপ, যখন ব্যবহারকারীর বর্তমান অবস্থানে রাত পড়ে তখন আলোর পরিবর্তন হয়। -
GMSNavigatorListener.didUpdateSpeedingPercentage
, চালক যখন গতিসীমা অতিক্রম করে তখন ট্রিগার হয়। -
GMSRoadSnappedLocationProviderListener.didUpdateLocation
, ব্যবহারকারীর অবস্থান পরিবর্তনের সাথে সাথে বারবার বলা হয়।
কোড দেখুন
একটি ইভেন্ট শ্রোতার জন্য সুইফট কোড দেখান/লুকান।
/* * Copyright 2020 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import GoogleNavigation import UIKit class ViewController: UIViewController, GMSNavigatorListener, GMSRoadSnappedLocationProviderListener { var mapView: GMSMapView! var locationManager: CLLocationManager! override func loadView() { locationManager = CLLocationManager() let camera = GMSCameraPosition.camera(withLatitude: 47.67, longitude: -122.20, zoom: 14) mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera) // Add listeners for GMSNavigator and GMSRoadSnappedLocationProvider. mapView.navigator?.add(self) mapView.roadSnappedLocationProvider?.add(self) // Set the time update threshold (seconds) and distance update threshold (meters). mapView.navigator?.timeUpdateThreshold = 10 mapView.navigator?.distanceUpdateThreshold = 100 // Show the terms and conditions. let companyName = "Ride Sharing Co." GMSNavigationServices.showTermsAndConditionsDialogIfNeeded( withCompanyName: companyName ) { termsAccepted in if termsAccepted { // Enable navigation if the user accepts the terms. self.mapView.isNavigationEnabled = true // Request authorization to use location services. self.locationManager.requestAlwaysAuthorization() // Request authorization for alert notifications which deliver guidance instructions // in the background. UNUserNotificationCenter.current().requestAuthorization(options: [.alert]) { granted, error in // Handle denied authorization to display notifications. if !granted || error != nil { print("Authorization to deliver notifications was rejected.") } } } else { // Handle the case when the user rejects the terms and conditions. } } view = mapView makeButton() } // Create a route and start guidance. @objc func startNav() { var destinations = [GMSNavigationWaypoint]() destinations.append( GMSNavigationWaypoint.init( placeID: "ChIJnUYTpNASkFQR_gSty5kyoUk", title: "PCC Natural Market")!) destinations.append( GMSNavigationWaypoint.init( placeID: "ChIJJ326ROcSkFQRBfUzOL2DSbo", title: "Marina Park")!) mapView.navigator?.setDestinations(destinations) { routeStatus in guard routeStatus == .OK else { print("Handle route statuses that are not OK.") return } self.mapView.navigator?.isGuidanceActive = true self.mapView.cameraMode = .following self.mapView.locationSimulator?.simulateLocationsAlongExistingRoute() } mapView.roadSnappedLocationProvider?.startUpdatingLocation() } // Listener to handle continuous location updates. func locationProvider( _ locationProvider: GMSRoadSnappedLocationProvider, didUpdate location: CLLocation ) { print("Location: \(location.description)") } // Listener to handle speeding events. func navigator( _ navigator: GMSNavigator, didUpdateSpeedingPercentage percentageAboveLimit: CGFloat ) { print("Speed is \(percentageAboveLimit) above the limit.") } // Listener to handle arrival events. func navigator(_ navigator: GMSNavigator, didArriveAt waypoint: GMSNavigationWaypoint) { print("You have arrived at: \(waypoint.title)") mapView.navigator?.continueToNextDestination() mapView.navigator?.isGuidanceActive = true } // Listener for route change events. func navigatorDidChangeRoute(_ navigator: GMSNavigator) { print("The route has changed.") } // Listener for time to next destination. func navigator(_ navigator: GMSNavigator, didUpdateRemainingTime time: TimeInterval) { print("Time to next destination: \(time)") } // Delegate for distance to next destination. func navigator( _ navigator: GMSNavigator, didUpdateRemainingDistance distance: CLLocationDistance ) { let miles = distance * 0.00062137 print("Distance to next destination: \(miles) miles.") } // Delegate for traffic updates to next destination func navigator( _ navigator: GMSNavigator, didUpdate delayCategory: GMSNavigationDelayCategory ) { print("Delay category to next destination: \(String(describing: delayCategory)).") } // Delegate for suggested lighting mode changes. func navigator( _ navigator: GMSNavigator, didChangeSuggestedLightingMode lightingMode: GMSNavigationLightingMode ) { print("Suggested lighting mode has changed: \(String(describing: lightingMode))") // Change to the suggested lighting mode. mapView.lightingMode = lightingMode } // Add a button to the view. func makeButton() { // Start navigation. let navButton = UIButton(frame: CGRect(x: 5, y: 150, width: 200, height: 35)) navButton.backgroundColor = .blue navButton.alpha = 0.5 navButton.setTitle("Start navigation", for: .normal) navButton.addTarget(self, action: #selector(startNav), for: .touchUpInside) self.mapView.addSubview(navButton) } }
ইভেন্ট শ্রোতার জন্য অবজেক্টিভ-সি কোড দেখান/লুকান।
/* * Copyright 2020 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "ViewController.h" @import GoogleNavigation; @interface ViewController () <GMSNavigatorListener, GMSRoadSnappedLocationProviderListener> @end @implementation ViewController { GMSMapView *_mapView; CLLocationManager *_locationManager; } - (void)loadView { _locationManager = [[CLLocationManager alloc] init]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:47.67 longitude:-122.20 zoom:14]; _mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // Add listeners for GMSNavigator and GMSRoadSnappedLocationProvider. [_mapView.navigator addListener:self]; [_mapView.roadSnappedLocationProvider addListener:self]; // Set the time update threshold (seconds) and distance update threshold (meters). _mapView.navigator.timeUpdateThreshold = 10; _mapView.navigator.distanceUpdateThreshold = 100; // Show the terms and conditions. NSString *companyName = @"Ride Sharing Co."; [GMSNavigationServices showTermsAndConditionsDialogIfNeededWithCompanyName:companyName callback:^(BOOL termsAccepted) { if (termsAccepted) { // Enable navigation if the user accepts the terms. _mapView.navigationEnabled = YES; // Request authorization to use location services. [_locationManager requestAlwaysAuthorization]; } else { // Handle the case when the user rejects the terms and conditions. } }]; self.view = _mapView; [self makeButton]; } // Create a route and initiate navigation. - (void)startNav { NSArray<GMSNavigationWaypoint *> *destinations = @[[[GMSNavigationWaypoint alloc] initWithPlaceID:@"ChIJnUYTpNASkFQR_gSty5kyoUk" title:@"PCC Natural Market"], [[GMSNavigationWaypoint alloc] initWithPlaceID:@"ChIJJ326ROcSkFQRBfUzOL2DSbo" title:@"Marina Park"]]; [_mapView.navigator setDestinations:destinations callback:^(GMSRouteStatus routeStatus){ _mapView.navigator.guidanceActive = YES; _mapView.navigator.sendsBackgroundNotifications = YES; _mapView.cameraMode = GMSNavigationCameraModeFollowing; [_mapView.locationSimulator simulateLocationsAlongExistingRoute]; }]; [_mapView.roadSnappedLocationProvider startUpdatingLocation]; } #pragma mark - GMSNavigatorListener // Listener for continuous location updates. - (void)locationProvider:(GMSRoadSnappedLocationProvider *)locationProvider didUpdateLocation:(CLLocation *)location { NSLog(@"Location: %@", location.description); } // Listener to handle speeding events. - (void)navigator:(GMSNavigator *)navigator didUpdateSpeedingPercentage:(CGFloat)percentageAboveLimit { NSLog(@"Speed is %f percent above the limit.", percentageAboveLimit); } // Listener to handle arrival events. - (void)navigator:(GMSNavigator *)navigator didArriveAtWaypoint:(GMSNavigationWaypoint *)waypoint { NSLog(@"You have arrived at: %@", waypoint.title); [_mapView.navigator continueToNextDestination]; _mapView.navigator.guidanceActive = YES; } // Listener for route change events. - (void)navigatorDidChangeRoute:(GMSNavigator *)navigator { NSLog(@"The route has changed."); } // Listener for time to next destination. - (void)navigator:(GMSNavigator *)navigator didUpdateRemainingTime:(NSTimeInterval)time { NSLog(@"Time to next destination: %f", time); } // Listener for distance to next destination. - (void)navigator:(GMSNavigator *)navigator didUpdateRemainingDistance:(CLLocationDistance)distance { double miles = distance * 0.00062137; NSLog(@"%@", [NSString stringWithFormat:@"Distance to next destination: %.2f.", miles]); } // Listener for traffic updates for next destination - (void)navigator:(GMSNavigator *)navigator didUpdateDelayCategory:(GMSNavigationDelayCategory)delayCategory { NSLog(@"Delay category to next destination: %ld.", delayCategory); } // Listener for suggested lighting mode changes. -(void)navigator:(GMSNavigator *)navigator didChangeSuggestedLightingMode:(GMSNavigationLightingMode)lightingMode { NSLog(@"Suggested lighting mode has changed: %ld", (long)lightingMode); // Change to the suggested lighting mode. _mapView.lightingMode = lightingMode; } #pragma mark - Programmatic UI elements // Add a button to the view. - (void)makeButton { // Start navigation. UIButton *navButton = [UIButton buttonWithType:UIButtonTypeCustom]; [navButton addTarget:self action:@selector(startNav) forControlEvents:UIControlEventTouchUpInside]; [navButton setTitle:@"Navigate" forState:UIControlStateNormal]; [navButton setBackgroundColor:[UIColor blueColor]]; [navButton setAlpha:0.5]; navButton.frame = CGRectMake(5.0, 150.0, 100.0, 35.0); [_mapView addSubview:navButton]; } @end
প্রয়োজনীয় প্রোটোকলের সাথে সামঞ্জস্য ঘোষণা করা
নেভিগেশন পদ্ধতি প্রয়োগ করার আগে, ভিউ কন্ট্রোলারকে অবশ্যই প্রোটোকলগুলি গ্রহণ করতে হবে:
class ViewController: UIViewController, GMSNavigatorListener,
GMSRoadSnappedLocationProviderListener {
@interface ViewController () <GMSNavigatorListener,
GMSRoadSnappedLocationProviderListener>
@end
নেভিগেশন প্রোটোকল গ্রহণ করার পরে, শ্রোতাদের ভিউ কন্ট্রোলারে সেট করুন। উদাহরণস্বরূপ, আপনি viewDidLoad()
পদ্ধতিতে নিম্নলিখিত কোড যোগ করতে পারেন।
mapView.navigator?.add(self) mapView.roadSnappedLocationProvider?.add(self)
[_mapView.navigator addListener:self]; [_mapView.roadSnappedLocationProvider
addListener:self];
অবস্থান আপডেট গ্রহণ বা বন্ধ করা
ম্যাপে ব্যবহারকারীর অগ্রগতি দেখানোর জন্য অবস্থান আপডেটের প্রয়োজন।
location
উদাহরণ নিম্নলিখিত বৈশিষ্ট্যগুলিকে প্রকাশ করে:
অবস্থান সম্পত্তি | বর্ণনা |
---|---|
উচ্চতা | বর্তমান উচ্চতা। |
coordinate.latitude | বর্তমান রাস্তার স্ন্যাপড অক্ষাংশ স্থানাঙ্ক। |
coordinate.longitude | বর্তমান রাস্তা-ছাড়া দ্রাঘিমাংশ স্থানাঙ্ক। |
অবশ্যই | ডিগ্রী বর্তমান ভারবহন. |
গতি | বর্তমান গতি। |
টাইমস্ট্যাম্প | বর্তমান পড়ার তারিখ/সময়। |
ক্রমাগত অবস্থানের আপডেট পেতে, mapView.roadSnappedLocationProvider.startUpdatingLocation
এ কল করুন এবং didUpdateLocation
ইভেন্টটি পরিচালনা করতে GMSRoadSnappedLocationProviderListener
ব্যবহার করুন।
নিম্নলিখিত উদাহরণ দেখায় কলিং startUpdatingLocation
:
mapView.roadSnappedLocationProvider.startUpdatingLocation()
[_mapView.roadSnappedLocationProvider startUpdatingLocation];
নিম্নলিখিত কোডটি একটি GMSRoadSnappedLocationProviderListener
তৈরি করে যা didUpdateLocation
ইভেন্ট পরিচালনা করে।
func locationProvider(_ locationProvider: GMSRoadSnappedLocationProvider,
didUpdate location: CLLocation) { print("Location: \(location.description)") }
- (void)locationProvider:(GMSRoadSnappedLocationProvider *)locationProvider
didUpdateLocation:(CLLocation *)location { NSLog(@"Location: %@",
location.description); }
অ্যাপটি ব্যাকগ্রাউন্ডে থাকা অবস্থায় অবস্থানের আপডেট পেতে, allowsBackgroundLocationUpdates
সত্যে সেট করুন:
mapView.roadSnappedLocationProvider.allowsBackgroundLocationUpdates = true
_mapView.roadSnappedLocationProvider.allowsBackgroundLocationUpdates = YES;
আগমন ঘটনা সনাক্ত করা
কোন গন্তব্যে পৌঁছানো হয়েছে তা শনাক্ত করতে আপনার অ্যাপ didArriveAtWaypoint
ইভেন্ট ব্যবহার করে। আপনি গাইডেন্স পুনরায় শুরু করতে পারেন এবং continueToNextDestination()
কল করে এবং তারপর নির্দেশিকা পুনরায় সক্ষম করে পরবর্তী ওয়েপয়েন্টে যেতে পারেন। continueToNextDestination()
কল করার পরে আপনার অ্যাপটিকে অবশ্যই নির্দেশিকা পুনরায় সক্ষম করতে হবে।
অ্যাপটি continueToNextDestination
কল করার পরে, নেভিগেটরের কাছে আর আগের গন্তব্য সম্পর্কে ডেটা থাকে না। আপনি যদি রুট লেগ সম্পর্কে তথ্য বিশ্লেষণ করতে চান, তাহলে continueToNextDestination()
এ কল করার আগে আপনাকে অবশ্যই নেভিগেটর থেকে এটি পুনরুদ্ধার করতে হবে।
নিম্নলিখিত কোড উদাহরণ didArriveAtWaypoint
ইভেন্ট পরিচালনা করার একটি পদ্ধতি দেখায়:
func navigator(_ navigator: GMSNavigator, didArriveAt waypoint:
GMSNavigationWaypoint) { print("You have arrived at: \(waypoint.title)")
mapView.navigator?.continueToNextDestination()
mapView.navigator?.isGuidanceActive = true }
- (void)navigator:(GMSNavigator *)navigator
didArriveAtWaypoint:(GMSNavigationWaypoint *)waypoint { NSLog(@"You have
arrived at: %@", waypoint.title); [_mapView.navigator
continueToNextDestination]; _mapView.navigator.guidanceActive = YES; }
রুট পরিবর্তনের আপডেট গ্রহণ করা হচ্ছে
যখনই রুট পরিবর্তন করা হয় তখন একটি বিজ্ঞপ্তি পেতে, navigatorDidChangeRoute
ইভেন্ট পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন। আপনি GMSNavigator
এর routeLegs
এবং currentRouteLeg
বৈশিষ্ট্য ব্যবহার করে নতুন রুট অ্যাক্সেস করতে পারেন।
func navigatorDidChangeRoute(_ navigator: GMSNavigator) { print("The route has
changed.") }
- (void)navigatorDidChangeRoute:(GMSNavigator *)navigator { NSLog(@"The route
has changed."); }
গন্তব্য আপডেট সময় প্রাপ্তি
গন্তব্য আপডেটে ক্রমাগত সময় পেতে, didUpdateRemainingTime
ইভেন্টটি পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন। time
প্যারামিটার আনুমানিক সময় প্রদান করে, সেকেন্ডে, পরবর্তী গন্তব্যে পৌঁছানো পর্যন্ত।
func navigator(_ navigator: GMSNavigator, didUpdateRemainingTime time:
TimeInterval) { print("Time to next destination: \(time)") }
- (void)navigator:(GMSNavigator *)navigator
didUpdateRemainingTime:(NSTimeInterval)time { NSLog(@"Time to next
destination: %f", time); }
পরবর্তী গন্তব্যে আনুমানিক সময়ের ন্যূনতম পরিবর্তন সেট করতে, GMSNavigator
এ timeUpdateThreshold
বৈশিষ্ট্য সেট করুন। মান সেকেন্ডে নির্দিষ্ট করা হয়. যদি এই সম্পত্তি সেট করা না থাকে, পরিষেবাগুলি এক সেকেন্ডের একটি ডিফল্ট মান ব্যবহার করে।
navigator?.timeUpdateThreshold = 10
navigator.timeUpdateThreshold = 10;
গন্তব্য আপডেট দূরত্ব গ্রহণ
গন্তব্য আপডেটে ক্রমাগত দূরত্ব পেতে, didUpdateRemainingDistance
ইভেন্টটি পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন। distance
প্যারামিটারটি পরবর্তী গন্তব্যে মিটারে আনুমানিক দূরত্ব প্রদান করে।
func navigator(_ navigator: GMSNavigator, didUpdateRemainingDistance distance:
CLLocationDistance) { let miles = distance * 0.00062137 print("Distance to next
destination: \(miles) miles.") }
- (void)navigator:(GMSNavigator *)navigator
didUpdateRemainingDistance:(CLLocationDistance)distance { double miles =
distance * 0.00062137; NSLog(@"%@", [NSString stringWithFormat:@"Distance to
next destination: %.2f.", miles]); }
পরবর্তী গন্তব্যে আনুমানিক দূরত্বের ন্যূনতম পরিবর্তন সেট করতে, GMSNavigator
এ distanceUpdateThreshold
প্রপার্টি সেট করুন (মান মিটারে নির্দিষ্ট করা আছে)। এই সম্পত্তি সেট করা না থাকলে, পরিষেবাগুলি এক মিটারের একটি ডিফল্ট মান ব্যবহার করে৷
navigator?.distanceUpdateThreshold = 100
navigator.distanceUpdateThreshold = 100;
ট্রাফিক আপডেট গ্রহণ
অবশিষ্ট রুটের ট্রাফিক প্রবাহের ক্রমাগত আপডেট পেতে, didUpdateDelayCategory
ইভেন্টটি পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন। delayCategoryToNextDestination
এ একটি কল GMSNavigationDelayCategory
প্রদান করে যা 0 থেকে 3 এর মান প্রদান করে। ক্যাটাগরির আপডেটগুলি অ্যাপ ব্যবহারকারীর বর্তমান অবস্থানের উপর ভিত্তি করে করা হয়। ট্র্যাফিক ডেটা অনুপলব্ধ হলে, GMSNavigationDelayCategory
0 ফেরত দেয়। সংখ্যা, 1-3, হালকা থেকে ভারী প্রবাহ বৃদ্ধি নির্দেশ করে।
func navigator(_ navigator: GMSNavigator, didUpdate delayCategory:
GMSNavigationDelayCategory) { print("Traffic flow to next destination:
\(delayCategory)") }
- (void)navigator:(GMSNavigator *)navigator
didUpdateDelayCategory:(GMSNavigationDelayCategory)delayCategory {
NSLog(@"Traffic flow to next destination: %ld", (long)delayCategory); }
GMSNavigationDelayCategory
প্রপার্টি নিম্নলিখিত বিলম্বের স্তরগুলিকে প্রকাশ করে:
বিলম্ব বিভাগ | বর্ণনা |
---|---|
GMSNavigationDelayCategoryNoData | 0 - অনুপলব্ধ, ট্রাফিকের জন্য কোন ডেটা বা: |
রুট | |
GMSNavigationDelayCategory Heavy | 1 - ভারী। |
GMSNavigationDelayCategoryMedium | 2 - মাঝারি। |
GMSNavigationDelayCategoryLight | 3 - হালকা। |
দ্রুতগতির আপডেট গ্রহণ করা হচ্ছে
ড্রাইভার যখন গতিসীমা অতিক্রম করে তখন আপডেট পেতে, didUpdateSpeedingPercentage
ইভেন্টটি পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন।
// Listener to handle speeding events. func navigator( _ navigator:
GMSNavigator, didUpdateSpeedingPercentage percentageAboveLimit: CGFloat ) {
print("Speed is \(percentageAboveLimit) above the limit.") }
// Listener to handle speeding events. - (void)navigator:(GMSNavigator
*)navigator didUpdateSpeedingPercentage:(CGFloat)percentageAboveLimit {
NSLog(@"Speed is %f percent above the limit.", percentageAboveLimit); }
প্রস্তাবিত আলো মোড পরিবর্তন করা হচ্ছে
আলোতে আনুমানিক পরিবর্তনের আপডেট পেতে, didChangeSuggestedLightingMode
ইভেন্টটি পরিচালনা করার জন্য একটি পদ্ধতি তৈরি করুন।
// Define a listener for suggested changes to lighting mode. func navigator(_
navigator: GMSNavigator, didChangeSuggestedLightingMode lightingMode:
GMSNavigationLightingMode) { print("Suggested lighting mode has changed:
\(String(describing: lightingMode))")
// Make the suggested change. mapView.lightingMode = lightingMode }
// Define a listener for suggested changes to lighting mode.
-(void)navigator:(GMSNavigator *)navigator didChangeSuggestedLightingMode:
(GMSNavigationLightingMode)lightingMode { NSLog(@"Suggested lighting mode has
changed: %ld", (long)lightingMode);
// Make the suggested change. _mapView.lightingMode = lightingMode; }