@mapgis/webclient-mapboxgl-plugin 10.3.4 → 17.0.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 (91) hide show
  1. package/README.md +51 -124
  2. package/dist/es5/webclient-common.min.js +90 -0
  3. package/dist/es5/webclient-mapboxgl-plugin.min.js +1 -0
  4. package/dist/webclient-mapboxgl-plugin-es6.min.js +1 -0
  5. package/documention/EchartsLayer.html +379 -0
  6. package/documention/MapViewMapboxgl.html +3587 -0
  7. package/documention/Popup.html +1523 -0
  8. package/documention/Screenshot.html +1089 -0
  9. package/documention/SketchEditorMapboxgl.html +3383 -0
  10. package/documention/document_ArcGISVectorTileLayerView.js.html +265 -0
  11. package/documention/document_EchartsLayerView.js.html +246 -0
  12. package/documention/document_GraphicsLayerView.js.html +314 -0
  13. package/documention/document_IGSFeatureLayerView.js.html +218 -0
  14. package/documention/document_IGSMapImageLayerView.js.html +240 -0
  15. package/documention/document_IGSTileLayerView.js.html +236 -0
  16. package/documention/document_IGSVectorTileLayerView.js.html +264 -0
  17. package/documention/document_MapVLayerView.js.html +247 -0
  18. package/documention/document_WMSLayerView.js.html +240 -0
  19. package/documention/document_WMTSLayerView.js.html +234 -0
  20. package/documention/document_WebTileLayerView.js.html +240 -0
  21. package/documention/document_support_FeatureRenderView.js.html +682 -0
  22. package/documention/document_support_MapboxglGraphicsLayer.js.html +1184 -0
  23. package/documention/document_support_SourceMetaData.js.html +223 -0
  24. package/documention/document_support_Utils.js.html +624 -0
  25. package/documention/document_support_mapbox_mapboxCustomUtil.js.html +322 -0
  26. package/documention/global.html +252 -0
  27. package/documention/index.html +251 -0
  28. package/documention/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.MapvLayer.html +445 -0
  29. package/documention/scripts/app.min.js +1 -0
  30. package/documention/scripts/linenumber.js +26 -0
  31. package/documention/scripts/search.js +45 -0
  32. package/documention/scripts/sideBar.js +11 -0
  33. package/documention/sketchEditor_SketchEditorMapboxgl.js.html +875 -0
  34. package/documention/styles/anchor.png +0 -0
  35. package/documention/styles/app.min.css +1 -0
  36. package/documention/styles/c.png +0 -0
  37. package/documention/styles/iframe.css +29 -0
  38. package/documention/styles/m.png +0 -0
  39. package/documention/styles/prettify-jsdoc.css +111 -0
  40. package/documention/styles/prettify-tomorrow.css +132 -0
  41. package/documention/styles/reset.css +44 -0
  42. package/documention/styles/up-arrow.png +0 -0
  43. package/documention/tutorial-1./345/277/253/351/200/237/345/205/245/351/227/250.html +165 -0
  44. package/documention/util_ConvertRendererToStyleLayerUtil.js.html +844 -0
  45. package/documention/util_MapboxglFeatureRender.js.html +225 -0
  46. package/documention/util_MapboxglPlugin.js.html +284 -0
  47. package/documention/view_MapViewMapboxgl.js.html +1882 -0
  48. package/documention/view_utils_ArcGISVectorTileLayerUtil.js.html +382 -0
  49. package/documention/view_utils_EchartsLayerUtil.js.html +194 -0
  50. package/documention/view_utils_IGSMapImageUtil.js.html +373 -0
  51. package/documention/view_utils_IGSTileLayerUtil.js.html +285 -0
  52. package/documention/view_utils_IGSVectorTileLayerUtil.js.html +379 -0
  53. package/documention/view_utils_MapVLayerUtil.js.html +197 -0
  54. package/documention/view_utils_Popup.js.html +525 -0
  55. package/documention/view_utils_Screenshot.js.html +320 -0
  56. package/documention/view_utils_WMSLayerUtil.js.html +337 -0
  57. package/documention/view_utils_WMTSLayerUtil.js.html +331 -0
  58. package/documention/view_utils_WebTileLayerUtil.js.html +284 -0
  59. package/documention/view_utils_echarts_EchartsLayerPlugin.js.html +419 -0
  60. package/documention/view_utils_mapV_MapVLayerPlugin.js.html +527 -0
  61. package/documention/view_utils_mapV_MapvBaseLayer.js.html +477 -0
  62. package/documention/view_utils_support_rasterLayerUtil.js.html +244 -0
  63. package/documention/view_utils_support_vectorLayerUtil.js.html +503 -0
  64. package/package.json +20 -20
  65. package/core/Base.js +0 -15
  66. package/core/index.js +0 -5
  67. package/index.js +0 -6
  68. package/overlay/D3Layer.js +0 -108
  69. package/overlay/EchartsLayer.js +0 -242
  70. package/overlay/ElsCubeLayer.js +0 -125
  71. package/overlay/MapvLayer.js +0 -296
  72. package/overlay/StreamLayer.js +0 -83
  73. package/overlay/TimeSpaceCubeLayer.js +0 -135
  74. package/overlay/dthree/mapbox-d3.css +0 -9
  75. package/overlay/echarts/MapCoordSys.js +0 -105
  76. package/overlay/echarts/MapModel.js +0 -0
  77. package/overlay/echarts/MapView.js +0 -0
  78. package/overlay/echarts/index.js +0 -4
  79. package/overlay/index.js +0 -31
  80. package/overlay/mapv/MapvBaseLayer.js +0 -299
  81. package/overlay/mapv/index.js +0 -5
  82. package/overlay/stream/GeojsonStreamLayer.js +0 -135
  83. package/overlay/stream/MapvStreamLayer.js +0 -79
  84. package/overlay/stream/index.js +0 -3
  85. package/overlay/stream/popup.css +0 -31
  86. package/service/index.js +0 -1
  87. package/service/socket/ISocketService.js +0 -121
  88. package/service/socket/SocketEvent.js +0 -50
  89. package/service/socket/SocketService.js +0 -90
  90. package/util/Evented.js +0 -295
  91. package/util/Util.js +0 -348
@@ -0,0 +1,419 @@
1
+
2
+
3
+ <!DOCTYPE html>
4
+ <html lang="en">
5
+
6
+ <head>
7
+
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+ <title>Client for JavaScript view/utils/echarts/EchartsLayerPlugin.js</title>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/app.min.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/iframe.css">
16
+ <link type="text/css" rel="stylesheet" href="">
17
+
18
+
19
+ </head>
20
+
21
+
22
+
23
+ <body class="layout small-header">
24
+ <div id="stickyNavbarOverlay"></div>
25
+
26
+
27
+ <div class="top-nav">
28
+ <div class="inner">
29
+ <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
30
+ <span aria-hidden="true"></span>
31
+ <span aria-hidden="true"></span>
32
+ <span aria-hidden="true"></span>
33
+ </a>
34
+ <div class="logo">
35
+
36
+ <h1> MapGIS Client for JavaScript API</h1>
37
+
38
+
39
+ </div>
40
+ <div class="menu">
41
+
42
+ <div class="navigation">
43
+
44
+
45
+ <a
46
+ class="link user-link "
47
+ href="/static/modules/common/api/common-mapgis/index.html"
48
+ >
49
+ Common
50
+ </a>
51
+
52
+ <a
53
+ class="link user-link "
54
+ href="/static/modules/cesium/api/cesium-mapgis/index.html"
55
+ >
56
+ Cesium
57
+ </a>
58
+
59
+ <a
60
+ class="link user-link "
61
+ href="/static/modules/mapboxgl/api/mapboxgl-mapgis/index.html"
62
+ >
63
+ MapboxGL
64
+ </a>
65
+
66
+ <a
67
+ class="link user-link "
68
+ href="/static/modules/leaflet/api/leaflet-mapgis/index.html"
69
+ >
70
+ Leaflet
71
+ </a>
72
+
73
+ <a
74
+ class="link user-link "
75
+ href="/static/modules/openlayers/api/openLayers-mapgis/index.html"
76
+ >
77
+ OpenLayers
78
+ </a>
79
+
80
+
81
+
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <div id="main">
88
+ <div
89
+ class="sidebar "
90
+ id="sidebarNav"
91
+ >
92
+ <div>
93
+ <span class="mapgis-api-document-span"><a href="index.html">API文档</a></span>
94
+ </div>
95
+
96
+ <div class="search-wrapper">
97
+ <input id="search" type="text" placeholder="搜索文档..." class="input">
98
+ </div>
99
+
100
+ <nav>
101
+
102
+ <div class="category"><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">undefined</div><ul class="mapgis-sidebar-menus"><li><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="Popup.html">Popup</a><span style="display: none;"><p>二维场景信息弹窗(leaflet引擎)
103
+ 参考示例:
104
+ <a href='#MapView'>[初始化二维场景视图]</a>
105
+ [ES6引入方式]:<br/>
106
+ import { Popup } from '@mapgis/webclient-leaflet-plugin' <br/>
107
+ 自定义样式说明:<br/>
108
+ zondy-popup__content 弹窗容器样式<br/>
109
+ zondy-popup__tip 弹窗对话框箭头样式<br/>
110
+ zondy-popup__header 弹窗头部样式<br/>
111
+ zondy-popup__content 弹窗主体样式<br/>
112
+ zondy-popup__footer 弹窗底部样式<br/></p></span></li></ul><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">undefined</div><ul class="mapgis-sidebar-menus"><li><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="Screenshot.html">Screenshot</a><span style="display: none;"><p>打印工具</p></span></li></ul><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">草图编辑模块</div><ul class="mapgis-sidebar-menus"><li><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="SketchEditorMapboxgl.html">SketchEditorMapboxgl</a><span style="display: none;"><p>二维场景草图编辑类<br/>
113
+ <br>[ES5引入方式]:<br/>
114
+ const { SketchEditorMapboxgl } = Zondy <br/>
115
+ [ES6引入方式]:<br/>
116
+ import { SketchEditorMapboxgl } from &quot;@mapgis/webclient-leaflet-plugin&quot; <br/></p></span></li></ul></div>
117
+
118
+ </nav>
119
+ </div>
120
+ <div class="core" id="main-content-wrapper">
121
+ <div class="content">
122
+ <header id="page-title" class="page-title">
123
+ <span class="page-title-main">类名</span>
124
+ <span class="page-title-sub">view/utils/echarts/EchartsLayerPlugin.js</span>
125
+ </header>
126
+
127
+
128
+
129
+
130
+
131
+ <section>
132
+ <article>
133
+ <pre class="prettyprint source linenums"><code>import MapCoordSys from './MapCoordSys'
134
+
135
+ const echarts = window.echarts
136
+
137
+ /**
138
+ * mapboxgl的echars 4.0的实现
139
+ * @classdesc 基于mapboxgl的Layer对象进行的拓展
140
+ * @param map - {Object} 传入的mapboxgl的地图对象
141
+ * @param options - {Object} echarts.options 使用 option 来描述其对图表的各种需求,包括:有什么数据、要画什么图表、图表长什么样子、含有什么组件、组件能操作什么事情等等。简而言之,option 表述了:数据、数据如何映射成图形、交互行为。
142
+ */
143
+ class EchartsLayer {
144
+ constructor(map, options) {
145
+ this.map = map
146
+ this.options = options
147
+ this.layerId = options.layerId || 'echartlayerdefaultid'
148
+ this.layerClass = options.classId || 'echartlayerdefaultclass'
149
+
150
+ this.initDevicePixelRatio()
151
+
152
+ this.mapContainer = map.getCanvasContainer()
153
+ this.canvas = this._createCanvas()
154
+ this.mapContainer.appendChild(this.canvas)
155
+ this.mapContainer.style.perspective = `${this.map.transform.cameraToCenterDistance}px`
156
+ this.chart = echarts.init(this.canvas)
157
+ this.visible = true
158
+
159
+ this.initEcharts()
160
+ this._resizeCanvas()
161
+
162
+ return this
163
+ }
164
+
165
+ initDevicePixelRatio() {
166
+ this.devicePixelRatio = window.devicePixelRatio || 1
167
+ }
168
+
169
+ initEcharts() {
170
+ echarts.mapboxglMap = this.map
171
+
172
+ echarts.registerCoordinateSystem('mapboxgl', MapCoordSys)
173
+
174
+ echarts.extendComponentModel({
175
+ type: 'mapboxgl',
176
+ getBMap() {
177
+ return this.__mapboxgl
178
+ },
179
+ defaultOption: {
180
+ roam: false
181
+ }
182
+ })
183
+
184
+ echarts.registerAction(
185
+ {
186
+ type: 'MapboxGLRoma',
187
+ event: 'MapboxGLRoma',
188
+ update: 'updateLayout'
189
+ },
190
+ function (payload, ecModel) {}
191
+ )
192
+
193
+ return this
194
+ }
195
+
196
+ _createCanvas() {
197
+ const canvas = document.createElement('div')
198
+ canvas.id = this.layerId
199
+ canvas.style.position = 'absolute'
200
+ canvas.style.top = '0px'
201
+ canvas.style.left = '0px'
202
+ canvas.width = parseInt(this.map.getCanvas().style.width)
203
+ canvas.height = parseInt(this.map.getCanvas().style.height)
204
+ canvas.style.width = this.map.getCanvas().style.width
205
+ canvas.style.height = this.map.getCanvas().style.height
206
+
207
+ canvas.setAttribute('id', this.layerId)
208
+ canvas.setAttribute('class', this.layerClass)
209
+
210
+ // 这段可以先不不放开
211
+ /* var devicePixelRatio = this.devicePixelRatio;
212
+ if (this.mapVOptions.context == '2d') {
213
+ canvas.getContext(this.mapVOptions.context).scale(devicePixelRatio, devicePixelRatio);
214
+ } */
215
+ return canvas
216
+ }
217
+
218
+ _resizeCanvas() {
219
+ const self = this
220
+
221
+ window.onresize = function () {
222
+ const canvas = self.canvas
223
+ const map = self.map
224
+
225
+ canvas.style.position = 'absolute'
226
+ canvas.style.top = '0px'
227
+ canvas.style.left = '0px'
228
+ canvas.style.width = map.getCanvas().style.width
229
+ canvas.style.height = map.getCanvas().style.height
230
+ canvas.width = parseInt(map.getCanvas().style.width)
231
+ canvas.height = parseInt(map.getCanvas().style.height)
232
+
233
+ self.chart.resize()
234
+ }
235
+
236
+ // this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
237
+ }
238
+
239
+ addTo(map) {
240
+ const vm = this
241
+ echarts.extendComponentView({
242
+ type: 'mapboxgl',
243
+
244
+ render(mapModel, ecModel, api) {
245
+ let rendering = true
246
+
247
+ const mapboxglMap = echarts.mapboxglMap
248
+
249
+ const viewportRoot = api.getZr().painter.getViewportRoot()
250
+ const coordSys = mapModel.coordinateSystem
251
+ const moveHandler = function (type, target) {
252
+ if (rendering || !vm.visible) {
253
+ return
254
+ }
255
+ // var offsetEl = viewportRoot.parentNode.parentNode.parentNode
256
+ const offsetEl = document.getElementsByClassName('mapboxgl-map')[0]
257
+
258
+ const mapOffset = [
259
+ -parseInt(offsetEl.style.left, 10) || 0,
260
+ -parseInt(offsetEl.style.top, 10) || 0
261
+ ]
262
+ viewportRoot.style.left = `${mapOffset[0]}px`
263
+ viewportRoot.style.top = `${mapOffset[1]}px`
264
+
265
+ coordSys.setMapOffset(mapOffset)
266
+ mapModel.__mapOffset = mapOffset
267
+
268
+ api.dispatchAction({
269
+ type: 'MapboxGLRoma'
270
+ })
271
+ }
272
+
273
+ function zoomEndHandler() {
274
+ if (rendering || !vm.visible) {
275
+ return
276
+ }
277
+ api.dispatchAction({
278
+ type: 'MapboxGLRoma'
279
+ })
280
+ }
281
+
282
+ mapboxglMap.off('move', this._oldMoveHandler)
283
+ // FIXME
284
+ // Moveend may be triggered by centerAndZoom method when creating coordSys next time
285
+ // mapboxglMap.removeEventListener('moveend', this._oldMoveHandler)
286
+ mapboxglMap.off('zoomend', this._oldZoomEndHandler)
287
+ mapboxglMap.on('move', moveHandler)
288
+ // mapboxglMap.addEventListener('moveend', moveHandler)
289
+ mapboxglMap.on('zoomend', zoomEndHandler)
290
+
291
+ this._oldMoveHandler = moveHandler
292
+ this._oldZoomEndHandler = zoomEndHandler
293
+
294
+ const roam = mapModel.get('roam')
295
+ if (roam &amp;&amp; roam !== 'scale') {
296
+ // todo 允许拖拽
297
+ } else {
298
+ // todo 不允许拖拽
299
+ }
300
+ if (roam &amp;&amp; roam !== 'move') {
301
+ // todo 允许移动
302
+ } else {
303
+ // todo 不允许允许移动
304
+ }
305
+
306
+ rendering = false
307
+ }
308
+ })
309
+
310
+ this.chart.setOption(this.options)
311
+ return this
312
+ }
313
+
314
+ _visible() {
315
+ this.visible = true
316
+ this.canvas.style.visibility = 'visible'
317
+ }
318
+
319
+ _unvisible() {
320
+ this.visible = false
321
+ this.canvas.style.visibility = 'hidden'
322
+ }
323
+
324
+ /**
325
+ * 显示图层
326
+ * @function mapboxgl.zondy.EchartsLayer.prototype.show
327
+ */
328
+ show() {
329
+ this._visible()
330
+ }
331
+
332
+ /**
333
+ * 隐藏图层
334
+ * @function mapboxgl.zondy.EchartsLayer.prototype.hide
335
+ */
336
+ hide() {
337
+ this._unvisible()
338
+ }
339
+
340
+ /**
341
+ * 删除图层
342
+ * @function mapboxgl.zondy.EchartsLayer.prototype.remove
343
+ */
344
+ remove() {
345
+ const self = this
346
+ this.map._listeners.move.forEach(function (element) {
347
+ if (element.name === 'moveHandler') {
348
+ self.map.off('move', element)
349
+ }
350
+ })
351
+ this.map._listeners.move.forEach(function (element) {
352
+ if (element.name === 'zoomEndHandler') {
353
+ self.map.off('zoomend', element)
354
+ }
355
+ })
356
+
357
+ // this.map.off('move', this.map._listeners.move[1]);
358
+ // this.map.off('zoomend', this.map._listeners.moveend[1]);
359
+
360
+ this.chart.clear()
361
+
362
+ if (this.canvas.parentNode) this.canvas.parentNode.removeChild(this.canvas)
363
+ this.map = undefined
364
+ return this
365
+ }
366
+
367
+ /**
368
+ * @function mapboxgl.zondy.EchartsLayer.prototype.update
369
+ * @param {*} option echarts.option
370
+ * @see https://www.echartsjs.com/zh/tutorial.html#异步数据加载和更新
371
+ * @description ECharts 由数据驱动,数据的改变驱动图表展现的改变,因此动态数据的实现也变得异常简单。所有数据的更新都通过 setOption实现,你只需要定时获取数据,setOption 填入数据,而不用考虑数据到底产生了那些变化,ECharts 会找到两组数据之间的差异然后通过合适的动画去表现数据的变化。
372
+ */
373
+ update(option) {
374
+ this.chart.setOption(option)
375
+ }
376
+ }
377
+
378
+ export default EchartsLayer
379
+ </code></pre>
380
+ </article>
381
+ </section>
382
+
383
+
384
+
385
+
386
+ </div>
387
+
388
+ <footer class="footer">
389
+ <div class="content has-text-centered">
390
+ <p>文档生成<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a></p>
391
+ <p class="sidebar-created-by">
392
+ <a href="http://www.smaryun.com" target="_blank">司马云</a> <span>© 2023 云生态圈</span>
393
+ <a href="http://192.168.82.89:8086/#/index" target="_blank">MapGIS Client for JavaScript</a>
394
+ </p>
395
+ </div>
396
+ </footer>
397
+
398
+ </div>
399
+ <div id="side-nav" class="side-nav">
400
+ <div style="margin-bottom: 10px;">
401
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#page-title">构造函数</a>
402
+ </div>
403
+ <div style="margin-bottom: 10px;">
404
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#member">成员变量</a>
405
+ </div>
406
+ <div style="margin-bottom: 10px;">
407
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#function">方法</a>
408
+ </div>
409
+ <div>
410
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#event">事件</a>
411
+ </div>
412
+ </div>
413
+ </div>
414
+ <script src="scripts/linenumber.js"> </script>
415
+
416
+ <script src="scripts/search.js"> </script>
417
+
418
+ </body>
419
+ </html>