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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
| <script setup>
| import {computed, onMounted} from "vue";
|
| const props = defineProps({
| visible: {
| type: Boolean,
| default: false,
| },
| name: {
| type: String,
| default: ""
| },
| cWidth: {
| type: Number,
| default: 100
| },
| cHeight: {
| type: Number,
| default: 100,
| },
| dWidth: {
| type: Number,
| default: 100
| },
| dHeight: {
| type: Number,
| default: 100
| },
| x: {
| type: Number,
| default: 0
| },
| y: {
| type: Number,
| default: 0
| }
| });
|
| const posStyle = computed(()=>{
| return {
| left: props.x*props.cWidth/props.dWidth+'px',
| top: props.y*props.cHeight/props.dHeight+'px'
| }
| });
| </script>
|
| <template>
| <div class="map-pin" :style="posStyle">
| <el-tooltip placement="top" :visible="visible">
| <template #content>
| {{name}}
| </template>
| <div class="map-pin-content">
| <div class="pin"></div>
| <div class="pulse"></div>
| </div>
| </el-tooltip>
| </div>
| </template>
|
| <style lang="less" scoped>
| @size: 24px;
| .map-pin {
| position: absolute;
| cursor: pointer;
| z-index: 1;
| .map-pin-content {
| position: relative;
| top: -@size - @size*0.1;
| left: -@size*0.5;
| .pin {
| width: @size;
| height: @size;
| border-radius: 50% 50% 50% 0;
| background-color: @font-color-high-light;
| transform: rotate(-45deg);
| &:hover {
| background-color: @font-color-primary;
| }
| &:active {
| background-color: @font-color-warning;
| }
| &:after {
| content: '';
| position: absolute;
| width: @size*0.5;
| height: @size*0.5;
| margin: @size*0.25 0 0 @size*0.25;
| background: #646767;
| border-radius: 50%;
| }
| }
| .pulse {
| position: absolute;
| background: rgba(0, 254, 255, 0.3);
| border-radius: 50%;
| height: @size*0.8;
| width: @size*0.8;
| margin-left: @size*0.1;
| margin-top: -@size*0.2;
| transform: rotateX(55deg);
| }
| }
| }
| </style>
|
|