when developing the projects related to the location of Mini Program, it is found that the location that comes with Wechat is not accurate enough and the error is large.
the position of the inverse analysis of longitude and latitude of Tencent Map is not accurate because the latitude and longitude of this province is not accurate enough.
the following is the code for me to obtain the latitude and longitude and parse the location. Using Mini Program"s official api, I actually use gcj02
on the East Fifth Ring Road, and the location of the ios device is East Fifth Ring Road, Chaoyang District, Beijing
. Some developers also reported that the official api is not accurate.
could you tell me how to get accurate latitude and longitude information in the Mini Program project, so that I can locate the building I am in now?
function getCityInfo(lat, lng, mapKey, callback) {
//
// https://lbs.qq.com/webservice_v1/guide-gcoder.html
wx.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=${mapKey}`,
success: res => {
callback(res.data.result);
}
})
}