Apache Cordova, mapas, geolocalizacion

 

 

This is what I use:

function (lat, lon) {
var latLon = lat + ‘,’ + lon;

if (device.platform.toUpperCase() === «ANDROID») {
window.open(«geo:» + latLon, «_system»);
} else if (device.platform.toUpperCase() === «IOS») {
window.open(«http://maps.apple.com/?sll=» + latLon + «&z=100&t=k», «_system»);
}
}

Note: when opening Apple maps, the sll=… and t=k, which means I’m specifying an exact longitude and latitude, and t=k means I want apple maps to display satellite imagery. Also, I’m only writing for iOS and Android, so if you’re using other platforms be sure to check explicitly for each! I’m pretty sure Android’s geo: always works as you would expect, but I could be wrong. Remember: test everything on a real device!

Continua leyendo «Apache Cordova, mapas, geolocalizacion»

Entradas relacionadas

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *