wangzhibo
2025-10-23 cad64c1de2c45856b0774933c5801b05b64984e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<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>