Commit ab0ff5eff9b5da3536ea4fa1ad488af5334abb42

Authored by fengwotao
1 parent 0ad040a4

feat(src/packages): 图表地图 高德地图新增标注物点击弹窗

1 1 {
2 2 "markers": [
3 3 {
4   - "name": "模拟1",
  4 + "name": "模拟11111111111",
5 5 "value": 20,
6 6 "position": [103.856504, 30.687278],
7 7 "extraInfo": {
8 8 "tbDeviceId": "@xxxxxxxxxxx",
9   - "name": "模拟1",
10   - "alias": "模拟1",
  9 + "name": "模拟11111111111",
  10 + "alias": "模拟11111111111",
11 11 "organizationDTO": {
12   - "name": "模拟1"
  12 + "name": "模拟11111111111"
13 13 },
14 14 "deviceState": "INACTIVE",
15 15 "deviceProfile": {
... ... @@ -23,15 +23,15 @@
23 23 }
24 24 },
25 25 {
26   - "name": "模拟2",
  26 + "name": "模拟22222222222",
27 27 "value": 30,
28 28 "position": [104.095368, 30.716787],
29 29 "extraInfo": {
30 30 "tbDeviceId": "@xxxxxxxxxxxxxxx",
31   - "name": "模拟2",
32   - "alias": "模拟2",
  31 + "name": "模拟22222222222",
  32 + "alias": "模拟22222222222",
33 33 "organizationDTO": {
34   - "name": "模拟2"
  34 + "name": "模拟22222222222"
35 35 },
36 36 "deviceState": "INACTIVE",
37 37 "deviceProfile": {
... ...
... ... @@ -131,7 +131,6 @@ const mapClick = (markerInstance: any, markerItem: dataJsonMarkersType) => {
131 131 markerInstance.setExtData({
132 132 extraInfo: markerItem.extraInfo
133 133 })
134   - mapIns.add(markerInstance)
135 134 markerInstance.setLabel({
136 135 content: markerItem.extraInfo.alias || markerItem.extraInfo.name
137 136 })
... ... @@ -161,8 +160,9 @@ const dataHandle = (newData: dataJsonType) => {
161 160 position: [markerItem.position[0], markerItem.position[1]],
162 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 164 // markerInstance.setMap(mapIns)
  165 + mapIns.add(markerInstance)
166 166 mapClick(markerInstance, markerItem)
167 167 })
168 168 } else if (mapMarkerType.value === MarkerEnum.CIRCLE_MARKER) {
... ... @@ -175,8 +175,9 @@ const dataHandle = (newData: dataJsonType) => {
175 175 radius: markerItem.value, //圆圈半径大小
176 176 ...marker.value
177 177 })
178   - // markers.push(markerInstance) //原作者这种方式添加,属于1.4.8版本的
  178 + // markers.push(markerInstance) //原作者这种方式添加,属于JS API 1.4.8版本的
179 179 // markerInstance.setMap(mapIns)
  180 + mapIns.add(markerInstance)
180 181 mapClick(markerInstance, markerItem)
181 182 })
182 183 }
... ...