En primer lugar, debe ir al sitio web oficial de Baidu o Gaode para solicitar ak.
wx.getUbicación(OBJETO)
Obtener latitud y longitud actuales
wx.chooseLocation (objeto objeto)
Abrir mapa y seleccionar ubicación
wx.getLocation({
type: "wgs84",
success(res) {
wx.chooseLocation({
latitude: res.latitude,
longitude: res.longitude,
success: function(data){
console.log(data)
}
})
}
})
Vea el texto original aquí: Enlace de dirección