详细问题描述
map组件和接口的组合使用。map组件绑定return返回的经纬度时,在手机上显示的时候。有时候map组件没有绑定return返回的值,直接用了默认的经纬度,定到了北京天安门。之后下面的点击uni.getLocation事件也没有用了。而且手机不管有没有开启定位信息。都会有这种结果。
这是安卓打包后的测试结果。
在小程序测试时没有问题。
代码:
<template>
<view class="">
<map id="map" :longitude="item.longitude" :latitude="item.latitude" style="width: 100%; height: 400px;"></map>
</view>
</template>
<script>
export default {
data() {
return {
item: {
latitude: 32.16541,
longitude: 112.46543,
}
}
}
}
</script>
<style>
</style>