Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 790 Bytes

README.md

File metadata and controls

40 lines (23 loc) · 790 Bytes

org.beuckman.geocoder

Installation

git clone [email protected]:jbeuckm/cordova-plugin-geocoder.git
cd myproject
cordova plugin add ../cordova-plugin-geocoder

Supported Platforms

  • iOS
  • Android

Methods

  • navigator.geocoder.geocodeString

navigator.geocoder.geocodeString

Forward geocode a given address to find coordinates.

navigator.geocoder.geocodeString(successCallback, errorCallback, addressString);

Parameters

  • addressString: The address to be geocoded. (String)

Example

function onError(err) {
    alert(JSON.stringify(err));
}
function onSuccess(coords) {
    alert("The location is lat="+coords.latitude+", lon="+coords.longitude);
}

navigator.geocoder.geocodeString(onSuccess, onError, "55418");