<view class="map-container">
<map
:latitude="latitude"
:longitude="longitude"
:scale="scale"
:enable-3D="enable3D"
:enable-satellite="enableSatellite"
:enable-overlooking="enableOverlooking"
:enable-traffic="enableTraffic"
:show-location="showLocation"
@tap="amapTap"
></map>
</view>
</template>
<script>
const amapFile = require('./../../components/amap-wx/amap-wx.js');
const amap = new amapFile.AMapWX({
key: 'XXXXXX'
});
export default {
data() {
return {
latitude: 0, // 纬度
longitude: 0, // 经度
scale: 16, // 放大程度
enable3D: true, // 3D楼快
enableSatellite: false, // 卫星图
enableOverlooking: true, // 俯视
enableTraffic: true, // 实时路况
showLocation: true, // 当前坐标点
}
},
onLoad () {
var that = this;
amap.getRegeo({
success: (data) => {
//成功回调
console.log(data[0]);
that.setUsertude(data[0].latitude, data[0].longitude);
},
fail: (info) => {
//失败回调
console.log(info)
}
})
},
methods: {
amapTap () {
},
setUsertude (latitude, longitude) {
this._data.latitude = latitude;
this._data.longitude = longitude;
}
}
}
</script>
<style>
.map-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
map {
width: 100%;
height: 100%;
}
</style>

- 发布:2020-08-11 17:09
- 更新:2020-08-11 17:09
- 阅读:603
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 10
HBuilderX类型: 正式
HBuilderX版本号: 2.6.1
第三方开发者工具版本号: 1.03.2006090
基础库版本号: 2.9.2
项目创建方式: HBuilderX
示例代码:
操作步骤:
直接
直接
预期结果:
可能无复现
可能无复现
实际结果:
复现
复现
bug描述:
amap show-location 设置初始scale为18的时候不显示
0 个回复