devicePosition.vue
877 Bytes
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
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<map style="width: 100%; min-height: 100vh;" :markers="markers" :scale="scale" :latitude="getPos.latitude" :longitude="getPos.longitude"></map>
</view>
</template>
<script>
import { mapUrl, mapKay } from '@/config/tcMapConfig.js';
export default {
components: {},
data() {
return {
getPos: {
longitude: 0,
latitude: 0
},
scale: 15,
markers: [
{
latitude: 0,
longitude: 0
}
]
};
},
onLoad(e) {
if (e.data != null) {
const params = JSON.parse(e.data);
if (params) this.getPos.longitude = params.longitude;
this.getPos.latitude = params.latitude;
this.markers[0].longitude = params.longitude;
this.markers[0].latitude = params.latitude;
}
},
methods: {}
};
</script>
<style lang="scss" scoped></style>