收藏
回答

微信小程序获取当前地址的海拔高度?

通过wx.getLocation获取当前的位置,但是返回值中altitude一直显示为0,是什么原因呢?
 wx.getLocation({
                type: 'gcj02',
                altitude: true,
                isHighAccuracy:true,
                success: (res) => {
                    that.setData({
                        latitude: res.latitude,
                        longitude: res.longitude,
                        speed: res.speed,
                        accuracy: res.accuracy
                    })
                    qqmapsdk.reverseGeocoder({
                        location: {
                            latitude: res.latitude,
                            longitude: res.longitude
                        },
                        success: function (res) {
                        //    console.log(res)
                            that.setData({
                                district:res.result.address_component.district,
                                position:res.result.address_component.street_number
                            })
                        }
                    })
                },
            });
回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签