hy-dispatch-ui-v3 0.2.66 → 0.2.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist/tailwind.css +257 -21
  2. package/es/api/device.mjs +2 -3
  3. package/es/api/exportExcel.mjs +57 -0
  4. package/es/api/index.mjs +27 -16
  5. package/es/api/mapRail.mjs +31 -0
  6. package/es/api/organization.mjs +17 -9
  7. package/es/api/rule.mjs +30 -0
  8. package/es/api/sypct.mjs +2 -3
  9. package/es/api/task.mjs +2 -3
  10. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +18 -19
  11. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  12. package/es/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.mjs +511 -0
  13. package/es/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs +169 -0
  14. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs +318 -0
  15. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.mjs +123 -0
  16. package/es/bussiness/hyElectronicFence/electronicFence.vue.mjs +358 -0
  17. package/es/bussiness/hyElectronicFence/index.mjs +13 -0
  18. package/es/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  19. package/es/bussiness/hyMapAearchPlace/js/index.mjs +1 -1
  20. package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +4 -6
  21. package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  22. package/es/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.mjs +270 -0
  23. package/es/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.mjs +251 -0
  24. package/es/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.mjs +251 -0
  25. package/es/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.mjs +395 -0
  26. package/es/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.mjs +651 -0
  27. package/es/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.mjs +357 -0
  28. package/es/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.mjs +261 -0
  29. package/es/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.mjs +360 -0
  30. package/es/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.mjs +240 -0
  31. package/es/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.mjs +258 -0
  32. package/es/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.mjs +240 -0
  33. package/es/bussiness/hyRuleSetting/index.mjs +15 -0
  34. package/es/bussiness/hyRuleSetting/js/ruleSetting.mjs +65 -0
  35. package/es/bussiness/hyRuleSetting/ruleSetting.vue.mjs +129 -0
  36. package/es/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  37. package/es/bussiness/index.mjs +2 -0
  38. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -13
  39. package/es/components/hyAudioPlayer/js/index.mjs +9 -14
  40. package/es/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  41. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +174 -142
  42. package/es/components/hyButton/button.vue.mjs +18 -5
  43. package/es/components/hyButton/style/button.scss +50 -74
  44. package/es/components/hyCheckboxGroup/checkboxGroup.vue.mjs +119 -0
  45. package/es/components/hyCheckboxGroup/index.mjs +7 -0
  46. package/es/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  47. package/es/components/hyConfigProvider/configProvider.vue.mjs +51 -38
  48. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +57 -62
  49. package/es/components/hyConfirmDialog/confirmMethod.mjs +24 -22
  50. package/es/components/hyCutter/cutter.vue.mjs +9 -23
  51. package/es/components/hyDatePicker/datePicker.vue.mjs +12 -17
  52. package/es/components/hyDialog/dialog.vue.mjs +5 -9
  53. package/es/components/hyDialog/style/dialog.scss +12 -13
  54. package/es/components/hyDrawer/drawer.vue.mjs +100 -0
  55. package/es/components/hyDrawer/index.mjs +7 -0
  56. package/es/components/hyDrawer/style/drawer.scss +0 -0
  57. package/es/components/hyForm/cpns/arrayItem.vue.mjs +10 -28
  58. package/es/components/hyForm/cpns/arrayItem2.vue.mjs +198 -0
  59. package/es/components/hyForm/cpns/extraItem.vue.mjs +2 -3
  60. package/es/components/hyForm/cpns/formItem.vue.mjs +149 -69
  61. package/es/components/hyForm/cpns/locationSelect.vue.mjs +26 -26
  62. package/es/components/hyForm/form.vue.mjs +74 -28
  63. package/es/components/hyForm/js/index.mjs +4 -8
  64. package/es/components/hyForm/js/useAppForm.mjs +4 -9
  65. package/es/components/hyForm/style/form.scss +4 -13
  66. package/es/components/hyIcon/icon.vue.mjs +3 -3
  67. package/es/components/hyIconBox/style/iconBox.scss +2 -6
  68. package/es/components/hyInput/inputSearch.vue.mjs +8 -11
  69. package/es/components/hyInput/style/inputSearch.scss +3 -0
  70. package/es/components/hyLoading/index.mjs +3 -5
  71. package/es/components/hyMap/js/index.mjs +35 -10
  72. package/es/components/hyMap/map.vue.mjs +30 -6
  73. package/es/components/hyMenu/style/menu.scss +5 -15
  74. package/es/components/hyNoPermissions/noPermissions.vue.mjs +3 -4
  75. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +3 -6
  76. package/es/components/hyOrgCascader/js/index.mjs +1 -5
  77. package/es/components/hyOrgCascader/orgCascader.vue.mjs +31 -12
  78. package/es/components/hyOrgCascader/style/orgCascader.scss +7 -0
  79. package/es/components/hyRadioGroup/radioGroup.vue.mjs +48 -41
  80. package/es/components/hyRadioGroup/style/radioGroup.scss +9 -0
  81. package/es/components/hySearch/cpns/searchItem.vue.mjs +409 -324
  82. package/es/components/hySearch/js/index.mjs +1 -4
  83. package/es/components/hySearch/js/useAppSearch.mjs +5 -10
  84. package/es/components/hySearch/search.vue.mjs +23 -20
  85. package/es/components/hySearch/style/search.scss +9 -0
  86. package/es/components/hyStatus/index.mjs +7 -0
  87. package/es/components/hyStatus/status.vue.mjs +110 -0
  88. package/es/components/hyStatus/style/status.scss +0 -0
  89. package/es/components/hyTable/cpns/columnSelect.vue.mjs +24 -28
  90. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +8 -9
  91. package/es/components/hyTable/cpns/headerItem.vue.mjs +2 -2
  92. package/es/components/hyTable/cpns/virtualTable.vue.mjs +43 -34
  93. package/es/components/hyTable/js/index.mjs +67 -64
  94. package/es/components/hyTable/js/search.mjs +25 -1
  95. package/es/components/hyTable/js/useAppTable.mjs +3 -4
  96. package/es/components/hyTable/style/table.scss +8 -0
  97. package/es/components/hyTable/table.vue.mjs +68 -53
  98. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +13 -6
  99. package/es/components/hyTableForm/batchTableForm.vue.mjs +26 -9
  100. package/es/components/hyTableForm/js/index.mjs +2 -8
  101. package/es/components/hyTableForm/js/useAppTableForm.mjs +3 -8
  102. package/es/components/hyTableForm/style/batchTableForm.scss +26 -54
  103. package/es/components/hyTableForm/style/tableForm.scss +3 -2
  104. package/es/components/hyTableForm/tableForm.vue.mjs +160 -70
  105. package/es/components/hyTimePicker/timePicker.vue.mjs +4 -5
  106. package/es/components/hyTree/js/index.mjs +113 -72
  107. package/es/components/hyTree/style/index.css +1 -1
  108. package/es/components/hyTree/tree.vue.mjs +21 -18
  109. package/es/components/hyUserAvatar/userAvatar.vue.mjs +3 -6
  110. package/es/components/hyVideoPlayer/js/index.mjs +14 -23
  111. package/es/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  112. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +16 -26
  113. package/es/components/index.mjs +3 -0
  114. package/es/hooks/index.mjs +6 -2
  115. package/es/hooks/useAudioPlayerConfig.mjs +1 -3
  116. package/es/hooks/useBaseMainStore.mjs +29 -0
  117. package/es/hooks/useCurrentBus.mjs +20 -0
  118. package/es/hooks/useDialog.mjs +327 -0
  119. package/es/hooks/useExportFile.mjs +133 -0
  120. package/es/hooks/useGlobalConfig.mjs +10 -6
  121. package/es/hooks/useLocale.mjs +22 -12
  122. package/es/hooks/usePermissionMap.mjs +1 -3
  123. package/es/hooks/useResizeHandler.mjs +1 -4
  124. package/es/hooks/useResizeObserver.mjs +3 -1
  125. package/es/hooks/useSubscribe.mjs +2 -2
  126. package/es/hooks/useUserAvatarMap.mjs +1 -3
  127. package/es/hooks/useVideoPlayerConfig.mjs +1 -3
  128. package/es/index.mjs +11 -2
  129. package/es/locale/{en.mjs → en_US.mjs} +79 -4
  130. package/es/locale/index.mjs +2 -2
  131. package/es/locale/zh_CN.mjs +79 -2
  132. package/es/style/index.scss +0 -1
  133. package/es/style/tailwind.scss +7 -4
  134. package/es/utils/adaptive.mjs +1 -3
  135. package/es/utils/form.mjs +7 -10
  136. package/es/utils/handler.mjs +4 -8
  137. package/es/utils/input.mjs +8 -9
  138. package/es/utils/is.mjs +3 -1
  139. package/es/utils/map/hook/bigMap.mjs +16 -53
  140. package/es/utils/map/hook/gaode.mjs +53 -33
  141. package/es/utils/map/hook/leafletjs.mjs +38 -82
  142. package/es/utils/map/index.mjs +3 -9
  143. package/es/utils/map/js/webgis.mjs +12 -12
  144. package/es/version.mjs +1 -1
  145. package/lib/api/device.js +2 -3
  146. package/lib/api/exportExcel.js +62 -0
  147. package/lib/api/index.js +27 -16
  148. package/lib/api/mapRail.js +34 -0
  149. package/lib/api/organization.js +17 -8
  150. package/lib/api/rule.js +33 -0
  151. package/lib/api/sypct.js +2 -3
  152. package/lib/api/task.js +2 -3
  153. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +17 -18
  154. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  155. package/lib/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.js +515 -0
  156. package/lib/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.js +173 -0
  157. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.js +322 -0
  158. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.js +127 -0
  159. package/lib/bussiness/hyElectronicFence/electronicFence.vue.js +362 -0
  160. package/lib/bussiness/hyElectronicFence/index.js +21 -0
  161. package/lib/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  162. package/lib/bussiness/hyMapAearchPlace/js/index.js +1 -1
  163. package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +4 -6
  164. package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  165. package/lib/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.js +274 -0
  166. package/lib/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.js +255 -0
  167. package/lib/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.js +255 -0
  168. package/lib/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.js +399 -0
  169. package/lib/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.js +655 -0
  170. package/lib/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.js +361 -0
  171. package/lib/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.js +265 -0
  172. package/lib/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.js +364 -0
  173. package/lib/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.js +244 -0
  174. package/lib/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.js +262 -0
  175. package/lib/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.js +244 -0
  176. package/lib/bussiness/hyRuleSetting/index.js +24 -0
  177. package/lib/bussiness/hyRuleSetting/js/ruleSetting.js +68 -0
  178. package/lib/bussiness/hyRuleSetting/ruleSetting.vue.js +133 -0
  179. package/lib/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  180. package/lib/bussiness/index.js +21 -10
  181. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +5 -13
  182. package/lib/components/hyAudioPlayer/js/index.js +9 -14
  183. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  184. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +173 -141
  185. package/lib/components/hyButton/button.vue.js +17 -4
  186. package/lib/components/hyButton/style/button.scss +50 -74
  187. package/lib/components/hyCheckboxGroup/checkboxGroup.vue.js +123 -0
  188. package/lib/components/hyCheckboxGroup/index.js +12 -0
  189. package/lib/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  190. package/lib/components/hyConfigProvider/configProvider.vue.js +50 -56
  191. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +56 -61
  192. package/lib/components/hyConfirmDialog/confirmMethod.js +23 -21
  193. package/lib/components/hyCutter/cutter.vue.js +8 -22
  194. package/lib/components/hyDatePicker/datePicker.vue.js +11 -16
  195. package/lib/components/hyDialog/dialog.vue.js +5 -9
  196. package/lib/components/hyDialog/style/dialog.scss +12 -13
  197. package/lib/components/hyDrawer/drawer.vue.js +104 -0
  198. package/lib/components/hyDrawer/index.js +12 -0
  199. package/lib/components/hyDrawer/style/drawer.scss +0 -0
  200. package/lib/components/hyForm/cpns/arrayItem.vue.js +9 -27
  201. package/lib/components/hyForm/cpns/arrayItem2.vue.js +202 -0
  202. package/lib/components/hyForm/cpns/extraItem.vue.js +2 -3
  203. package/lib/components/hyForm/cpns/formItem.vue.js +148 -68
  204. package/lib/components/hyForm/cpns/locationSelect.vue.js +26 -26
  205. package/lib/components/hyForm/form.vue.js +69 -23
  206. package/lib/components/hyForm/js/index.js +3 -7
  207. package/lib/components/hyForm/js/useAppForm.js +4 -9
  208. package/lib/components/hyForm/style/form.scss +4 -13
  209. package/lib/components/hyIcon/icon.vue.js +3 -3
  210. package/lib/components/hyIconBox/style/iconBox.scss +2 -6
  211. package/lib/components/hyInput/inputSearch.vue.js +7 -10
  212. package/lib/components/hyInput/style/inputSearch.scss +3 -0
  213. package/lib/components/hyLoading/index.js +2 -4
  214. package/lib/components/hyMap/js/index.js +34 -9
  215. package/lib/components/hyMap/map.vue.js +29 -5
  216. package/lib/components/hyMenu/style/menu.scss +5 -15
  217. package/lib/components/hyNoPermissions/noPermissions.vue.js +3 -4
  218. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +3 -6
  219. package/lib/components/hyOrgCascader/js/index.js +1 -5
  220. package/lib/components/hyOrgCascader/orgCascader.vue.js +29 -10
  221. package/lib/components/hyOrgCascader/style/orgCascader.scss +7 -0
  222. package/lib/components/hyRadioGroup/radioGroup.vue.js +47 -40
  223. package/lib/components/hyRadioGroup/style/radioGroup.scss +9 -0
  224. package/lib/components/hySearch/cpns/searchItem.vue.js +407 -322
  225. package/lib/components/hySearch/js/index.js +1 -4
  226. package/lib/components/hySearch/js/useAppSearch.js +5 -10
  227. package/lib/components/hySearch/search.vue.js +23 -20
  228. package/lib/components/hySearch/style/search.scss +9 -0
  229. package/lib/components/hyStatus/index.js +12 -0
  230. package/lib/components/hyStatus/status.vue.js +114 -0
  231. package/lib/components/hyStatus/style/status.scss +0 -0
  232. package/lib/components/hyTable/cpns/columnSelect.vue.js +22 -26
  233. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +7 -8
  234. package/lib/components/hyTable/cpns/headerItem.vue.js +2 -2
  235. package/lib/components/hyTable/cpns/virtualTable.vue.js +41 -32
  236. package/lib/components/hyTable/js/index.js +65 -61
  237. package/lib/components/hyTable/js/search.js +25 -1
  238. package/lib/components/hyTable/js/useAppTable.js +2 -3
  239. package/lib/components/hyTable/style/table.scss +8 -0
  240. package/lib/components/hyTable/table.vue.js +67 -52
  241. package/lib/components/hyTableActionButton/tableActionButton.vue.js +13 -6
  242. package/lib/components/hyTableForm/batchTableForm.vue.js +26 -9
  243. package/lib/components/hyTableForm/js/index.js +2 -8
  244. package/lib/components/hyTableForm/js/useAppTableForm.js +3 -8
  245. package/lib/components/hyTableForm/style/batchTableForm.scss +26 -54
  246. package/lib/components/hyTableForm/style/tableForm.scss +3 -2
  247. package/lib/components/hyTableForm/tableForm.vue.js +159 -69
  248. package/lib/components/hyTimePicker/timePicker.vue.js +3 -4
  249. package/lib/components/hyTree/js/index.js +113 -72
  250. package/lib/components/hyTree/style/index.css +1 -1
  251. package/lib/components/hyTree/tree.vue.js +21 -18
  252. package/lib/components/hyUserAvatar/userAvatar.vue.js +3 -6
  253. package/lib/components/hyVideoPlayer/js/index.js +14 -23
  254. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  255. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +16 -26
  256. package/lib/components/index.js +46 -40
  257. package/lib/hooks/index.js +17 -0
  258. package/lib/hooks/useAudioPlayerConfig.js +1 -3
  259. package/lib/hooks/useBaseMainStore.js +32 -0
  260. package/lib/hooks/useCurrentBus.js +23 -0
  261. package/lib/hooks/useDialog.js +331 -0
  262. package/lib/hooks/useExportFile.js +135 -0
  263. package/lib/hooks/useGlobalConfig.js +10 -6
  264. package/lib/hooks/useLocale.js +25 -11
  265. package/lib/hooks/usePermissionMap.js +1 -3
  266. package/lib/hooks/useResizeHandler.js +1 -4
  267. package/lib/hooks/useResizeObserver.js +3 -1
  268. package/lib/hooks/useSubscribe.js +2 -1
  269. package/lib/hooks/useUserAvatarMap.js +1 -3
  270. package/lib/hooks/useVideoPlayerConfig.js +1 -3
  271. package/lib/index.js +107 -73
  272. package/lib/locale/{en.js → en_US.js} +79 -4
  273. package/lib/locale/index.js +3 -3
  274. package/lib/locale/zh_CN.js +79 -2
  275. package/lib/style/index.scss +0 -1
  276. package/lib/style/tailwind.scss +7 -4
  277. package/lib/utils/adaptive.js +1 -3
  278. package/lib/utils/form.js +6 -9
  279. package/lib/utils/handler.js +3 -7
  280. package/lib/utils/input.js +7 -8
  281. package/lib/utils/is.js +5 -3
  282. package/lib/utils/map/hook/bigMap.js +16 -53
  283. package/lib/utils/map/hook/gaode.js +53 -33
  284. package/lib/utils/map/hook/leafletjs.js +38 -82
  285. package/lib/utils/map/index.js +3 -9
  286. package/lib/utils/map/js/webgis.js +12 -12
  287. package/lib/version.js +1 -1
  288. package/package.json +3 -2
package/lib/utils/is.js CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  require('../hooks/index.js');
5
+ require('./index.js');
5
6
  var usePermissionMap = require('../hooks/usePermissionMap.js');
7
+ var permission = require('./permission.js');
6
8
 
7
9
  const isString = (e) => typeof e === "string";
8
10
  const isNumber = (e) => typeof e === "number";
@@ -42,12 +44,12 @@ function isSupportH265() {
42
44
  }
43
45
  return { isSupport, isVersionLow };
44
46
  }
45
- function isPermission(permission) {
47
+ function isPermission(permission$1) {
46
48
  const { permissionMap } = usePermissionMap.usePermissionMap();
47
- if (!permission) {
49
+ if (!permission$1) {
48
50
  return true;
49
51
  }
50
- return permissionMap.value.has(permission);
52
+ return permissionMap.value.has(permission.PERMISSION[`${permission$1}`]);
51
53
  }
52
54
 
53
55
  exports.isArray = isArray;
@@ -12,9 +12,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
12
12
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
13
  const CIRCLE_SEGMENTS = 36;
14
14
  function remToPx(rem) {
15
- const rootFontSize = parseFloat(
16
- getComputedStyle(document.documentElement).fontSize
17
- );
15
+ const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
18
16
  return rem * rootFontSize;
19
17
  }
20
18
  function rangingStartIconOption(options, dicId) {
@@ -312,11 +310,7 @@ class bigMap extends events.EventEmitter {
312
310
  if (!newEvent.layer.getLatLngs) {
313
311
  newEvent.layer.getLatLngs = () => {
314
312
  const circle = newEvent.layer;
315
- const points = circleToPolygonPoints(
316
- circle.getLatLng(),
317
- circle.getRadius() / 1e3,
318
- true
319
- );
313
+ const points = circleToPolygonPoints(circle.getLatLng(), circle.getRadius() / 1e3, true);
320
314
  return [latLngListCheckExport(points)];
321
315
  };
322
316
  } else {
@@ -347,6 +341,8 @@ class bigMap extends events.EventEmitter {
347
341
  off: function(target, types, fn, context) {
348
342
  const wrappedFn = wrappedHandlers.take(types, fn);
349
343
  return target.off(types, wrappedFn || fn, context);
344
+ },
345
+ satelliteMapFn: function() {
350
346
  }
351
347
  };
352
348
  return mapProxy.createMapProxy(newMap, handlers);
@@ -447,9 +443,7 @@ class bigMap extends events.EventEmitter {
447
443
  map.addLayer(displayCluster);
448
444
  const toNativeMarkers = (list = []) => {
449
445
  const markers = Array.isArray(list) ? list : [list];
450
- return markers.map(
451
- (marker) => marker?.getInitMarker ? marker.getInitMarker() : marker
452
- ).filter(Boolean);
446
+ return markers.map((marker) => marker?.getInitMarker ? marker.getInitMarker() : marker).filter(Boolean);
453
447
  };
454
448
  const handlers = {
455
449
  remove: function(target) {
@@ -491,10 +485,7 @@ class bigMap extends events.EventEmitter {
491
485
  },
492
486
  // 圆形转多边形坐标
493
487
  getLatLngs: function(target) {
494
- const points = circleToPolygonPoints(
495
- target.getLatLng(),
496
- target.getRadius() / 1e3
497
- );
488
+ const points = circleToPolygonPoints(target.getLatLng(), target.getRadius() / 1e3);
498
489
  return [latLngListCheckExport(points)];
499
490
  }
500
491
  };
@@ -665,9 +656,7 @@ class bigMap extends events.EventEmitter {
665
656
  layer = e.layer;
666
657
  if (!layer._latlngs) {
667
658
  const center = latAndLngCheckExport(layer.getLatLng());
668
- layer._latlngs = [
669
- circleToPolygonPoints(center, layer.getRadius() / 1e3, true)
670
- ];
659
+ layer._latlngs = [circleToPolygonPoints(center, layer.getRadius() / 1e3, true)];
671
660
  } else {
672
661
  layer._latlngs[0] = latLngListCheckExport(layer._latlngs[0]);
673
662
  }
@@ -806,12 +795,8 @@ class bigMap extends events.EventEmitter {
806
795
  function calcTotalDistance(index, preIndex) {
807
796
  const current = rangingMarker[index].options.extData.latlng;
808
797
  const previous = rangingMarker[preIndex].options.extData.latlng;
809
- const distance = parseFloat(
810
- (map.distance(current, previous) / 1e3).toFixed(2)
811
- );
812
- const total = parseFloat(
813
- rangingMarker[preIndex].options.extData.distance || 0
814
- );
798
+ const distance = parseFloat((map.distance(current, previous) / 1e3).toFixed(2));
799
+ const total = parseFloat(rangingMarker[preIndex].options.extData.distance || 0);
815
800
  return (distance + total).toFixed(2);
816
801
  }
817
802
  function removeLineBetween(groupIndex, aIndex, bIndex) {
@@ -827,9 +812,7 @@ class bigMap extends events.EventEmitter {
827
812
  function setStartIcon(index) {
828
813
  const markerItem = rangingMarker[index];
829
814
  markerItem.setIcon({
830
- divIcon: _this.DivIcon(
831
- rangingStartIconOption(options, markerItem.options.extData.dicId)
832
- )
815
+ divIcon: _this.DivIcon(rangingStartIconOption(options, markerItem.options.extData.dicId))
833
816
  });
834
817
  markerItem.options.extData.distance = 0;
835
818
  }
@@ -837,14 +820,7 @@ class bigMap extends events.EventEmitter {
837
820
  const markerItem = rangingMarker[index];
838
821
  const isLast = showDeleteAll ?? !rangingMarker[index + 1]?.options?.extData?.distance;
839
822
  markerItem.setIcon({
840
- divIcon: _this.DivIcon(
841
- rangingPointIconOption(
842
- options,
843
- distance,
844
- markerItem.options.extData.dicId,
845
- isLast
846
- )
847
- )
823
+ divIcon: _this.DivIcon(rangingPointIconOption(options, distance, markerItem.options.extData.dicId, isLast))
848
824
  });
849
825
  markerItem.options.extData.distance = distance;
850
826
  }
@@ -872,10 +848,7 @@ class bigMap extends events.EventEmitter {
872
848
  rangingPointsIng.push({ lat, lng });
873
849
  } else {
874
850
  const latlngs = [
875
- [
876
- rangingPointsIng[rangingPointsIng.length - 1].lat,
877
- rangingPointsIng[rangingPointsIng.length - 1].lng
878
- ],
851
+ [rangingPointsIng[rangingPointsIng.length - 1].lat, rangingPointsIng[rangingPointsIng.length - 1].lng],
879
852
  [lat, lng]
880
853
  ];
881
854
  const polyline = _this.Polyline(latlngs, {
@@ -893,13 +866,9 @@ class bigMap extends events.EventEmitter {
893
866
  { lat: latlngs[1][0], lng: latlngs[1][1] }
894
867
  );
895
868
  distance = parseFloat((distance / 1e3).toFixed(2));
896
- const total = parseFloat(
897
- rangingMarker[rangingMarker.length - 1].options.extData.distance || 0
898
- );
869
+ const total = parseFloat(rangingMarker[rangingMarker.length - 1].options.extData.distance || 0);
899
870
  distance = (distance + total).toFixed(2);
900
- const customIcon = _this.DivIcon(
901
- rangingPointIconOption(options, distance, dicId)
902
- );
871
+ const customIcon = _this.DivIcon(rangingPointIconOption(options, distance, dicId));
903
872
  const markerItem = _this.Marker({
904
873
  position: { lat, lng },
905
874
  icon: customIcon,
@@ -965,10 +934,7 @@ class bigMap extends events.EventEmitter {
965
934
  if (changeIndex - 1 === index) {
966
935
  setStartIcon(changeIndex);
967
936
  } else {
968
- setPointIcon(
969
- changeIndex,
970
- calcTotalDistance(changeIndex, changeIndex - 1)
971
- );
937
+ setPointIcon(changeIndex, calcTotalDistance(changeIndex, changeIndex - 1));
972
938
  }
973
939
  changeIndex++;
974
940
  }
@@ -1001,10 +967,7 @@ class bigMap extends events.EventEmitter {
1001
967
  let changeIndex = index + 1;
1002
968
  while (rangingMarker[changeIndex]?.options?.extData?.distance) {
1003
969
  const disIndex = changeIndex - 1 === index ? changeIndex - 2 : changeIndex - 1;
1004
- setPointIcon(
1005
- changeIndex,
1006
- calcTotalDistance(changeIndex, disIndex)
1007
- );
970
+ setPointIcon(changeIndex, calcTotalDistance(changeIndex, disIndex));
1008
971
  changeIndex++;
1009
972
  }
1010
973
  setTimeout(() => {
@@ -98,6 +98,7 @@ class Google extends events.EventEmitter {
98
98
  return mapProxy.createMapProxy(polygon, handlers);
99
99
  });
100
100
  this.initParams = request;
101
+ this.layerSateGroup = null;
101
102
  }
102
103
  InitMap(domId, option) {
103
104
  const { center } = option;
@@ -114,31 +115,35 @@ class Google extends events.EventEmitter {
114
115
  resizeEnable: true
115
116
  });
116
117
  newMap.on("complete", (e) => {
117
- if (option.completeCallbacks) {
118
- option.completeCallbacks(e);
119
- }
118
+ newMap.plugin(
119
+ [
120
+ "AMap.MarkerClusterer",
121
+ "AMap.Scale",
122
+ "AMap.LayerGroup",
123
+ "AMap.Circle",
124
+ "AMap.TileLayer",
125
+ "AMap.GeometryUtil",
126
+ "AMap.MouseTool"
127
+ ],
128
+ () => {
129
+ this.layerSateGroup = new window.AMap.LayerGroup([new window.AMap.TileLayer.Satellite()]);
130
+ this.layerSateGroup.setMap(newMap);
131
+ this.layerSateGroup.hide();
132
+ setTimeout(() => {
133
+ this.satelliteMapFn(newMap, option.satelliteMap);
134
+ if (option.completeCallbacks) {
135
+ option.completeCallbacks(e);
136
+ }
137
+ });
138
+ }
139
+ );
120
140
  });
121
- newMap.plugin(
122
- [
123
- "AMap.MarkerClusterer",
124
- "AMap.Scale",
125
- "AMap.LayerGroup",
126
- "AMap.Circle",
127
- "AMap.TileLayer",
128
- "AMap.GeometryUtil",
129
- "AMap.MouseTool"
130
- ],
131
- () => {
132
- }
133
- );
134
141
  const wrappedHandlers = mapProxy.createWrappedHandlerStore();
142
+ const _this = this;
135
143
  const handlers = {
136
144
  // return 单位:m
137
145
  distance: function(target, latAndlng1, latAndlng2) {
138
- return AMap.GeometryUtil.distance(
139
- [latAndlng1.lng, latAndlng1.lat],
140
- [latAndlng2.lng, latAndlng2.lat]
141
- );
146
+ return AMap.GeometryUtil.distance([latAndlng1.lng, latAndlng1.lat], [latAndlng2.lng, latAndlng2.lat]);
142
147
  },
143
148
  // 删除地图
144
149
  removeMap: function(target) {
@@ -182,10 +187,35 @@ class Google extends events.EventEmitter {
182
187
  // // 四个角
183
188
  getBounds: function(target) {
184
189
  return wrapBounds(target);
190
+ },
191
+ /* 判断地图颜色 */
192
+ satelliteMapFn: function(target, satelliteMap) {
193
+ if (satelliteMap === 3) {
194
+ _this.layerSateGroup.show();
195
+ } else {
196
+ if (satelliteMap === 1) {
197
+ target.setMapStyle(_this.initParams.defaultMapStyle);
198
+ } else {
199
+ target.setMapStyle(_this.initParams.currencyMapStyle);
200
+ }
201
+ _this.layerSateGroup.hide();
202
+ }
185
203
  }
186
204
  };
187
205
  return mapProxy.createMapProxy(newMap, handlers);
188
206
  }
207
+ satelliteMapFn(map, satelliteMap) {
208
+ if (satelliteMap === 3) {
209
+ this.layerSateGroup.show();
210
+ } else {
211
+ if (satelliteMap === 1) {
212
+ map.setMapStyle(this.initParams.defaultMapStyle);
213
+ } else {
214
+ map.setMapStyle(this.initParams.currencyMapStyle);
215
+ }
216
+ this.layerSateGroup.hide();
217
+ }
218
+ }
189
219
  // 地图图层
190
220
  layerGroup(map, markers = []) {
191
221
  const layerGroup = new window.AMap.LayerGroup(markers);
@@ -209,10 +239,7 @@ class Google extends events.EventEmitter {
209
239
  let offset = null;
210
240
  const { html, iconSize, iconAnchor } = markerOptions.icon.option;
211
241
  if (markerOptions.offset) {
212
- offset = new window.AMap.Pixel(
213
- markerOptions.offset[0],
214
- markerOptions.offset[1]
215
- );
242
+ offset = new window.AMap.Pixel(markerOptions.offset[0], markerOptions.offset[1]);
216
243
  } else {
217
244
  const offsetX = iconAnchor[0] - iconSize[0] / 2;
218
245
  const offsetY = -iconAnchor[1];
@@ -247,10 +274,7 @@ class Google extends events.EventEmitter {
247
274
  target.setContent(html2);
248
275
  let setOffset = null;
249
276
  if (iconParams.offset) {
250
- setOffset = new window.AMap.Pixel(
251
- iconParams.offset[0],
252
- iconParams.offset[1]
253
- );
277
+ setOffset = new window.AMap.Pixel(iconParams.offset[0], iconParams.offset[1]);
254
278
  } else {
255
279
  const offsetX = iconAnchor2[0] - iconSize2[0] / 2;
256
280
  const offsetY = -iconAnchor2[1];
@@ -284,11 +308,7 @@ class Google extends events.EventEmitter {
284
308
  gridSize: option.maxClusterRadius
285
309
  // 聚合计算时网格的像素大小,默认60
286
310
  };
287
- const displayCluster = new window.AMap.MarkerClusterer(
288
- map,
289
- markerList,
290
- option
291
- );
311
+ const displayCluster = new window.AMap.MarkerClusterer(map, markerList, option);
292
312
  const handlers = {
293
313
  // 清除聚合点
294
314
  remove: function(target) {
@@ -72,9 +72,7 @@ const DEFAULT_MAP_OPTIONS = {
72
72
  // 禁止鼠标滚动缩放
73
73
  };
74
74
  const remToPx = (rem) => {
75
- const rootFontSize = parseFloat(
76
- getComputedStyle(document.documentElement).fontSize
77
- );
75
+ const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
78
76
  return rem * rootFontSize;
79
77
  };
80
78
  const createUniqueId = () => {
@@ -188,11 +186,7 @@ function wrapDrawLayer(layer) {
188
186
  const bounds = layer.getBounds();
189
187
  if (!layer.getLatLngs) {
190
188
  layer.getLatLngs = () => {
191
- const points = circleToPolygonPoints(
192
- layer.getLatLng(),
193
- layer.getRadius() / 1e3,
194
- true
195
- );
189
+ const points = circleToPolygonPoints(layer.getLatLng(), layer.getRadius() / 1e3, true);
196
190
  return [latLngListCheckExport(points)];
197
191
  };
198
192
  } else {
@@ -253,11 +247,11 @@ function getCrs(crs) {
253
247
  70.53121499999999,
254
248
  35.26560700000001
255
249
  ].map((item) => 0.0254 * item / (96 * (Math.PI * 2 * 6378137 / 360)));
256
- L.CRS.CRS4490 = new L.Proj.CRS(
257
- "EPSG:4490",
258
- "+proj=longlat +ellps=GRS80 +no_defs +type=crs",
259
- { matrixIds, resolutions, origin: [-180, 90] }
260
- );
250
+ L.CRS.CRS4490 = new L.Proj.CRS("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs", {
251
+ matrixIds,
252
+ resolutions,
253
+ origin: [-180, 90]
254
+ });
261
255
  }
262
256
  return crs ? L.CRS[`${crs}`] : DEFAULT_CRS;
263
257
  }
@@ -330,6 +324,7 @@ class Leafletjs extends events.EventEmitter {
330
324
  return mapProxy.createMapProxy(polygon, handlers);
331
325
  });
332
326
  this.initParams = request;
327
+ this.tileLayerList = [];
333
328
  }
334
329
  // 初始化地图
335
330
  InitMap(domId, option) {
@@ -349,6 +344,7 @@ class Leafletjs extends events.EventEmitter {
349
344
  const newMap = L.map(domId, option);
350
345
  newMap.getInitMap = () => newMap;
351
346
  const wrappedHandlers = mapProxy.createWrappedHandlerStore();
347
+ const _this = this;
352
348
  const handlers = {
353
349
  // 删除地图
354
350
  removeMap: function(target, params) {
@@ -424,6 +420,10 @@ class Leafletjs extends events.EventEmitter {
424
420
  off: function(target, types, fn, context) {
425
421
  const wrappedFn = wrappedHandlers.take(types, fn);
426
422
  return target.off(types, wrappedFn || fn, context);
423
+ },
424
+ /* 判断地图颜色 */
425
+ satelliteMapFn: function(target, satelliteMap) {
426
+ _this.setLayersUrl(target, satelliteMap !== 2);
427
427
  }
428
428
  };
429
429
  const map = mapProxy.createMapProxy(newMap, handlers);
@@ -433,7 +433,7 @@ class Leafletjs extends events.EventEmitter {
433
433
  option.completeCallbacks();
434
434
  }
435
435
  });
436
- this.setLayersUrl(map);
436
+ this.setLayersUrl(map, option.satelliteMap !== 2);
437
437
  return map;
438
438
  }
439
439
  // 设置地图瓦片地址
@@ -448,22 +448,23 @@ class Leafletjs extends events.EventEmitter {
448
448
  if (mapServerType === "WMTS" || mapServerType === "Dynamic") {
449
449
  return this.createLayers(map, layersUrls);
450
450
  }
451
+ this.tileLayerList.forEach((tileLayer) => {
452
+ tileLayer?.remove();
453
+ });
454
+ this.tileLayerList = [];
451
455
  layersUrls.split(",").forEach((layersUrl) => {
456
+ let tileLayer = null;
452
457
  if (changeColorType) {
453
- this.createCustomLayers(map, layersUrl);
458
+ tileLayer = this.createCustomLayers(map, layersUrl);
454
459
  } else {
455
- this.createLayers(map, layersUrl);
460
+ tileLayer = this.createLayers(map, layersUrl);
456
461
  }
462
+ this.tileLayerList.push(tileLayer);
457
463
  });
458
464
  }
459
465
  // 超图 WMTS 图层(不适用所有的WMTS图层,目前仅支持超图WMTS,因不同的WMTS服务规范不一样,主要体现在路由访问参数)
460
466
  createWMTSLayer(map, option = {}) {
461
- const {
462
- url,
463
- layer,
464
- tilematrixSet,
465
- format = "image/png"
466
- } = typeof option === "string" ? { url: option } : option;
467
+ const { url, layer, tilematrixSet, format = "image/png" } = typeof option === "string" ? { url: option } : option;
467
468
  const crs = getCrs(this.initParams.crs);
468
469
  if (!L.WMTSLayer) {
469
470
  L.WMTSLayer = L.TileLayer.extend({
@@ -539,8 +540,7 @@ class Leafletjs extends events.EventEmitter {
539
540
  createLayers(map, url, option = {}) {
540
541
  const { zoomOffset, mapServerType } = this.initParams;
541
542
  if (mapServerType === "WMTS") return this.createWMTSLayer(map, url);
542
- if (mapServerType === "Dynamic")
543
- return this.createDynamicLayer(map, url.url || url);
543
+ if (mapServerType === "Dynamic") return this.createDynamicLayer(map, url.url || url);
544
544
  const newLeayer = L.tileLayer(url, {
545
545
  ...option,
546
546
  zoomOffset: zoomOffset || 0
@@ -552,8 +552,7 @@ class Leafletjs extends events.EventEmitter {
552
552
  createCustomLayers(map, url, option = {}) {
553
553
  const { zoomOffset, mapServerType } = this.initParams;
554
554
  if (mapServerType === "WMTS") return this.createWMTSLayer(map, url);
555
- if (mapServerType === "Dynamic")
556
- return this.createDynamicLayer(map, url.url || url);
555
+ if (mapServerType === "Dynamic") return this.createDynamicLayer(map, url.url || url);
557
556
  const filter = option.filter || DEFAULT_TILE_FILTER;
558
557
  const CustomTileLayer = L.TileLayer.extend({
559
558
  options: {
@@ -657,12 +656,7 @@ class Leafletjs extends events.EventEmitter {
657
656
  },
658
657
  on: function(target, types, fn, context) {
659
658
  if (types === "click") {
660
- const customClickHandler = createClickHandler(
661
- fn,
662
- context,
663
- target,
664
- true
665
- );
659
+ const customClickHandler = createClickHandler(fn, context, target, true);
666
660
  wrappedHandlers.remember(types, fn, customClickHandler);
667
661
  return target.on(types, customClickHandler, context);
668
662
  }
@@ -750,10 +744,7 @@ class Leafletjs extends events.EventEmitter {
750
744
  },
751
745
  // 圆形转多边形坐标
752
746
  getLatLngs: function(target) {
753
- const points = circleToPolygonPoints(
754
- target.getLatLng(),
755
- target.getRadius() / 1e3
756
- );
747
+ const points = circleToPolygonPoints(target.getLatLng(), target.getRadius() / 1e3);
757
748
  return [latLngListCheckExport(points)];
758
749
  }
759
750
  };
@@ -835,12 +826,7 @@ class Leafletjs extends events.EventEmitter {
835
826
  if (latLngList && latLngList.length !== 0) {
836
827
  latLngList = latLngListCheck(latLngList);
837
828
  }
838
- const polyline = L.motion.polyline(
839
- latLngList,
840
- option,
841
- motionOption,
842
- markerOption
843
- );
829
+ const polyline = L.motion.polyline(latLngList, option, motionOption, markerOption);
844
830
  return mapProxy.createMapProxy(polyline, {
845
831
  addTo: function(target, map) {
846
832
  return target.addTo(generalMapMethods.getMap(map));
@@ -1061,20 +1047,14 @@ class Leafletjs extends events.EventEmitter {
1061
1047
  function calcTotalDistance(index, preIndex) {
1062
1048
  const current = rangingMarker[index].options.extData.latlng;
1063
1049
  const previous = rangingMarker[preIndex].options.extData.latlng;
1064
- const distance = parseFloat(
1065
- (map.distance(current, previous) / 1e3).toFixed(2)
1066
- );
1067
- const total = parseFloat(
1068
- rangingMarker[preIndex].options.extData.distance || 0
1069
- );
1050
+ const distance = parseFloat((map.distance(current, previous) / 1e3).toFixed(2));
1051
+ const total = parseFloat(rangingMarker[preIndex].options.extData.distance || 0);
1070
1052
  return (distance + total).toFixed(2);
1071
1053
  }
1072
1054
  function setStartIcon(index) {
1073
1055
  const markerItem = rangingMarker[index];
1074
1056
  markerItem.setIcon({
1075
- divIcon: _this.DivIcon(
1076
- rangingStartIconOption(options, markerItem.options.extData.dicId)
1077
- )
1057
+ divIcon: _this.DivIcon(rangingStartIconOption(options, markerItem.options.extData.dicId))
1078
1058
  });
1079
1059
  markerItem.options.extData.distance = 0;
1080
1060
  }
@@ -1092,14 +1072,7 @@ class Leafletjs extends events.EventEmitter {
1092
1072
  const markerItem = rangingMarker[index];
1093
1073
  const isLast = showDeleteAll ?? !rangingMarker[index + 1]?.options?.extData?.distance;
1094
1074
  markerItem.setIcon({
1095
- divIcon: _this.DivIcon(
1096
- rangingPointIconOption(
1097
- options,
1098
- distance,
1099
- markerItem.options.extData.dicId,
1100
- isLast
1101
- )
1102
- )
1075
+ divIcon: _this.DivIcon(rangingPointIconOption(options, distance, markerItem.options.extData.dicId, isLast))
1103
1076
  });
1104
1077
  markerItem.options.extData.distance = distance;
1105
1078
  }
@@ -1127,10 +1100,7 @@ class Leafletjs extends events.EventEmitter {
1127
1100
  rangingPointsIng.push({ lat, lng });
1128
1101
  } else {
1129
1102
  const latlngs = [
1130
- [
1131
- rangingPointsIng[rangingPointsIng.length - 1].lat,
1132
- rangingPointsIng[rangingPointsIng.length - 1].lng
1133
- ],
1103
+ [rangingPointsIng[rangingPointsIng.length - 1].lat, rangingPointsIng[rangingPointsIng.length - 1].lng],
1134
1104
  [lat, lng]
1135
1105
  ];
1136
1106
  const polyline = _this.Polyline(latlngs, {
@@ -1148,13 +1118,9 @@ class Leafletjs extends events.EventEmitter {
1148
1118
  { lat: latlngs[1][0], lng: latlngs[1][1] }
1149
1119
  );
1150
1120
  distance = parseFloat((distance / 1e3).toFixed(2));
1151
- const total = parseFloat(
1152
- rangingMarker[rangingMarker.length - 1].options.extData.distance || 0
1153
- );
1121
+ const total = parseFloat(rangingMarker[rangingMarker.length - 1].options.extData.distance || 0);
1154
1122
  distance = (distance + total).toFixed(2);
1155
- const customIcon = _this.DivIcon(
1156
- rangingPointIconOption(options, distance, dicId)
1157
- );
1123
+ const customIcon = _this.DivIcon(rangingPointIconOption(options, distance, dicId));
1158
1124
  const markerItem = _this.Marker({
1159
1125
  icon: customIcon,
1160
1126
  position: { lat, lng },
@@ -1220,10 +1186,7 @@ class Leafletjs extends events.EventEmitter {
1220
1186
  if (changeIndex - 1 === index) {
1221
1187
  setStartIcon(changeIndex);
1222
1188
  } else {
1223
- setPointIcon(
1224
- changeIndex,
1225
- calcTotalDistance(changeIndex, changeIndex - 1)
1226
- );
1189
+ setPointIcon(changeIndex, calcTotalDistance(changeIndex, changeIndex - 1));
1227
1190
  }
1228
1191
  changeIndex++;
1229
1192
  }
@@ -1256,10 +1219,7 @@ class Leafletjs extends events.EventEmitter {
1256
1219
  let changeIndex = index + 1;
1257
1220
  while (rangingMarker[changeIndex]?.options?.extData?.distance) {
1258
1221
  const disIndex = changeIndex - 1 === index ? changeIndex - 2 : changeIndex - 1;
1259
- setPointIcon(
1260
- changeIndex,
1261
- calcTotalDistance(changeIndex, disIndex)
1262
- );
1222
+ setPointIcon(changeIndex, calcTotalDistance(changeIndex, disIndex));
1263
1223
  changeIndex++;
1264
1224
  }
1265
1225
  setTimeout(() => {
@@ -1270,11 +1230,7 @@ class Leafletjs extends events.EventEmitter {
1270
1230
  const beforeDistance = rangingMarker[index - 1]?.options?.extData?.distance;
1271
1231
  if (beforeDistance) {
1272
1232
  removeLineBetween(rangEndIndex, index - 1, index);
1273
- setPointIcon(
1274
- index - 1,
1275
- rangingMarker[index - 1].options.extData.distance,
1276
- true
1277
- );
1233
+ setPointIcon(index - 1, rangingMarker[index - 1].options.extData.distance, true);
1278
1234
  setTimeout(() => {
1279
1235
  rangingMarker[index].remove();
1280
1236
  rangingMarker.splice(index, 1);
@@ -21,15 +21,9 @@ const AMAP_PLUGINS = [
21
21
  ];
22
22
  const staticAssets = {
23
23
  "bigemap.js": new URL("../../static/map/bigemap.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
24
- "markercluster.js": new URL(
25
- "../../static/map/markercluster.js",
26
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))
27
- ).href,
24
+ "markercluster.js": new URL("../../static/map/markercluster.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
28
25
  "bmDraw.js": new URL("../../static/map/bmDraw.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
29
- "bm.geometryutil.js": new URL(
30
- "../../static/map/bm.geometryutil.js",
31
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))
32
- ).href,
26
+ "bm.geometryutil.js": new URL("../../static/map/bm.geometryutil.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
33
27
  "moveMarker.js": new URL("../../static/map/moveMarker.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href
34
28
  };
35
29
  const normalizeStaticBaseUrl = (baseUrl) => {
@@ -233,7 +227,7 @@ class InitMap extends events.EventEmitter {
233
227
  /* === leafletjs === */
234
228
  ...option
235
229
  };
236
- return this.map.InitMap(domId, option);
230
+ return this.map?.InitMap(domId, option);
237
231
  }
238
232
  // 自定义 h5 图标
239
233
  DivIcon(option) {
@@ -34,9 +34,9 @@ function ToLon(x, y) {
34
34
  return ret;
35
35
  }
36
36
  const Coordinate = {
37
- "WGS84": 0,
38
- "GCJ02": 1,
39
- "BD09": 2
37
+ WGS84: 0,
38
+ GCJ02: 1,
39
+ BD09: 2
40
40
  };
41
41
  const reverseCoordinate = {
42
42
  0: "WGS84",
@@ -44,17 +44,17 @@ const reverseCoordinate = {
44
44
  2: "BD09"
45
45
  };
46
46
  const conversionCoordinateMap = {
47
- "WGS84": {
48
- "GCJ02": WGS84ToGCJ02,
49
- "BD09": WGS84ToBD09
47
+ WGS84: {
48
+ GCJ02: WGS84ToGCJ02,
49
+ BD09: WGS84ToBD09
50
50
  },
51
- "GCJ02": {
52
- "WGS84": GCJ02ToWGS84,
53
- "BD09": GCJ02ToBD09
51
+ GCJ02: {
52
+ WGS84: GCJ02ToWGS84,
53
+ BD09: GCJ02ToBD09
54
54
  },
55
- "BD09": {
56
- "GCJ02": BD09ToGCJ02,
57
- "WGS84": BD09ToWGS84
55
+ BD09: {
56
+ GCJ02: BD09ToGCJ02,
57
+ WGS84: BD09ToWGS84
58
58
  }
59
59
  };
60
60
  function getMapConfig() {
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.65";
3
+ const version = "0.2.67";
4
4
 
5
5
  exports.version = version;