API Reference - Navigation.GetCurrentPosition()
Navigation.GetCurrentPosition()
Navigation.GetCurrentPosition()
Description | Retrieves the current position and stores it inside Navigation.CurrentPosition . |
Response | Boolean True If the value is now correctly stored in Navigation.CurrentPosition , else False if the process failed. |
Parameter | Void |
Fields
Navigation.CurrentPosition
is the object where are stored the informations about the current position after a successful call to Navigation.GetCurrentPosition
.
Navigation.CurrentPosition.Address
, StringNavigation.CurrentPosition.Town
, StringNavigation.CurrentPosition.City
, StringNavigation.CurrentPosition.Province
, StringNavigation.CurrentPosition.Country
, String
Example
1
2
3
4
5
6
7
8
9
10
if ( Navigation.GetCurrentPosition === false ) {
// GPS error, Navigation.CurrentPosition is empty
} else {
Navigation.GetCurrentPosition();
var Storedaddress = Navigation.CurrentPosition.Address;
var StoredTown = Navigation.CurrentPosition.Town;
var StoredCity = Navigation.CurrentPosition.City;
var StoredProvince = Navigation.CurrentPosition.Province;
var StoredCountry = Navigation.CurrentPosition.Country;
}
Remark
Note:
Navigation.GetCurrentPosition
must always be used before accessing the value stored inNavigation.CurrentPosition
.
Note 2: Some fields like
Province
are not used in some countries so its value will stay empty in such a case.
Appeared in Software version 40.03.42.30