@supermapgis/vue-iclient-leaflet 11.2.1 → 11.3.0

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 (173) hide show
  1. package/dist/iclient-leaflet-vue.css +23 -9
  2. package/dist/iclient-leaflet-vue.js +21689 -44354
  3. package/dist/iclient-leaflet-vue.min.css +2 -2
  4. package/dist/iclient-leaflet-vue.min.js +39 -293
  5. package/lib/_assets/iconfont/icon-sm-components.css +21 -7
  6. package/lib/_assets/iconfont/icon-sm-components.ttf +0 -0
  7. package/lib/_assets/iconfont/icon-sm-components.woff +0 -0
  8. package/lib/_assets/iconfont/icon-sm-components.woff2 +0 -0
  9. package/lib/_lang/en.js +20 -8
  10. package/lib/_lang/index.js +18 -18
  11. package/lib/_lang/zh.js +20 -8
  12. package/lib/_mixin/AntdRender.js +15 -17
  13. package/lib/_mixin/Card.js +10 -11
  14. package/lib/_mixin/GridLayer.js +4 -4
  15. package/lib/_mixin/Layer.js +4 -4
  16. package/lib/_mixin/Options.js +2 -2
  17. package/lib/_mixin/Popper.js +2 -2
  18. package/lib/_mixin/Theme.js +13 -15
  19. package/lib/_mixin/ThirdService.js +15 -16
  20. package/lib/_mixin/TileLayer.js +4 -4
  21. package/lib/_mixin/Timer.js +8 -9
  22. package/lib/_mixin/VmUpdater.js +10 -11
  23. package/lib/_mixin/map-events.js +8 -9
  24. package/lib/_mixin/map-getter.js +13 -14
  25. package/lib/_types/AddressMatchParameter.js +2 -2
  26. package/lib/_types/GeoJSONParamter.js +2 -2
  27. package/lib/_types/RestDataParameter.js +5 -6
  28. package/lib/_types/RestMapParameter.js +5 -6
  29. package/lib/_types/RestParameter.js +2 -2
  30. package/lib/_types/event/BaseTypes.js +2 -2
  31. package/lib/_types/event/Event.js +4 -4
  32. package/lib/_types/event/Events.js +10 -10
  33. package/lib/_types/event/Pixel.js +2 -2
  34. package/lib/_types/event/Util.js +2 -2
  35. package/lib/_types/iPortalDataParameter.js +3 -2
  36. package/lib/_types/iServerBaseParameter.js +3 -2
  37. package/lib/_types/iServerDataParameter.js +5 -6
  38. package/lib/_types/iServerMapParameter.js +5 -6
  39. package/lib/_types/index.js +18 -18
  40. package/lib/_types/map-event.js +6 -6
  41. package/lib/_utils/EchartsDataService.js +24 -24
  42. package/lib/_utils/RestService.js +1345 -1149
  43. package/lib/_utils/epsg-define.js +45 -34
  44. package/lib/_utils/get-features.js +23 -10
  45. package/lib/_utils/global-event.js +6 -6
  46. package/lib/_utils/iPortalDataService.js +1368 -1147
  47. package/lib/_utils/iServerRestService.js +1518 -1269
  48. package/lib/_utils/props-binder.js +2 -2
  49. package/lib/_utils/statistics.js +8 -17
  50. package/lib/_utils/style/color/colorPalette.js +4 -4
  51. package/lib/_utils/style/color/serialColors.js +8 -8
  52. package/lib/_utils/style/theme/chart.js +1343 -1146
  53. package/lib/_utils/style/theme/set-theme.js +10 -10
  54. package/lib/_utils/style/theme/theme.json +6 -6
  55. package/lib/_utils/util.js +12 -12
  56. package/lib/_utils/vue-types/utils.js +2 -2
  57. package/lib/attribute-panel/style/attribute-panel.css +1 -0
  58. package/lib/attribute-panel/style/css.js +7 -0
  59. package/lib/attribute-panel/style/index.js +7 -0
  60. package/lib/avatar/index.js +25 -25
  61. package/lib/border/index.js +77 -77
  62. package/lib/breadcrumb/index.js +47 -41
  63. package/lib/button/index.js +53 -50
  64. package/lib/card/index.js +47 -41
  65. package/lib/chart/index.js +1437 -1238
  66. package/lib/checkbox/index.js +36 -33
  67. package/lib/collapse/index.js +39 -36
  68. package/lib/collapse-card/index.js +71 -76
  69. package/lib/color-picker/index.js +48 -49
  70. package/lib/date-picker/index.js +107 -95
  71. package/lib/dropdown/index.js +27 -27
  72. package/lib/empty/index.js +27 -27
  73. package/lib/icon/index.js +25 -25
  74. package/lib/identify/index.js +58 -59
  75. package/lib/iframe/index.js +31 -31
  76. package/lib/image/index.js +226 -42
  77. package/lib/image/style/image.css +1 -1
  78. package/lib/index.js +4 -4
  79. package/lib/indicator/index.js +70 -67
  80. package/lib/init.js +8 -8
  81. package/lib/input/index.js +150 -135
  82. package/lib/input-number/index.js +100 -97
  83. package/lib/layout/index.js +72 -60
  84. package/lib/liquid-fill/index.js +73 -73
  85. package/lib/marker/index.js +43 -44
  86. package/lib/menu/index.js +47 -41
  87. package/lib/message/index.js +3 -3
  88. package/lib/message/style/message.css +1 -1
  89. package/lib/modal/index.js +67 -67
  90. package/lib/modal/style/modal.css +1 -1
  91. package/lib/notification/index.js +6 -6
  92. package/lib/notification/style/notification.css +1 -1
  93. package/lib/pagination/index.js +34 -34
  94. package/lib/popup/index.js +45 -46
  95. package/lib/progress/index.js +440 -440
  96. package/lib/radio/index.js +48 -42
  97. package/lib/select/index.js +47 -41
  98. package/lib/slider/index.js +27 -27
  99. package/lib/slideshow/index.js +103 -160
  100. package/lib/spin/index.js +30 -30
  101. package/lib/steps/index.js +35 -32
  102. package/lib/switch/index.js +25 -25
  103. package/lib/table/index.js +50 -44
  104. package/lib/table/style/table.css +1 -1
  105. package/lib/table-popup/index.js +43 -37
  106. package/lib/table-popup/style/table-popup.css +1 -1
  107. package/lib/tabs/index.js +35 -32
  108. package/lib/text/index.js +39 -39
  109. package/lib/tile-layer/index.js +35 -36
  110. package/lib/time-line/index.js +41 -43
  111. package/lib/time-picker/index.js +27 -27
  112. package/lib/time-range/index.js +53 -55
  113. package/lib/time-slider/index.js +73 -75
  114. package/lib/time-text/index.js +31 -31
  115. package/lib/tooltip/index.js +25 -25
  116. package/lib/tooltip/style/tooltip.css +1 -0
  117. package/lib/transfer/index.js +27 -27
  118. package/lib/tree/index.js +48 -42
  119. package/lib/tree-select/index.js +37 -34
  120. package/lib/video-player/index.js +98 -97
  121. package/lib/video-player/style/video-player.css +1 -1
  122. package/lib/web-map/index.js +2336 -103
  123. package/package.json +2 -4
  124. package/src/common/_assets/iconfont/icon-sm-components.css +21 -7
  125. package/src/common/_assets/iconfont/icon-sm-components.ttf +0 -0
  126. package/src/common/_assets/iconfont/icon-sm-components.woff +0 -0
  127. package/src/common/_assets/iconfont/icon-sm-components.woff2 +0 -0
  128. package/src/common/_lang/en.js +19 -8
  129. package/src/common/_lang/zh.js +18 -6
  130. package/src/common/_mixin/Card.ts +1 -1
  131. package/src/common/_types/iPortalDataParameter.js +1 -0
  132. package/src/common/_types/iServerBaseParameter.ts +3 -0
  133. package/src/common/_utils/epsg-define.js +32 -27
  134. package/src/common/_utils/get-features.js +13 -2
  135. package/src/common/_utils/iPortalDataService.js +14 -3
  136. package/src/common/_utils/iServerRestService.js +144 -78
  137. package/src/common/_utils/statistics.js +6 -14
  138. package/src/common/_utils/style/theme/theme.json +6 -6
  139. package/src/common/attribute-panel/AttributePanel.vue +58 -0
  140. package/src/common/attribute-panel/__test__/AttributePanel.spec.js +39 -0
  141. package/src/common/attribute-panel/index.js +9 -0
  142. package/src/common/attribute-panel/style/attribute-panel.scss +35 -0
  143. package/src/common/attribute-panel/style/index.js +4 -0
  144. package/src/common/collapse-card/style/collapse-card.scss +2 -2
  145. package/src/common/iframe/Iframe.vue +1 -1
  146. package/src/common/image/Image.vue +68 -6
  147. package/src/common/image/style/image.scss +32 -0
  148. package/src/common/message/style/message.scss +1 -0
  149. package/src/common/modal/style/modal.scss +36 -0
  150. package/src/common/notification/style/notification.scss +9 -0
  151. package/src/common/slideshow/Slideshow.vue +42 -95
  152. package/src/common/slideshow/Swiper.js +1 -1
  153. package/src/common/table/style/table.scss +36 -0
  154. package/src/common/table-popup/TablePopup.vue +5 -0
  155. package/src/common/tooltip/style/tooltip.scss +3 -0
  156. package/src/common/video-player/style/video-player.scss +1 -1
  157. package/src/leaflet/entrys.json +0 -2
  158. package/src/leaflet/package.json +2 -4
  159. package/src/leaflet/web-map/WebMap.vue +4 -4
  160. package/src/leaflet/web-map/WebMapViewModel.ts +64 -17
  161. package/static/libs/iclient-common/iclient-common-webmapv2base.js +2 -0
  162. package/static/libs/iclient-common/iclient-common.js +1 -1
  163. package/static/libs/iclient-leaflet/iclient-leaflet.min.js +5 -1738
  164. package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
  165. package/lib/_assets/iconfont/icon-sm-components.svg +0 -197
  166. package/lib/_mixin/WebMapBase.js +0 -3467
  167. package/lib/_utils/WebMapService.js +0 -1607
  168. package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
  169. package/src/common/_assets/iconfont/icon-sm-components.svg +0 -197
  170. package/src/common/_utils/WebMapService.ts +0 -1292
  171. package/src/common/web-map/WebMapBase.ts +0 -1178
  172. package/src/common/web-map/config/MunicipalCenter.json +0 -1
  173. package/src/common/web-map/config/ProvinceCenter.json +0 -1
@@ -1,12 +1,15 @@
1
1
  import L from '../leaflet-wrapper';
2
+ import { Events } from 'vue-iclient/src/common/_types/event/Events';
2
3
  import 'vue-iclient/static/libs/iclient-leaflet/iclient-leaflet.min';
3
4
  // import echarts from 'echarts'; // TODO iclient 拿不到 echarts ???
4
5
  import 'vue-iclient/static/libs/geostats/geostats';
5
6
  import getCenter from '@turf/center';
6
- import WebMapBase from 'vue-iclient/src/common/web-map/WebMapBase';
7
- import { toEpsgCode, getProjection } from 'vue-iclient/src/common/_utils/epsg-define';
7
+ import proj4 from 'proj4';
8
+ import { getProjection, toEpsgCode } from 'vue-iclient/src/common/_utils/epsg-define';
9
+ // @ts-ignore
10
+ import { createWebMapV2BaseExtending } from 'vue-iclient/static/libs/iclient-common/iclient-common-webmapv2base';
8
11
 
9
- interface webMapOptions {
12
+ interface WebMapOptions {
10
13
  target?: string;
11
14
  serverUrl?: string;
12
15
  accessToken?: string;
@@ -17,7 +20,7 @@ interface webMapOptions {
17
20
  isSuperMapOnline?: boolean;
18
21
  }
19
22
 
20
- interface mapOptions {
23
+ interface MapOptions {
21
24
  center?: [number, number] | L.LatLng;
22
25
  zoom?: number;
23
26
  maxBounds?: [[number, number], [number, number]] | L.Bounds;
@@ -26,19 +29,41 @@ interface mapOptions {
26
29
  crs?: L.CRS;
27
30
  preferCanvas?: boolean;
28
31
  }
32
+ // @ts-ignore
33
+ const WebMapV2Base: InstanceType<any> = createWebMapV2BaseExtending(Events, 'triggerEvent');
29
34
 
30
35
  // TODO 坐标系 / noWrap
31
- export default class WebMapViewModel extends WebMapBase {
36
+ export default class WebMapViewModel extends WebMapV2Base {
32
37
  map: L.Map;
33
38
 
39
+ mapOptions: MapOptions;
40
+
41
+ serverUrl: string;
42
+
34
43
  center: [number, number] | L.LatLng;
35
44
 
45
+ zoom: number;
46
+
47
+ target: string;
48
+
36
49
  mapParams: { title?: string; description?: string };
37
50
 
38
51
  layers: any = {};
39
52
 
40
53
  crs: L.CRS;
41
54
 
55
+ baseProjection: string;
56
+
57
+ triggerEvent: any;
58
+
59
+ eventTypes: string[];
60
+
61
+ protected _layers: any = [];
62
+
63
+ protected layerAdded: number;
64
+
65
+ protected expectLayerLen: number;
66
+
42
67
  private _dataFlowLayer: any;
43
68
 
44
69
  private _dataflowFeatureCache: any;
@@ -53,10 +78,30 @@ export default class WebMapViewModel extends WebMapBase {
53
78
 
54
79
  private _unprojectCrs;
55
80
 
56
- constructor(id, options: webMapOptions = {}, mapOptions: mapOptions = {}) {
57
- super(id, options, mapOptions);
81
+ constructor(id, options: WebMapOptions = {}, mapOptions: MapOptions = {}) {
82
+ super(
83
+ id,
84
+ {
85
+ ...options,
86
+ credentialKey: (options.accessKey && 'key') || (options.accessToken && 'token'),
87
+ credentialValue: options.accessKey || options.accessToken,
88
+ proj4
89
+ },
90
+ mapOptions
91
+ );
58
92
  this.center = mapOptions.center;
59
93
  this.zoom = mapOptions.zoom;
94
+ this.eventTypes = [
95
+ 'mapinitialized',
96
+ 'mapcreatesucceeded',
97
+ 'mapcreatefailed',
98
+ 'layercreatefailed',
99
+ 'baidumapnotsupport',
100
+ 'projectionnotmatch',
101
+ 'mapbeforeremove',
102
+ 'addlayerssucceeded',
103
+ 'mvtnotsupport'
104
+ ];
60
105
  this._initWebMap();
61
106
  }
62
107
 
@@ -176,7 +221,7 @@ export default class WebMapViewModel extends WebMapBase {
176
221
  layer = this._createBaiduTileLayer();
177
222
  break;
178
223
  case 'MAPBOXSTYLE':
179
- this.triggerEvent('notsupportmvt', {});
224
+ this.triggerEvent('mvtnotsupport', {});
180
225
  break;
181
226
  default:
182
227
  break;
@@ -195,7 +240,7 @@ export default class WebMapViewModel extends WebMapBase {
195
240
  // TODO --- 暂不支持 SAMPLE_DATA
196
241
  if (type === 'SAMPLE_DATA') {
197
242
  this._addLayerSucceeded();
198
- this.triggerEvent('getlayerdatasourcefailed', {
243
+ this.triggerEvent('layercreatefailed', {
199
244
  error: 'SAMPLE DATA is not supported',
200
245
  layer,
201
246
  map: this.map
@@ -298,7 +343,7 @@ export default class WebMapViewModel extends WebMapBase {
298
343
  } catch (err) {
299
344
  console.error(err);
300
345
  this._addLayerSucceeded();
301
- this.triggerEvent('getlayerdatasourcefailed', {
346
+ this.triggerEvent('layercreatefailed', {
302
347
  error: err,
303
348
  layer: layerInfo,
304
349
  map: this.map
@@ -684,9 +729,10 @@ export default class WebMapViewModel extends WebMapBase {
684
729
 
685
730
  private _createMigrationLayer(layerInfo, features) {
686
731
  // window['echarts'] = echarts;
687
- let options = this.getEchartsLayerOptions(layerInfo, features, 'leaflet');
732
+ const options = this.getEchartsLayerOptions(layerInfo, features, 'leaflet');
733
+ options.GLMap = { roam: true };
688
734
  // @ts-ignore
689
- let layer = L.supermap.echartsLayer(options);
735
+ const layer = L.supermap.echartsLayer(options);
690
736
  this.echartslayer.push(layer);
691
737
  return layer;
692
738
  }
@@ -772,8 +818,9 @@ export default class WebMapViewModel extends WebMapBase {
772
818
 
773
819
  private _addLayerToMap({ layer, type = 'overlays', layerInfo, sendToMap = true }) {
774
820
  let { visible, layerID, name, index } = layerInfo;
775
-
776
- sendToMap && (type = 'overlays');
821
+ if (sendToMap && type !== 'overlays') {
822
+ type = 'overlays';
823
+ }
777
824
  type === 'overlays' && layer.setZIndex && layer.setZIndex(index + 1);
778
825
 
779
826
  if (visible === undefined || visible) {
@@ -1076,11 +1123,11 @@ export default class WebMapViewModel extends WebMapBase {
1076
1123
  }
1077
1124
  }
1078
1125
 
1079
- protected getTransformCoodinatesCRS(epsgCode) {
1126
+ protected getTransformCoodinatesCRS(epsgCode: number) {
1080
1127
  const defName = `EPSG:${epsgCode}`;
1081
1128
  const defValue = getProjection(defName);
1082
1129
  // @ts-ignore
1083
- return L.Proj.CRS(toEpsgCode(defValue), {
1130
+ return L.Proj.CRS(defName, {
1084
1131
  def: defValue
1085
1132
  });
1086
1133
  }
@@ -1091,7 +1138,7 @@ export default class WebMapViewModel extends WebMapBase {
1091
1138
  this.stopCanvg();
1092
1139
  this.center = null;
1093
1140
  this.zoom = null;
1094
- this._dataFlowLayer.off('dataupdated', this._updateDataFlowFeaturesCallback);
1141
+ this._dataFlowLayer?.off('dataupdated', this._updateDataFlowFeaturesCallback);
1095
1142
  this._unprojectCrs = null;
1096
1143
  }
1097
1144
  }