代码补充
<template>
<view class="page-body">
<view class="page-section page-section-gap">
<map id="map" :latitude="latitude" :longitude="longitude" :markers="markers" scale="16"
@regionchange="regionchange()" @markertap="makertap()" @callouttap="callouttap()">
</map>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'map',
latitude: 39.909,
longitude: 116.39742,
markers: [{
id: 1,
latitude: 39.909,
longitude: 116.39742,
iconPath: '../../static/location.png',
callout: {
content: "大型高档社区门口58平米零食店转让(可空转)",
padding: 5,
borderRadius: 5
}
}, {
id: 2,
latitude: 39.90,
longitude: 116.39,
iconPath: '../../static/location.png',
callout: {
content: "大型高档社区门口58平米零食店转让(可空转)1"
}
}]
}
},
onLoad() {
},
methods: {
//点击标记
makertap: function (e) {
console.log("1");
},
//点击气泡
callouttap: function (e) {
console.log("2");
},
//地图视野发生变化
regionchange: function (e) {
console.log("3");
}
},
components: {
}
}
</script>
<style>
map {
width: 100%;
height: 100%;
}
.page-section-gap {
height: 100%;
padding: 0;
}
.page-body {
height: 100%;
}
</style>
3***@qq.com
牛逼,在垃圾文档里都能找到解决方法
2019-05-22 22:59