Skip to content

Map.getMyLocation()

Masashi Katsumata edited this page Mar 5, 2015 · 11 revisions

The callback function will be involved with current your location as Location data.

###enableHighAccuracy option As of v1.2.0, you can specify enableHighAccuracy option that attempt to get your location with highest accuracy.

var opts = {
  enableHighAccuracy: true
};
map.getMyLocation(opts, onSuccess, onError);

###Code

var option = {
    enableHighAccuracy: true      // Force GPS
};
map.getMyLocation(option, onLocationSuccess, onLocationError);

function onLocationSuccess( result ) {
    alert(JSON.stringify( result, null, 4 ));
}
function onLocationError( error_msg ) {
    alert( error_msg );
}

Join the official community

New versions will be announced through the official community. Stay tune!

Do you have a question or feature request?

Feel free to ask me on the issues tracker.

Or on the official community is also welcome!


New version 2.0-beta2 is available.

The cordova-googlemaps-plugin v2.0 has more faster, more features.

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md

Clone this wiki locally