-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.Services.GeoAddress.toLocation
rescocrm edited this page May 15, 2023
·
8 revisions
Translates the civic address represented by GeoAddress object into GPS position.
Argument | Type | Description |
---|---|---|
success | function(location) | A callback function that is called with the location object having latitude and longitude properties. |
failed | function(errorMsg) | A callback which is called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to translate civic address into the GPS position.
var addr = new MobileCRM.Services.GeoAddress();
addr.country = "UK";
addr.city = "London";
addr.street = "Downing Street";
addr.streetNumber = "10";
addr.toLocation(function (location) {
// location is {latitude: 51.50344025, longitude: -0.127708109585621}
MobileCRM.bridge.alert(location.latitude + "\n" + location.longitude);
}, MobileCRM.bridge.alert, null);