@mapgis/webclient-mapboxgl-plugin 17.0.6 → 17.2.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.
- package/README.md +11 -35
- package/dist/es5/webclient-common.min.js +15 -4
- package/dist/es5/webclient-mapboxgl-plugin.min.js +1 -1
- package/dist/webclient-mapboxgl-plugin-es6.min.js +1 -1
- package/documention/MapViewMapboxgl.html +1233 -8
- package/documention/Popup.html +3 -3
- package/documention/Screenshot.html +0 -11
- package/documention/SketchEditorMapboxgl.html +31 -2
- package/documention/index.html +4 -4
- package/documention/scripts/sideBar.js +16 -2
- package/package.json +3 -4
- package/documention/document_ArcGISVectorTileLayerView.js.html +0 -265
- package/documention/document_EchartsLayerView.js.html +0 -246
- package/documention/document_GraphicsLayerView.js.html +0 -314
- package/documention/document_IGSFeatureLayerView.js.html +0 -218
- package/documention/document_IGSMapImageLayerView.js.html +0 -240
- package/documention/document_IGSTileLayerView.js.html +0 -236
- package/documention/document_IGSVectorTileLayerView.js.html +0 -264
- package/documention/document_MapVLayerView.js.html +0 -247
- package/documention/document_WMSLayerView.js.html +0 -240
- package/documention/document_WMTSLayerView.js.html +0 -234
- package/documention/document_WebTileLayerView.js.html +0 -240
- package/documention/document_support_FeatureRenderView.js.html +0 -682
- package/documention/document_support_MapboxglGraphicsLayer.js.html +0 -1184
- package/documention/document_support_SourceMetaData.js.html +0 -223
- package/documention/document_support_Utils.js.html +0 -624
- package/documention/document_support_mapbox_mapboxCustomUtil.js.html +0 -322
- package/documention/sketchEditor_SketchEditorMapboxgl.js.html +0 -875
- package/documention/util_ConvertRendererToStyleLayerUtil.js.html +0 -844
- package/documention/util_MapboxglFeatureRender.js.html +0 -225
- package/documention/util_MapboxglPlugin.js.html +0 -284
- package/documention/view_MapViewMapboxgl.js.html +0 -1882
- package/documention/view_utils_ArcGISVectorTileLayerUtil.js.html +0 -382
- package/documention/view_utils_EchartsLayerUtil.js.html +0 -194
- package/documention/view_utils_IGSMapImageUtil.js.html +0 -373
- package/documention/view_utils_IGSTileLayerUtil.js.html +0 -285
- package/documention/view_utils_IGSVectorTileLayerUtil.js.html +0 -379
- package/documention/view_utils_MapVLayerUtil.js.html +0 -197
- package/documention/view_utils_Popup.js.html +0 -525
- package/documention/view_utils_Screenshot.js.html +0 -320
- package/documention/view_utils_WMSLayerUtil.js.html +0 -337
- package/documention/view_utils_WMTSLayerUtil.js.html +0 -331
- package/documention/view_utils_WebTileLayerUtil.js.html +0 -284
- package/documention/view_utils_echarts_EchartsLayerPlugin.js.html +0 -419
- package/documention/view_utils_mapV_MapVLayerPlugin.js.html +0 -527
- package/documention/view_utils_mapV_MapvBaseLayer.js.html +0 -477
- package/documention/view_utils_support_rasterLayerUtil.js.html +0 -244
- package/documention/view_utils_support_vectorLayerUtil.js.html +0 -503
|
@@ -1,527 +0,0 @@
|
|
|
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/mapV/MapVLayerPlugin.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 "@mapgis/webclient-leaflet-plugin" <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/mapV/MapVLayerPlugin.js</span>
|
|
125
|
-
</header>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<section>
|
|
132
|
-
<article>
|
|
133
|
-
<pre class="prettyprint source linenums"><code>import mapboxgl from '@mapgis/mapbox-gl'
|
|
134
|
-
import MapvBaseLayer from './MapvBaseLayer'
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @origin author kyle / http://nikai.us/
|
|
138
|
-
* @author 基础平台/创新中心 潘卓然 ParnDeedlit
|
|
139
|
-
* @class module:客户端可视化.MapvLayer
|
|
140
|
-
* @classdesc 基于mapboxgl的Layer对象进行的拓展
|
|
141
|
-
* @param map - {Object} 传入的mapboxgl的地图对象
|
|
142
|
-
* @param dataset - {MapvDataSet} 传入的mapv的属性。 <br>
|
|
143
|
-
* @param mapvoption - {MapvOption} 可选参数。<br>
|
|
144
|
-
* @see https://github.com/huiyan-fe/mapv/blob/master/API.md
|
|
145
|
-
* @example
|
|
146
|
-
* var options = {
|
|
147
|
-
size: 13,
|
|
148
|
-
gradient: {
|
|
149
|
-
0.25: "rgb(0,0,255)",
|
|
150
|
-
0.55: "rgb(0,255,0)",
|
|
151
|
-
0.85: "yellow",
|
|
152
|
-
1.0: "rgb(255,0,0)"
|
|
153
|
-
},
|
|
154
|
-
max: 60,
|
|
155
|
-
animation: {
|
|
156
|
-
type: 'time',
|
|
157
|
-
stepsRange: {
|
|
158
|
-
start: 0,
|
|
159
|
-
end: 100
|
|
160
|
-
},
|
|
161
|
-
trails: 10,
|
|
162
|
-
duration: 4,
|
|
163
|
-
},
|
|
164
|
-
draw: 'heatmap'
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
var mapvLayer = new mapboxgl.zondy.MapvLayer(map, dataSet, options);
|
|
168
|
-
*/
|
|
169
|
-
class MapvLayer {
|
|
170
|
-
constructor(map, dataSet, mapVOptions) {
|
|
171
|
-
this.map = map
|
|
172
|
-
this.layerID = mapVOptions.layerID
|
|
173
|
-
delete mapVOptions['layerID']
|
|
174
|
-
this.mapvBaseLayer = new MapvBaseLayer(map, dataSet, mapVOptions, this)
|
|
175
|
-
this.mapVOptions = mapVOptions
|
|
176
|
-
|
|
177
|
-
this.initDevicePixelRatio()
|
|
178
|
-
|
|
179
|
-
this.canvas = this._createCanvas()
|
|
180
|
-
|
|
181
|
-
this.render = this.render.bind(this)
|
|
182
|
-
|
|
183
|
-
this.bindEvent()
|
|
184
|
-
|
|
185
|
-
this.mapContainer = map.getCanvasContainer()
|
|
186
|
-
this.mapContainer.appendChild(this.canvas)
|
|
187
|
-
// this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
|
|
188
|
-
|
|
189
|
-
this._reset()
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
initDevicePixelRatio() {
|
|
193
|
-
this.devicePixelRatio = window.devicePixelRatio || 1
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// -----------------------------------Event Methods----------------------------------------
|
|
197
|
-
bindEvent() {
|
|
198
|
-
const map = this.map
|
|
199
|
-
// 下面几个是mapboxgl专属事件,clickEvent和mousemoveEvent是mapv内部自带的方法不放出来
|
|
200
|
-
this.innerMoveStart = this.moveStartEvent.bind(this)
|
|
201
|
-
this.innerMoveEnd = this.moveEndEvent.bind(this)
|
|
202
|
-
|
|
203
|
-
this.innnerZoomStart = this.zoomStartEvent.bind(this)
|
|
204
|
-
this.innnerZoomEnd = this.zoomEndEvent.bind(this)
|
|
205
|
-
|
|
206
|
-
this.innnerRotateStart = this.rotateStartEvent.bind(this)
|
|
207
|
-
this.innnerRotateEnd = this.rotateEndEvent.bind(this)
|
|
208
|
-
|
|
209
|
-
this.innerResize = this.resizeEvent.bind(this)
|
|
210
|
-
|
|
211
|
-
this.innerRemove = this.removeEvent.bind(this)
|
|
212
|
-
|
|
213
|
-
map.on('resize', this.innerResize)
|
|
214
|
-
|
|
215
|
-
map.on('zoomstart', this.innnerZoomStart)
|
|
216
|
-
map.on('zoomend', this.innnerZoomEnd)
|
|
217
|
-
|
|
218
|
-
map.on('rotatestart', this.innnerRotateStart)
|
|
219
|
-
map.on('rotateend', this.innnerRotateEnd)
|
|
220
|
-
|
|
221
|
-
map.on('movestart', this.innerMoveStart)
|
|
222
|
-
map.on('moveend', this.innerMoveEnd)
|
|
223
|
-
|
|
224
|
-
this.map.on('remove', this.innerRemove)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
unbindEvent() {
|
|
228
|
-
const map = this.map
|
|
229
|
-
map.off('resize', this.innerResize)
|
|
230
|
-
|
|
231
|
-
map.off('zoomstart', this.innnerZoomStart)
|
|
232
|
-
map.off('zoomend', this.innnerZoomEnd)
|
|
233
|
-
|
|
234
|
-
map.off('rotatestart', this.innnerRotateStart)
|
|
235
|
-
map.off('rotateend', this.innnerRotateEnd)
|
|
236
|
-
|
|
237
|
-
map.off('movestart', this.innerMoveStart)
|
|
238
|
-
map.off('moveend', this.innerMoveEnd)
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
moveStartEvent() {
|
|
242
|
-
this.mapvBaseLayer.animatorMovestartEvent()
|
|
243
|
-
this._unvisiable()
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
moveEndEvent() {
|
|
247
|
-
this.mapvBaseLayer.animatorMoveendEvent()
|
|
248
|
-
this._reset()
|
|
249
|
-
this._visiable()
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
zoomStartEvent() {
|
|
253
|
-
this._unvisiable()
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
zoomEndEvent() {
|
|
257
|
-
this._unvisiable()
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
rotateStartEvent() {
|
|
261
|
-
this.mapvBaseLayer.animatorMovestartEvent()
|
|
262
|
-
this._unvisiable()
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
rotateEndEvent() {
|
|
266
|
-
this.mapvBaseLayer.animatorMoveendEvent()
|
|
267
|
-
this._reset()
|
|
268
|
-
this._visiable()
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
resizeEvent() {
|
|
272
|
-
this._reset()
|
|
273
|
-
this._visiable()
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
removeEvent() {
|
|
277
|
-
this.mapContainer.removeChild(this.canvas)
|
|
278
|
-
}
|
|
279
|
-
// -----------------------------------Event Methods----------------------------------------
|
|
280
|
-
|
|
281
|
-
// -----------------------------------Start Data Operation---------------------------------
|
|
282
|
-
/**
|
|
283
|
-
* 增加数据
|
|
284
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.addData
|
|
285
|
-
*
|
|
286
|
-
* @param data - {Array} 数据.
|
|
287
|
-
* @param options - {Object} 只做额外增加的字段作用
|
|
288
|
-
*/
|
|
289
|
-
addData(data, options) {
|
|
290
|
-
this.mapvBaseLayer.addData(data, options)
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* 更新数据
|
|
295
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.updateData
|
|
296
|
-
*
|
|
297
|
-
* @param data - {Array} 数据.
|
|
298
|
-
* @param options - {Object} 只做额外增加的字段作用
|
|
299
|
-
*/
|
|
300
|
-
updateData(data, options) {
|
|
301
|
-
this.mapvBaseLayer.updateData(data, options)
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
getData() {
|
|
305
|
-
if (this.mapvBaseLayer) {
|
|
306
|
-
this.dataSet = this.mapvBaseLayer.getData()
|
|
307
|
-
}
|
|
308
|
-
return this.dataSet
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.removeData
|
|
313
|
-
* @param filter - {Function} 过滤函数,返回true的保留
|
|
314
|
-
* @description 移除满足过滤条件的数据
|
|
315
|
-
* @example
|
|
316
|
-
* filter: function(item){
|
|
317
|
-
if (item.count > 10 && item.count < 50) {
|
|
318
|
-
return true;
|
|
319
|
-
} else {
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
*/
|
|
324
|
-
removeData(filter) {
|
|
325
|
-
this.mapvBaseLayer && this.mapvBaseLayer.removeData(filter)
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.removeAllData
|
|
330
|
-
* @description 移除全部数据
|
|
331
|
-
*/
|
|
332
|
-
removeAllData() {
|
|
333
|
-
this.mapvBaseLayer.clearData()
|
|
334
|
-
}
|
|
335
|
-
// -----------------------------------End Data Operation---------------------------------
|
|
336
|
-
|
|
337
|
-
_visiable() {
|
|
338
|
-
this.canvas.style.display = 'block'
|
|
339
|
-
return this
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
_unvisiable() {
|
|
343
|
-
this.canvas.style.display = 'none'
|
|
344
|
-
return this
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
_createCanvas() {
|
|
348
|
-
const canvas = document.createElement('canvas')
|
|
349
|
-
const devicePixelRatio = this.devicePixelRatio
|
|
350
|
-
canvas.id = this.layerID
|
|
351
|
-
canvas.style.position = 'absolute'
|
|
352
|
-
canvas.style.top = '0px'
|
|
353
|
-
canvas.style.left = '0px'
|
|
354
|
-
canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio
|
|
355
|
-
canvas.height =
|
|
356
|
-
parseInt(this.map.getCanvas().style.height) * devicePixelRatio
|
|
357
|
-
if (!this.mapVOptions.context || this.mapVOptions.context == '2d') {
|
|
358
|
-
canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio)
|
|
359
|
-
}
|
|
360
|
-
canvas.style.width = this.map.getCanvas().style.width
|
|
361
|
-
canvas.style.height = this.map.getCanvas().style.height
|
|
362
|
-
return canvas
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
_reset() {
|
|
366
|
-
if (this.canvas == null) {
|
|
367
|
-
return
|
|
368
|
-
}
|
|
369
|
-
this.resizeCanvas()
|
|
370
|
-
this.fixPosition()
|
|
371
|
-
this.onResize()
|
|
372
|
-
this.render()
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
draw() {
|
|
376
|
-
return this._reset()
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* 显示图层
|
|
381
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.show
|
|
382
|
-
*/
|
|
383
|
-
show() {
|
|
384
|
-
this._visiable()
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* 隐藏图层
|
|
389
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.hide
|
|
390
|
-
*/
|
|
391
|
-
hide() {
|
|
392
|
-
this._unvisiable()
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* 更新图层
|
|
397
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.update
|
|
398
|
-
* @param opt.data - {Array} 需要更新的数据
|
|
399
|
-
* @param opt.options - {Object} 需要更新的样式
|
|
400
|
-
*/
|
|
401
|
-
update(opt) {
|
|
402
|
-
if (opt == undefined) {
|
|
403
|
-
return
|
|
404
|
-
}
|
|
405
|
-
this.updateData(opt.data, opt.options)
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
resizeCanvas() {
|
|
409
|
-
this.mapContainer.style.perspective = `${this.map.transform.cameraToCenterDistance}px`
|
|
410
|
-
if (this.canvas == undefined || this.canvas == null) return
|
|
411
|
-
const canvas = this.canvas
|
|
412
|
-
const devicePixelRatio = this.devicePixelRatio
|
|
413
|
-
canvas.style.position = 'absolute'
|
|
414
|
-
canvas.style.top = '0px'
|
|
415
|
-
canvas.style.left = '0px'
|
|
416
|
-
canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio
|
|
417
|
-
canvas.height =
|
|
418
|
-
parseInt(this.map.getCanvas().style.height) * devicePixelRatio
|
|
419
|
-
// canvas.style.width = this.map.getCanvas().style.width;
|
|
420
|
-
// canvas.style.height = this.map.getCanvas().style.height;
|
|
421
|
-
if (!this.mapVOptions.context || this.mapVOptions.context == '2d') {
|
|
422
|
-
canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio)
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
fixPosition() {}
|
|
427
|
-
|
|
428
|
-
onResize() {}
|
|
429
|
-
|
|
430
|
-
originPosition() {
|
|
431
|
-
this.originPitch = this.map.getPitch()
|
|
432
|
-
this.originBearing = this.map.getBearing()
|
|
433
|
-
const origin = this.map.project(new mapboxgl.LngLat(0, 0))
|
|
434
|
-
this.originX = origin.x
|
|
435
|
-
this.originY = origin.y
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
render() {
|
|
439
|
-
if (this.mapvBaseLayer == undefined) return
|
|
440
|
-
this.mapvBaseLayer._canvasUpdate()
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
moveTo(layerID, before) {
|
|
444
|
-
const layer = document.getElementById(this.layerID)
|
|
445
|
-
before = before !== undefined ? before : true
|
|
446
|
-
if (before) {
|
|
447
|
-
const beforeLayer = document.getElementById(layerID)
|
|
448
|
-
if (layer && beforeLayer) {
|
|
449
|
-
beforeLayer.parentNode.insertBefore(layer, beforeLayer)
|
|
450
|
-
}
|
|
451
|
-
return
|
|
452
|
-
}
|
|
453
|
-
const nextLayer = document.getElementById(layerID)
|
|
454
|
-
if (layer) {
|
|
455
|
-
if (nextLayer.nextSibling) {
|
|
456
|
-
nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling)
|
|
457
|
-
return
|
|
458
|
-
}
|
|
459
|
-
nextLayer.parentNode.appendChild(layer)
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* 移除图层,清空所有的事件与数据,与destroy效果一致,保持接口与mapboxgl本身一致
|
|
465
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.remove
|
|
466
|
-
*/
|
|
467
|
-
remove() {
|
|
468
|
-
this.removeAllData()
|
|
469
|
-
this.unbindEvent()
|
|
470
|
-
this.mapContainer.removeChild(this.canvas)
|
|
471
|
-
this.disposeFlag = true
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* 销毁图层,清空所有的事件与数据,与remove效果一致
|
|
476
|
-
* @function mapboxgl.zondy.MapvLayer.prototype.destroy
|
|
477
|
-
*/
|
|
478
|
-
destroy() {
|
|
479
|
-
this.removeAllData()
|
|
480
|
-
this.unbindEvent()
|
|
481
|
-
this.mapContainer.removeChild(this.canvas)
|
|
482
|
-
this.disposeFlag = true
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export default MapvLayer
|
|
487
|
-
</code></pre>
|
|
488
|
-
</article>
|
|
489
|
-
</section>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
</div>
|
|
495
|
-
|
|
496
|
-
<footer class="footer">
|
|
497
|
-
<div class="content has-text-centered">
|
|
498
|
-
<p>文档生成<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a></p>
|
|
499
|
-
<p class="sidebar-created-by">
|
|
500
|
-
<a href="http://www.smaryun.com" target="_blank">司马云</a> <span>© 2023 云生态圈</span>
|
|
501
|
-
<a href="http://192.168.82.89:8086/#/index" target="_blank">MapGIS Client for JavaScript</a>
|
|
502
|
-
</p>
|
|
503
|
-
</div>
|
|
504
|
-
</footer>
|
|
505
|
-
|
|
506
|
-
</div>
|
|
507
|
-
<div id="side-nav" class="side-nav">
|
|
508
|
-
<div style="margin-bottom: 10px;">
|
|
509
|
-
<img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#page-title">构造函数</a>
|
|
510
|
-
</div>
|
|
511
|
-
<div style="margin-bottom: 10px;">
|
|
512
|
-
<img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#member">成员变量</a>
|
|
513
|
-
</div>
|
|
514
|
-
<div style="margin-bottom: 10px;">
|
|
515
|
-
<img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#function">方法</a>
|
|
516
|
-
</div>
|
|
517
|
-
<div>
|
|
518
|
-
<img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#event">事件</a>
|
|
519
|
-
</div>
|
|
520
|
-
</div>
|
|
521
|
-
</div>
|
|
522
|
-
<script src="scripts/linenumber.js"> </script>
|
|
523
|
-
|
|
524
|
-
<script src="scripts/search.js"> </script>
|
|
525
|
-
|
|
526
|
-
</body>
|
|
527
|
-
</html>
|