<template>
|
<view class="">
|
<!--
|
<view style="padding: 20px">
|
<view class="">地址:{{ title }}</view>
|
<view class="">详细地址:{{ address }}</view>
|
<view class="">经度:{{ longitude }}</view>
|
<view class="">纬度:{{ latitude }}</view>
|
</view>
|
<view style="width: 90vw; margin: 5vw">
|
<button @click="onClick">点击打开地图</button>
|
</view>
|
-->
|
<atl-map :disable="disable" v-if="show" :longitude="longitude" :latitude="latitude" :marker="marker"
|
:mapKey="mapKey" :mapType="mapType" @confirm="confirm">
|
</atl-map>
|
</view>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
disable: false,
|
show: true,
|
title: '',
|
address: '',
|
longitude: '112.1783132134475',
|
latitude: '31.0125237588488',
|
imageSrc: '/static/logo.png', //自定义图片
|
marker: {
|
id: 1,
|
height: 30,
|
width: 30,
|
iconPath: 'https://farm.evcc.top/Uploads/yuanboyuan/maps/location.png'
|
},
|
mapKey: 'b78c4241947ead5c20f5dd7849c2b5c7', //高德地图测试key
|
//mapKey: 'ZNJBZ-E6RHJ-EV3F2-DL73K-ARTTH-3EBRZ', //腾讯地图测试key
|
//mapKey: 'p5mGzPEt30bwv1yEkeQGsGP4Xrs9xxxx', //百度地图
|
mapType: 'amap' // tmap bmap amap
|
};
|
},
|
onLoad() {},
|
onShareAppMessage() {
|
return {
|
title: '欢迎来荆门市园博园游玩!',
|
path: '/pages/index/index'
|
}
|
},
|
onShareTimeline() {
|
return {
|
title: '欢迎来荆门市园博园游玩!'
|
}
|
},
|
methods: {
|
onClick() {
|
this.show = true;
|
},
|
confirm(e) {
|
if (e) {
|
this.longitude = e.longitude;
|
this.latitude = e.latitude;
|
this.title = e.title;
|
this.address = e.address;
|
}
|
this.show = false;
|
}
|
}
|
};
|
</script>
|