<template>
<view>
<view class="page-body">
<view class="page-section page-section-gap">
<map @regionchange="handleRegionchange" style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
</map>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id:0, // 使用 marker点击事件 需要填写id
title: 'map',
latitude: 39.909,
longitude: 116.39742,
covers: [{
latitude: 39.909,
longitude: 116.39742,
iconPath: '../../../static/location.png'
}, {
latitude: 39.90,
longitude: 116.39,
iconPath: '../../../static/location.png'
}]
}
},
methods: {
handleRegionchange(e){
console.log(e);
},
}
}
</script>
2 个回复
odbo (作者)
注意是真机不触发,开发者工具可以
DCloud_UNI_Anne
直接使用微信小程序(不使用 uni-app )测试一下,如果仍然有问题,反馈到微信小程序社区