Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route congestion level not displayed on NavigationMode #102

Open
santu1990 opened this issue Feb 12, 2025 · 0 comments
Open

Route congestion level not displayed on NavigationMode #102

santu1990 opened this issue Feb 12, 2025 · 0 comments

Comments

@santu1990
Copy link

santu1990 commented Feb 12, 2025

Steps to Trigger Behavior

  1. Make Route object from third part direction API
  2. Start Navigation using Route
  3. It starts the Navigation and updates the distance label(at bottom) color as per congestion level but it doesn't show congestion over route.

Link to Minimal Reproducible Example : NA

Expected Behavior : When we draw route after adding Source and destination, it should draw route with congestion(Route color)

Actual Behavior: IT displays route but doesn't change route color as per congestion data

Screenshots : https://github.com/user-attachments/assets/9d58f8fd-7a59-4491-98bc-397bb52cb54c

Version(s) affected

  • Platform: iOS
  • OS version: [e.g. Android 9, iOS 10]
  • Device type: [e.g. iPhone6]
  • Emulator/ Simulator:Both
  • Development OS: [e.g. OSX 11.0.1, Win10]
  • maplibre-navigation-ios Version [e.g. 7.0.9]
  • MapLibre GL version [e.g. 6.3.0]

Additional context

Image

Code snippet where I pass to invoke Navigation with Route

`private func startNavigationWithRouteData(response: RouteResponse) {

guard let routeData = response.routeData else { return }
var waypts: [Waypoint] = []
if let waypoints = routeData.waypoints {
waypts = waypoints.compactMap { waypoint -> Waypoint? in
guard let loc = waypoint.location, loc.count == 2 else { return nil }
return Waypoint(coordinate: CLLocationCoordinate2D(latitude: loc[0], longitude: loc[1]))
}
}

    let routeOptions = NavigationRouteOptions(waypoints: waypts, profileIdentifier: .automobileAvoidingTraffic)
    routeOptions.shapeFormat = .polyline
    routeOptions.distanceMeasurementSystem = .metric
    routeOptions.attributeOptions = [.congestionLevel, .distance, .expectedTravelTime, .speed]
    routeOptions.includesSteps = true

    if let route = response.routeData?.routes?.first {
        if let routeJson = routeToDictionary(route: route) {
            let route = Route(json: routeJson, waypoints: waypts, options: routeOptions)
            // Set up options for the navigation
            let simulatedLocationManager = SimulatedLocationManager(route: route)
            simulatedLocationManager.speedMultiplier = 2  // Set the speed multiplier as needed
            // Start navigation
            self.viewController.isUsedInConjunctionWithCarPlayWindow = true
            self.viewController.startNavigation(with: route, animated: true, locationManager: simulatedLocationManager)
        }
    }
} 

`

Route Response with congestion Data which is passed to Navigation as Route:

{"origin":"28.396599,77.267772","destination":"28.47716,77.06847","waypoints":[],"routeData":{"code":"Ok","message":null,"waypoints":[{"distance":58.515,"name":"","location":["77.267772","28.396599"]},{"distance":58.515,"name":"","location":["77.06847","28.47716"]}],"routes":[{"geometry":"","legs":[{"distance":27786,"duration":2142,"durationTypical":1834,"steps":[{"geometry":"ahilDmfrvM|@tA","distance":54,"duration":19,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"Turn left toward Achievers Mall Road. Go for 54 m.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"Turn left toward Achievers Mall Road. Go for 54 m.","type":"turn","modifier":"left","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"turn","modifier":"left","text":"Turn left toward Achievers Mall Road. Go for 54 m.","components":[{"text":"Turn left toward Achievers Mall Road. Go for 54 m.","type":"text"}]},"distanceAlongGeometry":54}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":4,"tollCollection":null}],"exits":null},{"geometry":"cfilDwcrvMkD|Bi@f@","distance":144,"duration":42,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"Turn right onto Achievers Mall Road. Go for 144 m.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"Turn right onto Achievers Mall Road. Go for 144 m.","type":"turn","modifier":"right","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"turn","modifier":"right","text":"Turn right onto Achievers Mall Road. Go for 144 m.","components":[{"text":"Turn right onto Achievers Mall Road. Go for 144 m.","type":"text"}]},"distanceAlongGeometry":144}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":5,"tollCollection":null}],"exits":null},{"geometry":"","distance":26210,"duration":1907,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"TurnleftontoVBChowktowardGurgaon/IgiAirport.Gofor26.2km.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"TurnleftontoVBChowktowardGurgaon/IgiAirport.Gofor26.2km.","type":"turn","modifier":"left","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"turn","modifier":"left","text":"TurnleftontoVBChowktowardGurgaon/IgiAirport.Gofor26.2km.","components":[{"text":"TurnleftontoVBChowktowardGurgaon/IgiAirport.Gofor26.2km.","type":"text"}]},"distanceAlongGeometry":26210}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":29,"tollCollection":null}],"exits":null},{"geometry":"               }cylDcgluM^hDFl@Hp@Ft@JdA","distance":195,"duration":18,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor195m.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor195m.","type":"continue","modifier":"right","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"continue","modifier":"right","text":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor195m.","components":[{"text":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor195m.","type":"text"}]},"distanceAlongGeometry":195}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":758,"tollCollection":null}],"exits":null},{"geometry":"waylD             }zkuMj@tDTnAPbAHp@","distance":193,"duration":22,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor193m.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor193m.","type":"continue","modifier":"right","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"continue","modifier":"right","text":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor193m.","components":[{"text":"KeeprightontoMehrauliGurugramRoad(NH-236).Gofor193m.","type":"text"}]},"distanceAlongGeometry":193}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":763,"tollCollection":null}],"exits":null},{"geometry":"y~xlDaokuM`@n@NR","distance":43,"duration":3,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"TurnleftontoIffcoChowk.Gofor43m.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"TurnleftontoIffcoChowk.Gofor43m.","type":"turn","modifier":"left","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"turn","modifier":"left","text":"TurnleftontoIffcoChowk.Gofor43m.","components":[{"text":"TurnleftontoIffcoChowk.Gofor43m.","type":"text"}]},"distanceAlongGeometry":43}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":767,"tollCollection":null}],"exits":null},{"geometry":"g           }xlD         }lkuM??","distance":0,"duration":0,"durationTypical":null,"speedLimitUnit":null,"speedLimitSign":null,"name":"ArriveatServiceRoad.","ref":null,"destinations":"","mode":"car","pronunciation":null,"rotaryName":null,"rotaryPronunciation":null,"maneuver":{"location":[77.0684694,28.4771605],"bearing_before":1843,"bearing_after":1834,"instruction":"ArriveatServiceRoad.","type":"arrive","modifier":"straight","exit":null},"voiceInstructions":[],"bannerInstructions":[{"primary":{"type":"arrive","modifier":"straight","text":"ArriveatServiceRoad.","components":[{"text":"ArriveatServiceRoad.","type":"text"}]},"distanceAlongGeometry":0}],"drivingSide":null,"weight":0,"intersections":[{"location":[77.0684694,28.4771605],"admin_index":0,"entry":[],"tunnelName":null,"isUrban":null,"lanes":null,"classes":null,"inIndex":null,"bearings":[],"out":0,"restStop":null,"geometry_index":769,"tollCollection":null}],"exits":null}],"summary":"","admins":null,"incidents":null,"annotation":{"distance":[34,89,54,144,34,21,89,120,204,56,43,57,70,70,34,26,26,16,19,35,20,32,42,115,26,35,129,33,366,296,112,151,265,67,85,337,143,111,51,12,257,13,46,323,232,423,11,22,182,32,35,12,34,17,15,222,76,168,1320,33,133,185,540,510,93,143,213,126,147,146,101,79,49,9,19,181,215,272,105,38,17,76,39,369,12,318,9,336,72,164,281,292,10,233,150,107,93,39,73,92,59,91,118,106,82,169,150,60,428,38,27,102,123,523,160,133,166,65,109,115,47,18,26,20,32,36,113,53,12,41,196,320,114,263,41,176,12,89,118,12,272,107,186,702,39,40,100,22,55,90,129,80,51,97,155,151,191,79,19,26,15,23,27,61,156,54,40,216,28,20,10,25,23,102,161,38,348,94,132,160,26,35,42,12,19,9,32,29,30,82,18,47,64,32,48,110,102,111,66,20,12,18,72,27,25,85,135,26,61,51,47,153,10,23,87,68,26,99,80,106,156,85,23,25,27,35,92,41,60,30,13],"duration":[16,16,19,42,4,2,10,13,22,6,5,6,9,8,4,10,5,2,3,5,3,6,6,11,2,3,10,3,31,20,8,10,18,4,6,23,10,8,4,1,18,1,3,23,16,29,1,2,13,4,4,1,4,1,1,16,5,10,79,2,8,11,32,30,6,9,13,8,9,9,6,5,3,1,1,11,12,16,6,2,1,4,2,22,1,19,1,20,4,9,18,17,1,14,9,6,18,7,14,17,4,6,7,7,5,10,9,4,24,2,2,6,7,30,9,8,9,4,6,2,1,7,19,1,8,9,18,13,1,9,12,5,4,2,2,7,7,6,11,11,9,14,19,10,8,3,1,2,1,2,2,6,3,1,2,10,17,6,14,2,9,1,7,9,1,18,7,12,46,3,3,7,1,4,6,8,5,3,6,10,10,13,7,2,2,1,4,4,6,14,5,4,20,3,2,1,2,2,9,15,3,28,8,11,17,2,3,5,1,2,1,4,4,4,12,5,12,16,9,6,14,11,12,7,2,2,3,10,4,3,8,12,2,5,5,5,14,1,2,8,7,2,9,7,10,14,8,2,2,2,4,10,4,8,2,1],"speed":[6.3888888,6.3888888,6.3888888,6.3888888,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,9.166667,5,6.666667,6.666667,6.666667,6.666667,6.666667,6.9444447,10.833334,12.7777777,12.7777777,12.7777777,12.7777777,11.9444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,8.8888893,8.6111116,8.6111116,8.6111116,11.3888893,11.3888893,13.8888893,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.6666679,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,16.9444447,5.2777781,5.2777781,5.2777781,5.2777781,16.1111107,16.1111107,16.1111107,16.1111107,16.1111107,16.1111107,16.1111107,16.1111107,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,10,13.8888893,13.8888893,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,14.4444447,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,18.8888893,12.5,12.5,12.5,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,15.2777786,10.5555563,10.5555563,10.5555563,10.5555563,6.3888888,6.3888888,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,12.5,12.5,12.5,12.5,9.166667,11.3888893,11.3888893,8.0555553,8.0555553,8.0555553,8.0555553,8.6111116,7.2222223,7.2222223,7.2222223,3.8888891,3.8888891,3.8888891,3.8888891,7.7777781,7.7777781,9.4444447,9.4444447,9.4444447,9.4444447,6.9444447,6.9444447,6.9444447,6.9444447,7.2222223,11.1111116,11.1111116,11.1111116,11.1111116,11.1111116,11.1111116,11.1111116,11.1111116,11.1111116,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,10.833334,9.166667,9.166667,9.166667,9.166667,12.5,12.5],"maxSpeed":[6.3888888,6.3888888,6.3888888,6.3888888,10,10.5555563,11.9444447,13.333334,14.4444447,14.166667,15,14.166667,12.5,10.2777777,6.1111112,6.9444447,6.9444447,6.666667,7.7777781,6.666667,5.5555558,7.2222223,10,12.5,14.166667,14.7222223,15,15.5555563,14.7222223,15.5555563,17.2222233,16.6666679,17.2222233,18.0555553,17.5,17.7777786,16.9444447,17.7777786,16.9444447,17.7777786,17.2222233,18.333334,17.7777786,18.333334,19.7222233,18.8888893,18.333334,18.0555553,16.1111107,13.333334,10.5555563,11.3888893,10,11.3888893,12.2222223,14.166667,17.5,17.7777786,19.4444447,18.8888893,20.2777786,18.8888893,19.4444447,19.4444447,18.8888893,20.5555553,20.2777786,19.4444447,17.7777786,19.4444447,18.333334,17.7777786,16.9444447,18.0555553,18.0555553,17.7777786,17.5,17.7777786,18.8888893,20,19.7222233,19.4444447,19.1666679,20.2777786,21.3888893,20,18.8888893,19.4444447,18.333334,16.9444447,17.7777786,18.333334,19.7222233,18.333334,16.9444447,16.1111107,7.5,2.7777779,5.5555558,12.5,14.7222223,15.5555563,16.6666679,17.7777786,18.333334,17.7777786,18.333334,17.2222233,17.7777786,17.2222233,16.9444447,17.2222233,18.333334,20,20,19.4444447,18.333334,16.9444447,16.1111107,14.4444447,14.7222223,15,16.1111107,16.1111107,11.1111116,12.5,16.1111107,16.9444447,17.7777786,16.9444447,16.1111107,8.0555553,11.3888893,13.0555563,13.8888893,15,15.5555563,16.3888893,16.6666679,16.3888893,16.1111107,14.166667,14.4444447,13.6111116,13.8888893,11.1111116,10,11.666667,11.666667,12.7777777,13.6111116,15.833334,17.5,18.0555553,18.6111107,18.6111107,19.7222233,20.5555553,19.4444447,18.333334,14.4444447,12.5,14.7222223,17.2222233,18.333334,20.2777786,20.5555553,20.2777786,19.7222233,17.7777786,17.2222233,17.7777786,18.333334,18.6111107,18.8888893,20,19.7222233,18.333334,18.0555553,18.333334,19.4444447,17.5,12.7777777,8.0555553,7.7777781,10.5555563,10.5555563,11.3888893,13.6111116,16.3888893,17.7777786,17.7777786,17.2222233,12.5,10,12.2222223,13.0555563,13.6111116,15.5555563,17.5,18.333334,19.1666679,18.8888893,18.6111107,16.1111107,11.666667,8.333334,6.1111112,8.6111116,8.0555553,8.8888893,10.2777777,9.7222223,10.2777777,10.833334,8.8888893,7.5,9.166667,8.0555553,11.1111116,11.9444447,12.2222223,13.333334,12.2222223,11.9444447,11.9444447,11.3888893,9.7222223,10.833334,11.666667,11.9444447,12.2222223,12.5,12.2222223,11.9444447,12.5,12.2222223,14.4444447,14.166667,13.8888893,12.7777777,13.0555563,12.2222223,13.8888893,13.6111116,12.5,12.7777777,12.2222223,11.666667,10.833334,8.6111116,9.4444447,10.2777777,9.166667,9.4444447,9.166667],"congestion":["low","low","low","low","low","low","moderate","moderate","moderate","moderate","moderate","moderate","moderate","low","low","low","moderate","low","low","low","low","low","moderate","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","moderate","low","moderate","moderate","moderate","moderate","low","low","moderate","low","moderate","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","moderate","low","low","low","low","low","low","low","low","low","low","low","moderate","low","low","heavy","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","moderate","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","moderate","moderate","moderate","moderate","moderate","moderate","low","low","low","low","low","low","moderate","moderate","low","low","low","moderate","low","low","low","low","low","moderate","moderate","moderate","moderate","moderate","moderate","moderate","low","low","low","low","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","low","low","low","low","low","low","low","moderate","moderate","moderate","heavy","moderate","heavy","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","moderate","low","low","low","low","low","low","low","moderate","moderate","moderate","low","low","low","moderate","moderate","low","low","low","low","low","low","low","low","low","low","low"]},"closures":null}],"distance":27786,"duration":2142,"durationTypical":1834,"weight":null,"weightName":null,"routeOptions":null,"voiceLanguage":null}],"uuid":"0c9c7481-6862-40bb-9edd-df389c187e3e"}}

Repro Video:

Repro.Video.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant