@supermapgis/vue-iclient-leaflet 11.2.0 → 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 (174) hide show
  1. package/dist/iclient-leaflet-vue.css +23 -9
  2. package/dist/iclient-leaflet-vue.js +21687 -44393
  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 +21 -9
  10. package/lib/_lang/index.js +22 -22
  11. package/lib/_lang/zh.js +21 -9
  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 +1527 -1278
  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 +1344 -1147
  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 +1441 -1242
  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 +67 -68
  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 +45 -46
  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 +47 -48
  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 +37 -38
  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 +47 -49
  113. package/lib/time-slider/index.js +67 -69
  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 +102 -151
  121. package/lib/video-player/style/video-player.css +1 -1
  122. package/lib/web-map/index.js +2339 -106
  123. package/package.json +3 -5
  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 +19 -7
  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/VideoPlayer.vue +4 -41
  157. package/src/common/video-player/style/video-player.scss +1 -1
  158. package/src/leaflet/entrys.json +0 -2
  159. package/src/leaflet/package.json +3 -5
  160. package/src/leaflet/web-map/WebMap.vue +4 -4
  161. package/src/leaflet/web-map/WebMapViewModel.ts +64 -17
  162. package/static/libs/iclient-common/iclient-common-webmapv2base.js +2 -0
  163. package/static/libs/iclient-common/iclient-common.js +1 -1
  164. package/static/libs/iclient-leaflet/iclient-leaflet.min.js +5 -1738
  165. package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
  166. package/lib/_assets/iconfont/icon-sm-components.svg +0 -197
  167. package/lib/_mixin/WebMapBase.js +0 -3467
  168. package/lib/_utils/WebMapService.js +0 -1607
  169. package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
  170. package/src/common/_assets/iconfont/icon-sm-components.svg +0 -197
  171. package/src/common/_utils/WebMapService.ts +0 -1292
  172. package/src/common/web-map/WebMapBase.ts +0 -1178
  173. package/src/common/web-map/config/MunicipalCenter.json +0 -1
  174. package/src/common/web-map/config/ProvinceCenter.json +0 -1
@@ -226,6 +226,7 @@
226
226
  }
227
227
  }
228
228
  .sm-component-video-player-modal {
229
+ background: rgba(0, 0, 0, 0.7);
229
230
  .sm-component-modal-close {
230
231
  color: #a2a3a5;
231
232
  right: -5%;
@@ -257,7 +258,6 @@
257
258
  }
258
259
  }
259
260
  }
260
- background: rgba(0, 0, 0, 0.7);
261
261
  }
262
262
  .sm-component-video-full-fill{
263
263
  video{
@@ -59,7 +59,6 @@
59
59
  "_mixin/ThirdService": "vue-iclient/src/common/_mixin/ThirdService.ts",
60
60
  "_mixin/Timer": "vue-iclient/src/common/_mixin/Timer.ts",
61
61
  "_mixin/VmUpdater": "vue-iclient/src/common/_mixin/VmUpdater.ts",
62
- "_mixin/WebMapBase": "vue-iclient/src/common/web-map/WebMapBase.ts",
63
62
  "_mixin/GridLayer": "vue-iclient/src/leaflet/_mixin/GridLayer.js",
64
63
  "_mixin/Layer": "vue-iclient/src/leaflet/_mixin/Layer.js",
65
64
  "_mixin/map-getter": "vue-iclient/src/leaflet/_mixin/map-getter.ts",
@@ -93,7 +92,6 @@
93
92
  "_utils/RestService": "vue-iclient/src/common/_utils/RestService.js",
94
93
  "_utils/statistics": "vue-iclient/src/common/_utils/statistics.js",
95
94
  "_utils/util": "vue-iclient/src/common/_utils/util.js",
96
- "_utils/WebMapService": "vue-iclient/src/common/_utils/WebMapService.ts",
97
95
  "_utils/vue-types/index": "vue-iclient/src/common/_utils/vue-types/index.js",
98
96
  "_utils/vue-types/utils": "vue-iclient/src/common/_utils/vue-types/utils.js",
99
97
  "_utils/style/theme/chart": "vue-iclient/src/common/_utils/style/theme/chart.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@supermapgis/vue-iclient-leaflet",
3
3
  "description": "SuperMap iClient for Vue.js",
4
- "version": "11.2.0",
4
+ "version": "11.3.0",
5
5
  "homepage": "http://iclient.supermap.io",
6
6
  "main": "lib/index",
7
7
  "dependencies": {
@@ -13,12 +13,11 @@
13
13
  "@turf/length": "^6.0.2",
14
14
  "@turf/rhumb-bearing": "^6.0.1",
15
15
  "@turf/transform-scale": "^5.1.5",
16
- "@turf/meta": "^6.5.0",
17
16
  "@types/geojson": "^7946.0.7",
18
17
  "@types/leaflet": "^1.5.5",
19
18
  "@types/node": "^12.0.3",
20
19
  "ant-design-vue": "1.7.2",
21
- "axios": "^1.6.2",
20
+ "axios": "^1.7.4",
22
21
  "canvg": "~3.0.10",
23
22
  "clipboard": "^2.0.6",
24
23
  "colorcolor": "^1.1.1",
@@ -40,14 +39,13 @@
40
39
  "lodash.isnumber": "^3.0.3",
41
40
  "lodash.isplainobject": "^4.0.6",
42
41
  "lodash.max": "^4.0.1",
43
- "lodash.min": "^4.0.1",
44
42
  "lodash.merge": "^4.6.1",
45
43
  "lodash.orderby": "^4.6.0",
46
44
  "lodash.tonumber": "^4.0.3",
47
45
  "lodash.uniqueid": "^4.0.1",
48
46
  "mux.js": "^5.6.7",
49
47
  "omit.js": "^2.0.2",
50
- "proj4": "^2.6.0",
48
+ "proj4": "^2.8.0",
51
49
  "resize-detector": "^0.2.0",
52
50
  "simple-statistics": "^7.8.3",
53
51
  "swiper": "^6.8.4",
@@ -165,7 +165,7 @@ class SmWebMap extends Mixins(VmUpdater, MapEvents) {
165
165
  */
166
166
  this.load({ map: e.map });
167
167
  },
168
- getmapinfofailed: e => {
168
+ mapcreatefailed: e => {
169
169
  /**
170
170
  * @event getMapFailed
171
171
  * @desc 获取 WebMap 地图信息失败。
@@ -176,7 +176,7 @@ class SmWebMap extends Mixins(VmUpdater, MapEvents) {
176
176
  Message.error(e.error.message);
177
177
  this.spinning = false;
178
178
  },
179
- getlayerdatasourcefailed: e => {
179
+ layercreatefailed: e => {
180
180
  /**
181
181
  * @event getLayerDatasourceFailed
182
182
  * @desc 获取图层数据失败。
@@ -193,9 +193,9 @@ class SmWebMap extends Mixins(VmUpdater, MapEvents) {
193
193
  Message.error(this.$t('webmap.getLayerInfoFailed'));
194
194
  }
195
195
  },
196
- notsupportmvt: () => {
196
+ mvtnotsupport: () => {
197
197
  // @ts-ignore
198
- Message.error('暂不支持加载矢量瓦片图层!');
198
+ Message.error(this.$t('webmap.mvtNotSupport'));
199
199
  this.spinning = false;
200
200
  }
201
201
  });
@@ -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
  }