NMAMeasurementSystemMetric
Closed this issue · 5 comments
Hi,
what is equivalent of the NMAMeasurementSystemMetric in this msdkUI for :
NMANavigationManager.sharedInstance().voicePackageMeasurementSystem = ... ?
I think this is right:
NMANavigationManager.sharedInstance().voicePackageMeasurementSystem = .metric
but is needed ImperiaUS, then it would be:
NMANavigationManager.sharedInstance().voicePackageMeasurementSystem = .imperialUS ?
Do you have some description/documentation about it?
thank you,
Alex
It's documented here: HERE iOS SDK, NMAMeasurementSystem
- so, yes, it should be imperialUS
to give you miles and feet.
Thanks a lot, @datasun !
Additional is needed to switch specifically the shown guidance that is displayed on the screen for the user in guidance maneuver view etc. it is showing turn by turn directions and distance to next maneuvers in miles/yards/feet instead of miles/feet .
Therefore is needed to switch to imperialUS to display miles/feet
I think for calculate a route (func calculateRoute) set object RoutingMode https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMARoutingMode.html with property units. Right?
But type of units property is NMAUrbanMobilityUnits was deprecated since v. 3.8
How can I set the imperialUS to display miles/feet?
Please help...
GuidanceManeuverView has a property distanceFormatter that allows to specify a MeasurementFormatter. You don't need to set the locale when calculating the route, it should be enough to specify the locale when presenting it.
@datasun , according to your suggestion it should just work without any adjustments just by following the locale setting in the device. At least in the US it is not working. Try setting your region to USA and you will get miles/yards/feet that is definitely not part of the US locale. It should show miles/feet only and it is definitely not doing that.
@webmasterwashny, it will not "just work without any adjustments". You have to set the MeasurementFormatter. See previous comment. For example:
let measurementFormatter = MeasurementFormatter()
measurementFormatter.unitOptions = .providedUnit
measurementFormatter.unitStyle = .short
measurementFormatter.locale = Locale(identifier: "en_US")
guidanceManeuverView.distanceFormatter = measurementFormatter