Navigation SDK Documentation

Functions
Localization Functions

Functions

SDK_ERROR SDK_API SDK_GetMetric (SDK_INT4 *pMetric)
 
SDK_ERROR SDK_API SDK_SetMetric (SDK_INT4 metric)
 
SDK_ERROR SDK_API SDK_GetLocalizedUnitName (SDK_INT4 category, SDK_BOOL bigUnit, SDK_WCHAR_T const **unitName)
 
SDK_ERROR SDK_API SDK_GetLocalizedUnitValue (SDK_INT4 category, SDK_BOOL bigUnit, SDK_DOUBLE value, SDK_DOUBLE *localizedValue)
 
SDK_ERROR SDK_API SDK_GetLocalizedDistanceString (SDK_INT4 value, SDK_BOOL quantify, SDK_WCHAR_T **valueString, SDK_BOOL allowNow, SDK_WCHAR_T *nowString, SDK_WCHAR_T decimalSeparator, SDK_BOOL ommitDecimalNull)
 
SDK_ERROR SDK_API SDK_GetLanguage (const SDK_WCHAR_T **ppLanguage)
 
SDK_ERROR SDK_API SDK_SetLanguage (const SDK_WCHAR_T *pLanguage)
 

Detailed Description

Functions for Localization.

Function Documentation

SDK_ERROR SDK_API SDK_GetMetric ( SDK_INT4 pMetric)

Query the metric used for Navigation/guidance information.

The default metric is SDK_sm_KM

Parameters
[out]pMetricWill be se to the current metric (see Metric constants).
Returns
Error code (Errorcodes)
SDK_ERROR SDK_API SDK_SetMetric ( SDK_INT4  metric)

Set the metric Setting the metric is used to calculate values in the standard metric system, in the british unit system or in the us system. A metric can be one of the three types: SDK_sm_KM: use metric system ([m],[km],[t]) SDK_sm_MI: use english system SDK_sm_MI_USA: us system The metric will be automatically used when set for calculating the correct announcement times and for the measure control on the map. Also, the fields RoundedDistToNextManeuver and RoundedDistFromNextToSecondNextManeuver of SDK_NavigationInformation will be returned in the current set metric unit. Attention: All other returned values like speedlimits or distances to maneuvers will not be transformed, they are always delivered in the standard metric system [m]. Transforming these values can be done manually to another metric by using SDK_GetLocalizedDistanceString, SDK_GetLocalizedUnitValue and SDK_GetLocalizedUnitName.

Bug:
Currently there is no explicit error code being returned. If the value is invalid then the metric will automatically be set to SDK_sm_KM!
Parameters
[in]metricOne constant of Metric constants
Returns
Error code: SDK_ERROR_InvalidParameter if the metric is invalid, SDK_ERROR_Ok else
SDK_ERROR SDK_API SDK_GetLocalizedUnitName ( SDK_INT4  category,
SDK_BOOL  bigUnit,
SDK_WCHAR_T const **  unitName 
)

Query the localized name of the unit defined by the current set metric.

Parameters
[in]categoryThe physical quantity. See Unit categories
[in]bigUnitTrue, if "big" units (i.e. kilometers, miles) or false, if "small" units (meters, yards, feet) should be used
[out]unitNameWill be set to pointer to the name of the selected unit. This memory must not be modified or released.
Returns
Error code (Errorcodes)
SDK_ERROR SDK_API SDK_GetLocalizedUnitValue ( SDK_INT4  category,
SDK_BOOL  bigUnit,
SDK_DOUBLE  value,
SDK_DOUBLE localizedValue 
)

Query the transformed and localized value for a given unit and the currently set metric.

Use this to convert from kilometers to miles for example. If the category is SDK_uc_LENGTH, the value is expected in meters. If the category is SDK_uc_HEIGHT, the value is expected in meters. If the category is SDK_uc_VELOCITY, the value is expected in kilometers per hour.

Parameters
[in]categoryThe physical quantity. See Unit categories
[in]bigUnitTrue, if the localized value should use "big" units (i.e. kilometers, miles) or false, if "small" units (meters, yards, feet) should be used
[in]valueThe value to transform and localize
[out]localizedValueWill be set to the transformed and localized value
Returns
Error code (Errorcodes)
SDK_ERROR SDK_API SDK_GetLocalizedDistanceString ( SDK_INT4  value,
SDK_BOOL  quantify,
SDK_WCHAR_T **  valueString,
SDK_BOOL  allowNow,
SDK_WCHAR_T nowString,
SDK_WCHAR_T  decimalSeparator,
SDK_BOOL  ommitDecimalNull 
)

Query the transformed and localized value as a string for a given unit and the currently set metric.

Use this to convert to other units. The quantify flag is especially useful if you'd like to use streamlined values for displaying on the GUI.

Parameters
[in]valueThe value to transform and localize
[in]quantifyFlag whether the distance should be quantified to a reasonable value for the current set metric
[out]valueStringWill be set to the transformed, localized and quantified value string. The memory allocated must be freed by calling SDK_FreeString()!
[in]allowNowallow the function to return the given nowString instead of the distance, used for the now maneuver
[in]nowStringthe string to return, if allowNow is set and the distance is below or equal the "now" distance
[in]decimalThe stadnard '.' decimal separator will be replaced with decimalSeparator if set
[in]ommitDecimalNullif set SDK_TRUE, integral distances are not given as floating value (e.g. 2 km instead of 2.0 km).
Returns
Error code (Errorcodes)
SDK_ERROR SDK_API SDK_GetLanguage ( const SDK_WCHAR_T **  ppLanguage)

Query the currently used language.

See SDK_SetLanguage about usage of language settings within the Navigation SDK.

Parameters
[out]ppLanguagePointer to retrieve the language code according to ISO 639-1 (alpha-2). Note that the content of the returned pointer may change (e.g. by calling SDK_SetLanguage()), so one should not keep references around, but copy that string.
Returns
Error code (Errorcodes)
SDK_ERROR SDK_API SDK_SetLanguage ( const SDK_WCHAR_T pLanguage)

Set the used language.

The language is used for the names of POI layers and the textual representation of TMC messages. The POI layer names will be retrieved from a file called addr.uni which has to reside in the addr path set by SDK_Initialize. This call may take a few seconds if a new language database for TMC has to be loaded. Prior to calling this there is no defined default language!

Parameters
[in]pLanguageLanguage code according to ISO 639-1 (alpha-2) (e.g. L"de"=German, L"en"=English, L"da"=Danish, L"fr"=French). Use lower-case strings, parsing may be case-sensitive.
Returns
Error code (Errorcodes)

© PTV Group 2018 Generated on Mon Dec 17 2018 21:00:22 for NavigationSDK by doxygen 1.8.8