From a16f00966e95d90426ad8b1c8e914683fc1e33cd Mon Sep 17 00:00:00 2001 From: Mmoncadaisla Date: Tue, 18 May 2021 15:14:37 +0200 Subject: [PATCH] Do not set routingmode if transportmode value is equivalent to 'walk' mode for HERE Isolines v8.4 --- .../cartodb_services/cartodb_services/here/routing.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/here/routing.py b/server/lib/python/cartodb_services/cartodb_services/here/routing.py index 0adc519..a26fe37 100644 --- a/server/lib/python/cartodb_services/cartodb_services/here/routing.py +++ b/server/lib/python/cartodb_services/cartodb_services/here/routing.py @@ -168,10 +168,12 @@ class HereMapsRoutingIsolineV8(Traceable): QUALITY_PARAM_V7 = 'quality' DEFAULT_OPTIMIZEFOR = 'quality' DEFAULT_ROUTINGMODE = 'short' + HERE_WALK_MODE = "pedestrian" + HERE_CAR_MODE = "car" ACCEPTED_MODES = { - "walk": "pedestrian", - "car": "car" + "walk": HERE_WALK_MODE, + "car": HERE_CAR_MODE } OPTIONAL_PARAMS = [ @@ -338,7 +340,9 @@ class HereMapsRoutingIsolineV8(Traceable): else: mode_type = self.DEFAULT_ROUTINGMODE - mode_params.update({'routingmode': mode_type}) + # Do not set routingmode if transportmode value is equivalent to 'walk' mode + if mode_source != self.HERE_WALK_MODE: + mode_params.update({'routingmode': mode_type}) if not ('mode_traffic' in options and options['mode_traffic'] == 'enabled'): mode_params.update({'departuretime': 'any'})