@mapgis/webclient-mapboxgl-plugin 10.3.3 → 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 (87) 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 -7
  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 -298
  72. package/overlay/StreamLayer.js +0 -86
  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/SocketService.js +0 -90
@@ -0,0 +1,503 @@
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/support/vectorLayerUtil.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/support/vectorLayerUtil.js</span>
125
+ </header>
126
+
127
+
128
+
129
+
130
+
131
+ <section>
132
+ <article>
133
+ <pre class="prettyprint source linenums"><code>/**
134
+ * 设置图层可见性
135
+ * @param {LayerView} layerView 图层视图对象
136
+ * */
137
+ function setVisible(layerView) {
138
+ // 获取矢量瓦片中的所有图层
139
+ const layers = layerView.layer.style.layers
140
+ // 获取地图视图对象
141
+ const innerView = layerView.innerView
142
+ // 循环设置图层可见性
143
+ for (let i = 0; i &lt; layers.length; i++) {
144
+ // 取图层可见性
145
+ const visible = layerView._getLayerViewVisible()
146
+ // 设置图层可见性
147
+ innerView.setLayoutProperty(
148
+ layers[i].id,
149
+ 'visibility',
150
+ visible ? 'visible' : 'none'
151
+ )
152
+ }
153
+ }
154
+
155
+ /**
156
+ * 删除图层
157
+ * @param {LayerView} layerView 图层视图对象
158
+ * */
159
+ function removeLayer(layerView) {
160
+ // 获取矢量瓦片中的所有图层
161
+ const layers = layerView.layer.style.layers
162
+ // 获取矢量瓦片中的所有Source
163
+ const sources = layerView.layer.style.sources
164
+ // 获取地图视图对象
165
+ const innerView = layerView.innerView
166
+ // 先删除图层
167
+ for (let i = 0; i &lt; layers.length; i++) {
168
+ if (innerView.getLayer(layers[i].id)) {
169
+ innerView.removeLayer(layers[i].id)
170
+ }
171
+ }
172
+ // 最后删除Source
173
+ Object.keys(sources).forEach((key) => {
174
+ if (innerView.getSource(key)) {
175
+ innerView.removeSource(key)
176
+ }
177
+ })
178
+ }
179
+
180
+ /**
181
+ * 设置图层透明度
182
+ * @param {LayerView} layerView 图层视图对象
183
+ * */
184
+ function setOpacity(layerView) {
185
+ // 基础图层对象
186
+ const commonLayer = layerView.layer
187
+ // 获取矢量瓦片中的所有图层
188
+ const layers = layerView.layer.style.layers
189
+ // 获取地图视图对象
190
+ const innerView = layerView.innerView
191
+ // 循环设置图层透明度
192
+ for (let i = 0; i &lt; layers.length; i++) {
193
+ // 根据mapbox图层类型设置透明度
194
+ switch (layers[i].type) {
195
+ case 'background':
196
+ innerView.setPaintProperty(
197
+ layers[i].id,
198
+ 'background-opacity',
199
+ commonLayer.opacity
200
+ )
201
+ break
202
+ case 'fill':
203
+ default:
204
+ innerView.setPaintProperty(
205
+ layers[i].id,
206
+ 'fill-opacity',
207
+ commonLayer.opacity
208
+ )
209
+ break
210
+ case 'line':
211
+ innerView.setPaintProperty(
212
+ layers[i].id,
213
+ 'line-opacity',
214
+ commonLayer.opacity
215
+ )
216
+ break
217
+ case 'symbol':
218
+ innerView.setPaintProperty(
219
+ layers[i].id,
220
+ 'icon-opacity',
221
+ commonLayer.opacity
222
+ )
223
+ innerView.setPaintProperty(
224
+ layers[i].id,
225
+ 'text-opacity',
226
+ commonLayer.opacity
227
+ )
228
+ break
229
+ case 'circle':
230
+ innerView.setPaintProperty(
231
+ layers[i].id,
232
+ 'circle-opacity',
233
+ commonLayer.opacity
234
+ )
235
+ break
236
+ case 'sky':
237
+ innerView.setPaintProperty(
238
+ layers[i].id,
239
+ 'sky-opacity',
240
+ commonLayer.opacity
241
+ )
242
+ break
243
+ }
244
+ }
245
+ }
246
+
247
+ /**
248
+ * 获取绘制参数
249
+ * @param {Object} updateContent 事件内容对象
250
+ * @return {Object} 绘制参数
251
+ * */
252
+ function getPaintOptions(updateContent) {
253
+ const args = updateContent.params
254
+ return {
255
+ layerId: args[0],
256
+ paints: args[1]
257
+ }
258
+ }
259
+
260
+ /**
261
+ * 设置图层的绘制样式属性
262
+ * @param {LayerView} layerView 图层视图对象
263
+ * @param {String} layerId 图层ID
264
+ * @param {Object} options 要改变的样式对象
265
+ * */
266
+ function setPaintProperties(layerView, layerId, options) {
267
+ // 获取地图视图对象
268
+ const innerView = layerView.innerView
269
+ // 图层要存在
270
+ if (innerView.getLayer(layerId) &amp;&amp; options instanceof Object) {
271
+ Object.keys(options).forEach((key) => {
272
+ innerView.setPaintProperty(layerId, key, options[key])
273
+ })
274
+ }
275
+ }
276
+
277
+ /**
278
+ * 设置图层的布局样式属性
279
+ * @param {LayerView} layerView 图层视图对象
280
+ * @param {String} layerId 图层ID
281
+ * @param {Object} options 要改变的样式对象
282
+ * */
283
+ function setLayoutProperties(layerView, layerId, options) {
284
+ // 获取地图视图对象
285
+ const innerView = layerView.innerView
286
+ // 图层要存在
287
+ if (innerView.getLayer(layerId) &amp;&amp; options instanceof Object) {
288
+ Object.keys(options).forEach((key) => {
289
+ innerView.setLayoutProperty(layerId, key, options[key])
290
+ })
291
+ }
292
+ }
293
+
294
+ /**
295
+ * 设置图层的过滤条件
296
+ * @param {IGSTileLayerView} layerView 图层视图对象
297
+ * @param {String} layerId 图层id
298
+ * @param {String} filter 过滤条件
299
+ * */
300
+ function setFilter(layerView, layerId, filter) {
301
+ // 获取地图视图对象
302
+ const innerView = layerView.innerView
303
+ // 设置过滤条件
304
+ if (innerView.getLayer(layerId)) {
305
+ innerView.setFilter(layerId, filter)
306
+ }
307
+ }
308
+
309
+ /**
310
+ * 设置图层显示范围
311
+ * @param {IGSTileLayerView} layerView 图层视图对象
312
+ * @param {String} layerId 图层id
313
+ * @param {Number} minZoom 最小显示范围
314
+ * @param {Number} maxZoom 最大显示范围
315
+ * */
316
+ function setLayerZoomRange(layerView, layerId, minZoom, maxZoom) {
317
+ // 获取地图视图对象
318
+ const innerView = layerView.innerView
319
+ // 设置显示范围
320
+ if (innerView.getLayer(layerId)) {
321
+ innerView.setLayerZoomRange(layerId, minZoom, maxZoom)
322
+ }
323
+ }
324
+
325
+ /**
326
+ * 添加矢量瓦片的Source
327
+ * @param {IGSTileLayerView} layerView 图层视图对象
328
+ * */
329
+ function addSources(layerView) {
330
+ // 添加矢量瓦片的Source
331
+ const sources = layerView.layer.style.sources
332
+ Object.keys(sources).forEach((key) => {
333
+ // 添加Source
334
+ layerView.innerView.addSource(
335
+ // SourceID
336
+ key,
337
+ // Source参数
338
+ sources[key]
339
+ )
340
+ })
341
+ }
342
+
343
+ /**
344
+ * 添加矢量瓦片的Layer
345
+ * @param {IGSTileLayerView} layerView 图层视图对象
346
+ */
347
+ function addLayers(layerView) {
348
+ // 添加矢量瓦片的Layer
349
+ const layers = layerView.layer.style.layers
350
+ for (let i = 0; i &lt; layers.length; i++) {
351
+ // 取图层可见性
352
+ const visible = layerView._getLayerViewVisible()
353
+ // 设置全图层可见性
354
+ if (layers[i] &amp;&amp; layers[i].layout &amp;&amp; layers[i].layout instanceof Object) {
355
+ layers[i].layout.visibility = visible ? 'visible' : 'none'
356
+ }
357
+ // 设置全图层透明度
358
+ if (layers[i] &amp;&amp; layers[i].paint &amp;&amp; layers[i].paint instanceof Object) {
359
+ // 根据mapbox图层类型设置透明度,可能有多个字段名
360
+ const _opacityKeys = []
361
+ switch (layers[i].type) {
362
+ case 'background':
363
+ _opacityKeys.push('background-opacity')
364
+ break
365
+ case 'fill':
366
+ default:
367
+ _opacityKeys.push('fill-opacity')
368
+ break
369
+ case 'line':
370
+ _opacityKeys.push('line-opacity')
371
+ break
372
+ case 'symbol':
373
+ _opacityKeys.push('icon-opacity')
374
+ _opacityKeys.push('text-opacity')
375
+ break
376
+ case 'circle':
377
+ _opacityKeys.push('circle-opacity')
378
+ break
379
+ case 'sky':
380
+ _opacityKeys.push('sky-opacity')
381
+ break
382
+ }
383
+ for (let j = 0; j &lt; _opacityKeys.length; j++) {
384
+ layers[i].paint[_opacityKeys[j]] = layerView.layer.opacity
385
+ }
386
+ }
387
+ layerView.innerView.addLayer(layers[i])
388
+ }
389
+ }
390
+
391
+ /**
392
+ * 获取矢量瓦片的所有子图层
393
+ * @param {IGSTileLayerView} layerView 图层视图对象
394
+ * @return {Array&lt;Object>} 矢量瓦片的子图层
395
+ * */
396
+ function getLayers(layerView) {
397
+ const layers = layerView.layer.style.layers
398
+ const subLayers = []
399
+ for (let i = 0; i &lt; layers.length; i++) {
400
+ subLayers.push(layerView.innerView.getLayer(layers[i].id))
401
+ }
402
+ return subLayers
403
+ }
404
+
405
+ /**
406
+ * 更新所有矢量瓦片子图层
407
+ * @param {IGSTileLayerView} layerView 图层视图对象
408
+ * */
409
+ function updateStyleLayer(layerView) {
410
+ // 先获取地图视图的样式
411
+ const mapStyle = layerView.innerView.getStyle()
412
+ // 真实的图层对象
413
+ const innerLayer = layerView.innerLayer
414
+ // 更新后的图层对象
415
+ const layers = layerView.layer.style.layers
416
+ // 获取改变前的第一个矢量瓦片子图层的位置
417
+ let beganIndex = undefined
418
+ for (let i = 0; i &lt; mapStyle.layers.length; i++) {
419
+ if (mapStyle.layers[i].id === innerLayer[0].id) {
420
+ beganIndex = i
421
+ break
422
+ }
423
+ }
424
+ // 获取改变前的最后一个矢量瓦片子图层的位置
425
+ let endIndex = undefined
426
+ for (let i = 0; i &lt; mapStyle.layers.length; i++) {
427
+ if (mapStyle.layers[i].id === innerLayer[innerLayer.length - 1].id) {
428
+ endIndex = i
429
+ break
430
+ }
431
+ }
432
+ // 截取之前的数组
433
+ const layersBefore = mapStyle.layers.slice(0, beganIndex)
434
+ // 截取之后的数组
435
+ const layersAfter = mapStyle.layers.slice(
436
+ endIndex,
437
+ mapStyle.layers.length - 1
438
+ )
439
+ // 开始替换数组
440
+ mapStyle.layers = layersBefore.concat(layers).concat(layersAfter)
441
+ // 强制更新地图视图
442
+ if (layerView.innerView._update) {
443
+ layerView.innerView._update()
444
+ } else if (layerView.innerView.update) {
445
+ layerView.innerView.update()
446
+ }
447
+ }
448
+
449
+ export {
450
+ setVisible,
451
+ removeLayer,
452
+ setOpacity,
453
+ getPaintOptions,
454
+ setPaintProperties,
455
+ setLayoutProperties,
456
+ setFilter,
457
+ setLayerZoomRange,
458
+ addSources,
459
+ addLayers,
460
+ getLayers,
461
+ updateStyleLayer
462
+ }
463
+ </code></pre>
464
+ </article>
465
+ </section>
466
+
467
+
468
+
469
+
470
+ </div>
471
+
472
+ <footer class="footer">
473
+ <div class="content has-text-centered">
474
+ <p>文档生成<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a></p>
475
+ <p class="sidebar-created-by">
476
+ <a href="http://www.smaryun.com" target="_blank">司马云</a> <span>© 2023 云生态圈</span>
477
+ <a href="http://192.168.82.89:8086/#/index" target="_blank">MapGIS Client for JavaScript</a>
478
+ </p>
479
+ </div>
480
+ </footer>
481
+
482
+ </div>
483
+ <div id="side-nav" class="side-nav">
484
+ <div style="margin-bottom: 10px;">
485
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#page-title">构造函数</a>
486
+ </div>
487
+ <div style="margin-bottom: 10px;">
488
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#member">成员变量</a>
489
+ </div>
490
+ <div style="margin-bottom: 10px;">
491
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#function">方法</a>
492
+ </div>
493
+ <div>
494
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#event">事件</a>
495
+ </div>
496
+ </div>
497
+ </div>
498
+ <script src="scripts/linenumber.js"> </script>
499
+
500
+ <script src="scripts/search.js"> </script>
501
+
502
+ </body>
503
+ </html>
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
- "name": "@mapgis/webclient-mapboxgl-plugin",
3
- "description": "",
4
- "version": "10.3.3",
5
- "keywords": [
6
- "MapGIS",
7
- "MapboxGL"
8
- ],
9
- "homepage": "https://github.com/MapGIS/WebClient-JavaScript",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/ParnDeedlit/WebClient-JavaScript-Plugin"
13
- },
14
- "author": "parndeedlit",
15
- "license": "Apache-2.0",
16
- "dependencies": {
17
- "echarts": "^4.2.0",
18
- "mapv": "^2.0.33",
19
- "mapbox-gl": "^0.52.0"
20
- }
21
- }
2
+ "name": "@mapgis/webclient-mapboxgl-plugin",
3
+ "version" : "17.0.0",
4
+ "description": "",
5
+ "main": "dist/webclient-mapboxgl-plugin-es6.min.js",
6
+ "scripts": {},
7
+ "keywords": [
8
+ "zondy",
9
+ "service",
10
+ "&",
11
+ "mapboxgl"
12
+ ],
13
+ "author": "Wuhan Zondy Cyber Science&Technology Co.Ltd.",
14
+ "license": "Apache-2.0",
15
+ "dependencies": {
16
+ "@mapgis/mapbox-gl": "^17.0.0",
17
+ "@mapgis/webclient-common": "^17.0.0"
18
+ },
19
+ "peerDependencies": {},
20
+ "devDependencies": {}
21
+ }
package/core/Base.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * WebClient mapboxgl基类
3
- * 定义命名空间
4
- */
5
- import mapboxgl from 'mapbox-gl';
6
-
7
- mapboxgl.zondy = mapboxgl.zondy || {};
package/core/index.js DELETED
@@ -1,5 +0,0 @@
1
- //由于新的addlayer(map, gl)新增gl参数,因此屏蔽过去的重写函数
2
- /* export {
3
- MapExtend
4
- }
5
- from './MapExtend'; */
package/index.js DELETED
@@ -1,6 +0,0 @@
1
- export * from './core/index.js'
2
- export * from './service/index.js'
3
- export * from './overlay/index.js'
4
-
5
-
6
-
@@ -1,108 +0,0 @@
1
- import mapboxgl from 'mapbox-gl';
2
- import * as d3 from 'd3';
3
-
4
- import '../core/Base';
5
-
6
- require("./dthree/mapbox-d3.css");
7
-
8
- export class D3Layer {
9
-
10
- constructor(map, drawCallback, options) {
11
- this.map = map;
12
- this._drawCallback = drawCallback;
13
- this.initD3();
14
- }
15
-
16
- initD3(){
17
- d3.select("head")
18
- .append("style").attr("type", "text/css")
19
- .text("g.d3-overlay *{pointer-events:visiblePainted;}");
20
- }
21
-
22
- bindMapEvent() {
23
- var svg = this._svg;
24
- var svgContainer = this.selection;
25
- var draw = this.draw;
26
- var proj = this.projection;
27
- var map = this.map;
28
- var d3layer = this;
29
- this.map.on("viewreset", function () {
30
- d3layer.draw(d3layer, svgContainer, proj, map);
31
- });
32
- this.map.on("movestart", function () {
33
- svgContainer.classed("mapboxd3-hidden", true);
34
- });
35
- this.map.on("rotate", function () {
36
- svgContainer.classed("mapboxd3-hidden", true);
37
- });
38
- this.map.on("moveend", function () {
39
- svgContainer.classed("mapboxd3-hidden", false);
40
- d3layer.draw(d3layer, svgContainer, proj, map);
41
- })
42
- }
43
-
44
- draw(thisLayer, selection, projection, map) {
45
- thisLayer._drawCallback(selection, projection, map.getZoom());
46
- }
47
-
48
- addTo(map) {
49
- this.onAdd(map);
50
- this.draw(this, this.selection, this.projection, this.map);
51
- this.bindMapEvent();
52
- }
53
-
54
- hide() {
55
- this.svg.classed("mapboxd3-hidden", true);
56
- }
57
-
58
- remove() {
59
- this.svg.classed("mapboxd3-hidden", true);
60
- this.svg = null;
61
- this.selection = null;
62
- }
63
-
64
- onAdd() {
65
- var _layermap = this.map;
66
- this._container = _layermap.getCanvasContainer();
67
- this._svg = d3.select(this._container).select("svg");
68
- this.selection = this._svg.append("g").classed("d3-overlay", true);;
69
-
70
- // Create projection object
71
- this.projection = {
72
- latLngToLayerPoint: function (longtitude, latitude, zoom) {
73
- zoom = _layermap.getZoom() ? _layermap.getZoom() : zoom;
74
- console.log("longtitude: " + longtitude + " latitude: " + latitude);
75
- var screenPoint = _layermap.project(new mapboxgl.LngLat(longtitude, latitude));
76
- console.log("screenPoint x: " + screenPoint.x + " y: " + screenPoint.y);
77
- return screenPoint;
78
- },
79
- layerPointToLatLng: function (point, zoom) {
80
- zoom = _layermap.getZoom() ? _layermap.getZoom() : zoom;
81
- var lnglat = _layermap.unproject(new mapboxgl.Point(point.x, point.y));
82
- return lnglat;
83
- },
84
- unitsPerMeter: 256 * Math.pow(2, _layermap.getZoom()) / 40075017,
85
- map: _layermap,
86
- scale: 1
87
- };
88
- this.projection._projectPoint = function (x, y) {
89
- if (y == null) {
90
- y = 0;
91
- }
92
- if (x == null) {
93
- x = 0;
94
- }
95
- var point = _layermap.project(new mapboxgl.LngLat(x, y));
96
- return this.stream.point(point.x, point.y);
97
- };
98
-
99
- var projectionPointRef = this.projection._projectPoint;
100
-
101
- this.projection.pathFromGeojson =
102
- d3.geoPath().projection(d3.geoTransform({
103
- point: projectionPointRef
104
- }));
105
- }
106
- }
107
-
108
- mapboxgl.zondy.d3Layer = D3Layer;