Skip to content

MobileCRM.Services.GeoAddress.fromLocation

rescocrm edited this page May 15, 2023 · 8 revisions

Translates the geo position represented by latitude and longitude values into the GeoAddress object.

Arguments

Argument Type Description
latitude Number Latitude value of the GPS position.
longitude Number Longitude value of the GPS position.
success function(address) A callback function that is called with the GeoAddress object as argument.
failed function(errorMsg) A callback which is called in case of error.
scope Object The scope for callbacks.

This example demonstrates how to translate GPS position into the civic address.

MobileCRM.Services.GeoAddress.fromLocation(51.50344025, -0.127708109585621, function (address) {
	/// <param name="address" type="MobileCRM.Services.GeoAddress"/>
	// Gets the GeoAddress: {streetNumber: "10", street: "Downing Street", city: "London", zip: "SW1A 2AA", stateOrProvice: "England", country: "UK", isValid: true}
	MobileCRM.bridge.alert(address.streetNumber + " " + address.street + "\n" + address.city);
}, MobileCRM.bridge.alert, null);
Clone this wiki locally