Skip to content

sud.getLocation ​

JS
 sud.getLocation(Object object)

Gets the current geolocation and speed.

Parameters

  • Object object: Input parameters, described below.

Properties of object:

PropertyValue TypeRequiredDescription
typestringNoDefaults to wgs84 coordinates; supports gcj02 and bd09 coordinates
altitudestringNoDefaults to false; passing true returns altitude information
isHighAccuracybooleanNoDefaults to false; passing true enables high-accuracy positioning
highAccuracyExpireTimenumberNoHigh-accuracy positioning timeout (ms); returns the highest accuracy within the specified time. High-accuracy positioning is only effective when this value is above 3000ms
successfunctionNoCallback function for a successful API call
failfunctionNoCallback function for a failed API call
completefunctionNoCallback function for API call completion

Parameters of the success callback function

  • Object res: Returns geolocation information.

Properties of res:

PropertyValue TypeDescription
latitudenumberLatitude, range -90~90; negative values indicate south latitude
longitudenumberLongitude, range -180~180; negative values indicate west longitude
speednumberSpeed, in m/s
accuracynumberAccuracy of the location
altitudenumberAltitude, in m
verticalAccuracynumberVertical accuracy, in m (unavailable below Android 8.0, returns 0)
horizontalAccuracynumberHorizontal accuracy, in m