Commit ab0ff5eff9b5da3536ea4fa1ad488af5334abb42
1 parent
0ad040a4
feat(src/packages): 图表地图 高德地图新增标注物点击弹窗
Showing
2 changed files
with
12 additions
and
11 deletions
1 | { | 1 | { |
2 | "markers": [ | 2 | "markers": [ |
3 | { | 3 | { |
4 | - "name": "模拟1", | 4 | + "name": "模拟11111111111", |
5 | "value": 20, | 5 | "value": 20, |
6 | "position": [103.856504, 30.687278], | 6 | "position": [103.856504, 30.687278], |
7 | "extraInfo": { | 7 | "extraInfo": { |
8 | "tbDeviceId": "@xxxxxxxxxxx", | 8 | "tbDeviceId": "@xxxxxxxxxxx", |
9 | - "name": "模拟1", | ||
10 | - "alias": "模拟1", | 9 | + "name": "模拟11111111111", |
10 | + "alias": "模拟11111111111", | ||
11 | "organizationDTO": { | 11 | "organizationDTO": { |
12 | - "name": "模拟1" | 12 | + "name": "模拟11111111111" |
13 | }, | 13 | }, |
14 | "deviceState": "INACTIVE", | 14 | "deviceState": "INACTIVE", |
15 | "deviceProfile": { | 15 | "deviceProfile": { |
@@ -23,15 +23,15 @@ | @@ -23,15 +23,15 @@ | ||
23 | } | 23 | } |
24 | }, | 24 | }, |
25 | { | 25 | { |
26 | - "name": "模拟2", | 26 | + "name": "模拟22222222222", |
27 | "value": 30, | 27 | "value": 30, |
28 | "position": [104.095368, 30.716787], | 28 | "position": [104.095368, 30.716787], |
29 | "extraInfo": { | 29 | "extraInfo": { |
30 | "tbDeviceId": "@xxxxxxxxxxxxxxx", | 30 | "tbDeviceId": "@xxxxxxxxxxxxxxx", |
31 | - "name": "模拟2", | ||
32 | - "alias": "模拟2", | 31 | + "name": "模拟22222222222", |
32 | + "alias": "模拟22222222222", | ||
33 | "organizationDTO": { | 33 | "organizationDTO": { |
34 | - "name": "模拟2" | 34 | + "name": "模拟22222222222" |
35 | }, | 35 | }, |
36 | "deviceState": "INACTIVE", | 36 | "deviceState": "INACTIVE", |
37 | "deviceProfile": { | 37 | "deviceProfile": { |
@@ -131,7 +131,6 @@ const mapClick = (markerInstance: any, markerItem: dataJsonMarkersType) => { | @@ -131,7 +131,6 @@ const mapClick = (markerInstance: any, markerItem: dataJsonMarkersType) => { | ||
131 | markerInstance.setExtData({ | 131 | markerInstance.setExtData({ |
132 | extraInfo: markerItem.extraInfo | 132 | extraInfo: markerItem.extraInfo |
133 | }) | 133 | }) |
134 | - mapIns.add(markerInstance) | ||
135 | markerInstance.setLabel({ | 134 | markerInstance.setLabel({ |
136 | content: markerItem.extraInfo.alias || markerItem.extraInfo.name | 135 | content: markerItem.extraInfo.alias || markerItem.extraInfo.name |
137 | }) | 136 | }) |
@@ -161,8 +160,9 @@ const dataHandle = (newData: dataJsonType) => { | @@ -161,8 +160,9 @@ const dataHandle = (newData: dataJsonType) => { | ||
161 | position: [markerItem.position[0], markerItem.position[1]], | 160 | position: [markerItem.position[0], markerItem.position[1]], |
162 | offset: new AMapIns.Pixel(-13, -30) | 161 | offset: new AMapIns.Pixel(-13, -30) |
163 | }) | 162 | }) |
164 | - // markers.push(markerInstance) 原作者这种方式添加,属于1.4.8版本的 | 163 | + // markers.push(markerInstance) 原作者这种方式添加,属于JS API 1.4.8版本的 |
165 | // markerInstance.setMap(mapIns) | 164 | // markerInstance.setMap(mapIns) |
165 | + mapIns.add(markerInstance) | ||
166 | mapClick(markerInstance, markerItem) | 166 | mapClick(markerInstance, markerItem) |
167 | }) | 167 | }) |
168 | } else if (mapMarkerType.value === MarkerEnum.CIRCLE_MARKER) { | 168 | } else if (mapMarkerType.value === MarkerEnum.CIRCLE_MARKER) { |
@@ -175,8 +175,9 @@ const dataHandle = (newData: dataJsonType) => { | @@ -175,8 +175,9 @@ const dataHandle = (newData: dataJsonType) => { | ||
175 | radius: markerItem.value, //圆圈半径大小 | 175 | radius: markerItem.value, //圆圈半径大小 |
176 | ...marker.value | 176 | ...marker.value |
177 | }) | 177 | }) |
178 | - // markers.push(markerInstance) //原作者这种方式添加,属于1.4.8版本的 | 178 | + // markers.push(markerInstance) //原作者这种方式添加,属于JS API 1.4.8版本的 |
179 | // markerInstance.setMap(mapIns) | 179 | // markerInstance.setMap(mapIns) |
180 | + mapIns.add(markerInstance) | ||
180 | mapClick(markerInstance, markerItem) | 181 | mapClick(markerInstance, markerItem) |
181 | }) | 182 | }) |
182 | } | 183 | } |