@mapgis/webclient-leaflet-plugin 17.2.8 → 17.4.1

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 (46) hide show
  1. package/README.md +24 -2
  2. package/dist/es5/webclient-common.min.js +37 -5
  3. package/dist/es5/webclient-leaflet-plugin.min.js +1 -1
  4. package/dist/webclient-leaflet-plugin-es6.min.js +4 -4
  5. package/documention/ArcGISMapImageLayer.html +197 -122
  6. package/documention/ArcGISTileLayer.html +187 -62
  7. package/documention/EchartsLayer.html +189 -21
  8. package/documention/FeatureLayer.html +178 -8
  9. package/documention/FeatureLayerUtil.html +178 -34
  10. package/documention/IGSMapImageLayer.html +201 -146
  11. package/documention/IGSTileLayer.html +191 -86
  12. package/documention/L.zondy.MapvBaseLayer.html +189 -96
  13. package/documention/MapLayer.html +183 -38
  14. package/documention/MapVLayer.html +191 -33
  15. package/documention/MapView.html +6189 -0
  16. package/documention/MapViewLeaflet.html +366 -1410
  17. package/documention/Popup.html +200 -284
  18. package/documention/Screenshot.html +183 -134
  19. package/documention/SketchEditor.html +3211 -0
  20. package/documention/SketchEditorLeaflet.html +241 -477
  21. package/documention/TileLayer.html +182 -32
  22. package/documention/TileLayerWMS.html +180 -20
  23. package/documention/VectorTileLayer.html +188 -68
  24. package/documention/WMSLayerView.html +190 -121
  25. package/documention/WebMapServiceLayer.html +194 -104
  26. package/documention/WebMapTileServiceLayer.html +195 -110
  27. package/documention/WebTileLayer.html +192 -92
  28. package/documention/Zondy.ThemeLayer.GeoFeatureThemeLayer.html +290 -658
  29. package/documention/Zondy.ThemeLayer.GraphThemeLayer.html +324 -870
  30. package/documention/Zondy.ThemeLayer.RandomThemeLayer.html +305 -736
  31. package/documention/Zondy.ThemeLayer.ThemeLayer.html +247 -483
  32. package/documention/Zondy.ThemeLayer.ThemeStyle.html +234 -866
  33. package/documention/Zondy.ThemeLayer.rangeThemeLayer.html +304 -792
  34. package/documention/Zondy.ThemeLayer.rankSymbolThemeLayer.html +341 -941
  35. package/documention/Zondy.ThemeLayer.simpleThemeLayer.html +302 -720
  36. package/documention/Zondy.ThemeLayer.uniqueThemeLayer.html +299 -759
  37. package/documention/Zondy.Widget.html +185 -48
  38. package/documention/Zondy.view.UI.html +182 -31
  39. package/documention/global.html +11448 -131
  40. package/documention/index.html +15 -16
  41. package/documention/scripts/search.js +1 -26
  42. package/documention/styles/app.min.css +1 -1
  43. package/documention/tutorial-1./345/277/253/351/200/237/345/205/245/351/227/250.html +152 -7
  44. package/documention/tutorial-2.1M3D/350/246/201/347/264/240/351/200/211/345/217/226.html +153 -8
  45. package/documention/tutorial-2.2M3D/351/222/273/345/255/224/345/211/226/345/210/207.html +153 -8
  46. package/package.json +7 -8
@@ -0,0 +1,3211 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+
6
+ <meta charset="utf-8">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <title> SketchEditor</title>
9
+ <!--[if lt IE 9]>
10
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
+ <![endif]-->
12
+ <link type="text/css" rel="stylesheet" href="styles/app.min.css">
13
+ <link type="text/css" rel="stylesheet" href="styles/iframe.css">
14
+ <link type="text/css" rel="stylesheet" href="">
15
+
16
+
17
+ </head>
18
+
19
+
20
+
21
+ <body class="layout small-header">
22
+ <div id="stickyNavbarOverlay"></div>
23
+
24
+
25
+ <div class="top-nav">
26
+ <div class="inner">
27
+ <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
28
+ <span aria-hidden="true"></span>
29
+ <span aria-hidden="true"></span>
30
+ <span aria-hidden="true"></span>
31
+ </a>
32
+ <div class="logo">
33
+
34
+ <h1> MapGIS Client for JavaScript API</h1>
35
+
36
+
37
+ </div>
38
+ <div class="menu">
39
+
40
+ <div class="navigation">
41
+
42
+
43
+ <a
44
+ class="link user-link "
45
+ href="/static/modules/common/api/common-mapgis/index.html"
46
+ >
47
+ Common
48
+ </a>
49
+
50
+ <a
51
+ class="link user-link "
52
+ href="/static/modules/cesium/api/cesium-mapgis/index.html"
53
+ >
54
+ Cesium-Plugin
55
+ </a>
56
+
57
+ <a
58
+ class="link user-link "
59
+ href="/static/modules/mapboxgl/api/mapboxgl-mapgis/index.html"
60
+ >
61
+ MapboxGL-Plugin
62
+ </a>
63
+
64
+ <a
65
+ class="link user-link "
66
+ href="/static/modules/leaflet/api/leaflet-mapgis/index.html"
67
+ >
68
+ Leaflet-Plugin
69
+ </a>
70
+
71
+ <a
72
+ class="link user-link "
73
+ href="/static/modules/openlayers/api/openLayers-mapgis/index.html"
74
+ >
75
+ OpenLayers-Plugin
76
+ </a>
77
+
78
+ <a
79
+ class="link user-link "
80
+ href="/static/modules/video/api/video-mapgis/index.html"
81
+ >
82
+ Video-Plugin
83
+ </a>
84
+
85
+
86
+
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+
92
+ <div id="main">
93
+ <div
94
+ class="sidebar "
95
+ id="sidebarNav"
96
+ >
97
+ <div>
98
+ <span class="mapgis-api-document-span"><a href="index.html">API文档</a></span>
99
+ </div>
100
+
101
+ <div class="search-wrapper">
102
+ <input id="search" type="text" placeholder="搜索文档..." class="input">
103
+ </div>
104
+
105
+ <nav>
106
+
107
+ <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="">扩展模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="ArcGISMapImageLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="ArcGISMapImageLayer.html">ArcGISMapImageLayer</a><span style="display: none;"><p>ArcGIS地图图片图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="ArcGISTileLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="ArcGISTileLayer.html">ArcGISTileLayer</a><span style="display: none;"><p>ArcGIS瓦片图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="EchartsLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="EchartsLayer.html">EchartsLayer</a><span style="display: none;"><p>Echarts图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="FeatureLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="FeatureLayer.html">FeatureLayer</a><span style="display: none;"><p>要素图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="IGSMapImageLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="IGSMapImageLayer.html">IGSMapImageLayer</a><span style="display: none;"><p>地图图片图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="IGSTileLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="IGSTileLayer.html">IGSTileLayer</a><span style="display: none;"><p>IGS瓦片图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="MapLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="MapLayer.html">MapLayer</a><span style="display: none;"><p>屏幕出一张图图层基类</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="MapVLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="MapVLayer.html">MapVLayer</a><span style="display: none;"><p>MapV图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="TileLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="TileLayer.html">TileLayer</a><span style="display: none;"><p>带裁剪功能的瓦片图层基类</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="TileLayerWMS"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="TileLayerWMS.html">TileLayerWMS</a><span style="display: none;"><p>WMS图层基类(相比于原生的L.TileLayer.WMS, 此图层支持空间裁剪功能)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="VectorTileLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="VectorTileLayer.html">VectorTileLayer</a><span style="display: none;"><p>矢量瓦片图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="WebMapServiceLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="WebMapServiceLayer.html">WebMapServiceLayer</a><span style="display: none;"><p>WMS图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="WebMapTileServiceLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="WebMapTileServiceLayer.html">WebMapTileServiceLayer</a><span style="display: none;"><p>WMTS图层(Leaflet)</p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="WebTileLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="WebTileLayer.html">WebTileLayer</a><span style="display: none;"><p>网络瓦片图层(Leaflet)</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 style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="FeatureLayerUtil"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="FeatureLayerUtil.html">FeatureLayerUtil</a><span style="display: none;"><p>要素图层工具类(Leaflet)</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 style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="MapView"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="MapView.html">MapView</a><span style="display: none;"><p>二维场景视图(leaflet引擎),对地图引擎进行管理,如果要对地图图层进行管理请参考<code>Map</code>,<br/>
108
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/MapView.html' target='_blank'>zondy.MapView</a><br/>
109
+ 参考示例:
110
+ <a href='#MapView'>[初始化二维场景视图]</a>
111
+ <br>[ES5引入方式]:<br/>
112
+ zondy.leaflet.MapView() <br/>
113
+ [ES6引入方式]:<br/>
114
+ import { MapView } from '@mapgis/webclient-leaflet-plugin' <br/></p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="Popup"><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引擎)
115
+ 参考示例:
116
+ <a href='#MapView'>[初始化二维场景视图]</a>
117
+ [ES6引入方式]:<br/>
118
+ import { Popup } from '@mapgis/webclient-leaflet-plugin' <br/>
119
+ 自定义样式说明:<br/>
120
+ zondy-popup__content 弹窗容器样式<br/>
121
+ zondy-popup__tip 弹窗对话框箭头样式<br/>
122
+ zondy-popup__header 弹窗头部样式<br/>
123
+ zondy-popup__content 弹窗主体样式<br/>
124
+ zondy-popup__footer 弹窗底部样式<br/></p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="Screenshot"><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 style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="SketchEditor"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="SketchEditor.html">SketchEditor</a><span style="display: none;"><p>二维Leaflet引擎草图编辑类<br/>
125
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/SketchEditor.html' target='_blank'>zondy.SketchEditor</a><br/>
126
+ <br>[ES5引入方式]:<br/>
127
+ const { SketchEditor } = zondy.leaflet.tool.sketch <br/>
128
+ [ES6引入方式]:<br/>
129
+ import { SketchEditor } from &quot;@mapgis/webclient-leaflet-plugin&quot; <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="">渲染器模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="zondy.themelayer.GraphThemeLayer"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="zondy.themelayer.GraphThemeLayer.html">GraphThemeLayer</a><span style="display: none;"><p>统计专题图通过为每个要素绘制统计图表来反映其对应的专题值的大小。它可同时表示多个字段属性信息,在区域本身与各区域之间形成横向和纵向的对比。<br>统计专题图多用于具有相关数量特征的地图上,比如表示不同地区多年的粮食产量、GDP、人口等,不同时段客运量、地铁流量等。目前提供的统计图类型有:柱状图(Bar),折线图(Line),饼图(Pie),三维柱状图(Bar3D),点状图(Point),环状图(Ring)。</p></span></li></ul></div>
130
+
131
+ </nav>
132
+ </div>
133
+ <div class="core" id="main-content-wrapper">
134
+ <div class="content">
135
+ <header id="page-title" class="page-title">
136
+ <span class="page-title-main">类名</span>
137
+ <span class="page-title-sub">SketchEditor</span>
138
+ </header>
139
+
140
+
141
+
142
+
143
+
144
+ <section>
145
+
146
+ <article>
147
+ <div class="container-overview">
148
+
149
+
150
+ <div class='vertical-section'>
151
+ <div class="members">
152
+ <div class="member">
153
+
154
+
155
+
156
+
157
+ <h4 class="name" id="SketchEditor">
158
+ <a class="href-link" href="#SketchEditor">#</a>
159
+
160
+ <span class="code-name" style="font-size:30px">
161
+
162
+ new SketchEditor<span class="signature">(options)</span>
163
+
164
+ </span>
165
+ </h4>
166
+
167
+
168
+
169
+ <div class="description">
170
+ <p>二维Leaflet引擎草图编辑类<br/>
171
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/SketchEditor.html' target='_blank'>zondy.SketchEditor</a><br/>
172
+ <br>[ES5引入方式]:<br/>
173
+ const { SketchEditor } = zondy.leaflet.tool.sketch <br/>
174
+ [ES6引入方式]:<br/>
175
+ import { SketchEditor } from &quot;@mapgis/webclient-leaflet-plugin&quot; <br/></p>
176
+ </div>
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <h4>参数:</h4>
188
+
189
+ <div class="table-container">
190
+ <table class="params table">
191
+ <thead>
192
+ <tr>
193
+
194
+ <th>名称</th>
195
+
196
+
197
+ <th>类型</th>
198
+
199
+
200
+
201
+ <th class="last">描述</th>
202
+ </tr>
203
+ </thead>
204
+
205
+ <tbody>
206
+
207
+
208
+
209
+ <tr class="deep-level-0">
210
+
211
+ <td class="name"><code>options</code></td>
212
+
213
+
214
+ <td class="type">
215
+
216
+
217
+ <span class="param-type">Object</span>
218
+
219
+
220
+
221
+ </td>
222
+
223
+
224
+
225
+ <td class="description last"><p>构造参数</p></td>
226
+ </tr>
227
+
228
+
229
+
230
+
231
+ <tr class="deep-level-1">
232
+
233
+ <td class="name"><code>view</code></td>
234
+
235
+
236
+ <td class="type">
237
+
238
+
239
+ <span class="param-type"><a href="MapView.html">MapView</a></span>
240
+ |
241
+
242
+ <span class="param-type">SceneView</span>
243
+
244
+
245
+
246
+ </td>
247
+
248
+
249
+
250
+ <td class="description last"><p>地图视图对象</p></td>
251
+ </tr>
252
+
253
+
254
+
255
+
256
+ <tr class="deep-level-1">
257
+
258
+ <td class="name"><code>layer</code></td>
259
+
260
+
261
+ <td class="type">
262
+
263
+
264
+ <span class="param-type">GraphicsLayer</span>
265
+
266
+
267
+
268
+ </td>
269
+
270
+
271
+
272
+ <td class="description last"><p>草图图层管对象</p></td>
273
+ </tr>
274
+
275
+
276
+
277
+
278
+ <tr class="deep-level-1">
279
+
280
+ <td class="name"><code>sketchStyle</code></td>
281
+
282
+
283
+ <td class="type">
284
+
285
+
286
+ <span class="param-type">SketchStyle</span>
287
+
288
+
289
+
290
+ </td>
291
+
292
+
293
+
294
+ <td class="description last"><p>草图符号</p></td>
295
+ </tr>
296
+
297
+
298
+
299
+
300
+ <tr class="deep-level-1">
301
+
302
+ <td class="name"><code>snapOption</code></td>
303
+
304
+
305
+ <td class="type">
306
+
307
+
308
+ <span class="param-type">Object</span>
309
+
310
+
311
+
312
+ </td>
313
+
314
+
315
+
316
+ <td class="description last"><p>草图捕获配置项</p></td>
317
+ </tr>
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+ </tbody>
326
+ </table>
327
+ </div>
328
+
329
+
330
+
331
+
332
+
333
+
334
+ <dl class="details">
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+ </dl>
367
+
368
+
369
+
370
+
371
+
372
+ <div class="method-parameter columns">
373
+ <div class="column is-2"><label>绑定事件:</label></div>
374
+ <div class="column is-10">
375
+ <ul>
376
+ <li>SketchEditor#event:草图绘制完成事件</li>
377
+
378
+ <li>SketchEditor#event:草图被选中事件</li>
379
+ </ul>
380
+ </div>
381
+ </div>
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+ <p class="summary"><h5>支持如下方法:</h5>
400
+ <a href='#start'>[1、开始绘制草图]</a><br/>
401
+ <a href='#stop'>[2、停止绘制]</a><br/>
402
+ <a href='#remove'>[3、移除当前草图]</a><br/>
403
+ <a href='#addVertex'>[4、向草线或面草图中插入新的顶点]</a><br/>
404
+ <a href='#updateVertex'>[5、更新草图图形的某个顶点]</a><br/>
405
+ <a href='#removeVertex'>[6、移除草图图形的某个顶点]</a><br/>
406
+ <a href='#getSketchDataType'>[7、获取草图图形类型]</a><br/>
407
+ <a href='#setSketchStyle'>[8、设置草图样式]</a><br/>
408
+ <a href='#getSketchStyle'>[9、获取草图样式]</a><br/>
409
+ <a href='#getGeometry'>[10、获取草图几何对象]</a><br/>
410
+ <a href='#union'>[11、合并多个区几何]</a><br/>
411
+ <a href='#split'>[12、分割草图对象或区几何对象]</a><br/>
412
+ <a href='#undo'>[13、撤销当前编辑操作]</a><br/>
413
+ <a href='#redo'>[14、恢复被撤销的草图]</a><br/>
414
+ <a href='#drawPolylineToPolygon'>[15、拓扑线造区]</a><br/></p>
415
+
416
+
417
+
418
+ <h5>示例</h5>
419
+
420
+ <p class="code-caption"><h7>初始化一个二维场景草图编辑类</h7></p>
421
+
422
+
423
+ <pre class="prettyprint"><code>// [ES5引入方式]:
424
+ const { Color } = zondy
425
+ const { SketchDataType } = zondy.enum
426
+ const { SimpleMarkerSymbol } = zondy.symbol
427
+ const { SketchStyle } = zondy.tool.sketch
428
+ const { MapView } = zondy.leaflet
429
+ const { SketchEditor } = zondy.leaflet.tool.sketch
430
+ [ES6引入方式]:
431
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
432
+ import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" &lt;br/>
433
+ var map = new Map()
434
+ var mapView = new MapView({
435
+ viewId: "mapgis-2d-viewer",
436
+ map: map,
437
+ })
438
+ var simpleMarkerSymbol = new SimpleMarkerSymbol({
439
+ color: new Color(24, 144, 255, 1),
440
+ size: 10,
441
+ });
442
+ var sketchStyle = new SketchStyle({
443
+ vertexStyle: simpleMarkerSymbol,
444
+ lineStyle: undefined,
445
+ fillStyle: undefined
446
+ })
447
+ var sketchEditor = new SketchEditor({
448
+ view: mapView,
449
+ layer: new GraphicsLayer(),
450
+ vertexStyle: vertexStyle
451
+ })
452
+ sketchEditor.start(SketchDataType.POINT) // 绘制点
453
+ sketchEditor.start(SketchDataType.POLYLINE) // 绘制线
454
+ sketchEditor.start(SketchDataType.POLYGON) // 绘制区
455
+ *</code></pre>
456
+
457
+
458
+
459
+
460
+ </div>
461
+ </div>
462
+ </div>
463
+
464
+
465
+ </div>
466
+
467
+
468
+ <h3 class="subsection-title">继承关系</h3>
469
+
470
+
471
+
472
+
473
+ <ul>
474
+ <li>zondy.SketchEditor</li>
475
+ </ul>
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+ <div class='vertical-section'>
494
+ <h3 id='function'>方法</h3>
495
+ <div class="members">
496
+
497
+ <div class="member">
498
+
499
+
500
+
501
+ <h4 class="name" id="addVertex">
502
+ <a class="href-link" href="#addVertex">#</a>
503
+
504
+ <span class="code-name" style="font-size:30px">
505
+
506
+ addVertex<span class="signature">(point, index)</span>
507
+
508
+ </span>
509
+ </h4>
510
+
511
+
512
+
513
+ <div class="description">
514
+ <p>向当前线或区草图中插入新的顶点<a id='addVertex'></a></p>
515
+ </div>
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+ <h4>参数:</h4>
527
+
528
+ <div class="table-container">
529
+ <table class="params table">
530
+ <thead>
531
+ <tr>
532
+
533
+ <th>名称</th>
534
+
535
+
536
+ <th>类型</th>
537
+
538
+
539
+
540
+ <th class="last">描述</th>
541
+ </tr>
542
+ </thead>
543
+
544
+ <tbody>
545
+
546
+
547
+
548
+ <tr class="deep-level-0">
549
+
550
+ <td class="name"><code>point</code></td>
551
+
552
+
553
+ <td class="type">
554
+
555
+
556
+ <span class="param-type">Point</span>
557
+
558
+
559
+
560
+ </td>
561
+
562
+
563
+
564
+ <td class="description last"><p>新增/插入顶点</p></td>
565
+ </tr>
566
+
567
+
568
+
569
+
570
+
571
+
572
+ <tr class="deep-level-0">
573
+
574
+ <td class="name"><code>index</code></td>
575
+
576
+
577
+ <td class="type">
578
+
579
+
580
+ <span class="param-type">Number</span>
581
+
582
+
583
+
584
+ </td>
585
+
586
+
587
+
588
+ <td class="description last"><p>新增/新增点的序号</p></td>
589
+ </tr>
590
+
591
+
592
+
593
+
594
+ </tbody>
595
+ </table>
596
+ </div>
597
+
598
+
599
+
600
+
601
+
602
+
603
+ <dl class="details">
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+ </dl>
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+ </div>
660
+
661
+ <div class="member">
662
+
663
+
664
+
665
+ <h4 class="name" id="canRedo">
666
+ <a class="href-link" href="#canRedo">#</a>
667
+
668
+ <span class="code-name" style="font-size:30px">
669
+
670
+ canRedo<span class="signature">()</span>
671
+
672
+ </span>
673
+ </h4>
674
+
675
+
676
+
677
+ <div class="description">
678
+ <p>草图是否可执行恢复操作<a id='canRedo'></a></p>
679
+ </div>
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+ <dl class="details">
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+ </dl>
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+ <div class='columns method-parameter'>
746
+ <div class="column is-2"><label>返回值:</label></div>
747
+ <div class="column is-10">
748
+
749
+
750
+
751
+ <div class="columns">
752
+
753
+
754
+ <div class='column is-5 has-text-left'>
755
+ <label>类型: </label>
756
+
757
+ <span class="param-type">Boolean</span>
758
+
759
+
760
+ </div>
761
+
762
+ </div>
763
+
764
+
765
+ </div>
766
+ </div>
767
+
768
+
769
+
770
+
771
+
772
+
773
+ </div>
774
+
775
+ <div class="member">
776
+
777
+
778
+
779
+ <h4 class="name" id="canUndo">
780
+ <a class="href-link" href="#canUndo">#</a>
781
+
782
+ <span class="code-name" style="font-size:30px">
783
+
784
+ canUndo<span class="signature">()</span>
785
+
786
+ </span>
787
+ </h4>
788
+
789
+
790
+
791
+ <div class="description">
792
+ <p>草图是否可执行撤销操作<a id='canUndo'></a></p>
793
+ </div>
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+ <dl class="details">
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+ </dl>
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+
856
+
857
+
858
+
859
+ <div class='columns method-parameter'>
860
+ <div class="column is-2"><label>返回值:</label></div>
861
+ <div class="column is-10">
862
+
863
+
864
+
865
+ <div class="columns">
866
+
867
+
868
+ <div class='column is-5 has-text-left'>
869
+ <label>类型: </label>
870
+
871
+ <span class="param-type">Boolean</span>
872
+
873
+
874
+ </div>
875
+
876
+ </div>
877
+
878
+
879
+ </div>
880
+ </div>
881
+
882
+
883
+
884
+
885
+
886
+
887
+ </div>
888
+
889
+ <div class="member">
890
+
891
+
892
+
893
+ <h4 class="name" id="drawPolylineToPolygon">
894
+ <a class="href-link" href="#drawPolylineToPolygon">#</a>
895
+
896
+ <span class="code-name" style="font-size:30px">
897
+
898
+ drawPolylineToPolygon<span class="signature">(snapAndReferGeometries)</span>
899
+
900
+ </span>
901
+ </h4>
902
+
903
+
904
+
905
+ <div class="description">
906
+ <p>线拓扑造区<a id='drawPolylineToPolygon'></a></p>
907
+ </div>
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+ <h4>参数:</h4>
919
+
920
+ <div class="table-container">
921
+ <table class="params table">
922
+ <thead>
923
+ <tr>
924
+
925
+ <th>名称</th>
926
+
927
+
928
+ <th>类型</th>
929
+
930
+
931
+
932
+ <th class="last">描述</th>
933
+ </tr>
934
+ </thead>
935
+
936
+ <tbody>
937
+
938
+
939
+
940
+ <tr class="deep-level-0">
941
+
942
+ <td class="name"><code>snapAndReferGeometries</code></td>
943
+
944
+
945
+ <td class="type">
946
+
947
+
948
+ <span class="param-type">Array.&lt;Polygon></span>
949
+
950
+
951
+
952
+ </td>
953
+
954
+
955
+
956
+ <td class="description last"><p>捕获参考几何对象数组</p></td>
957
+ </tr>
958
+
959
+
960
+
961
+
962
+ </tbody>
963
+ </table>
964
+ </div>
965
+
966
+
967
+
968
+
969
+
970
+
971
+ <dl class="details">
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+ </dl>
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+ <h5>示例</h5>
1028
+
1029
+ <p class="code-caption"><h7>二维草图线拓扑造区</h7></p>
1030
+
1031
+
1032
+ <pre class="prettyprint"><code>// [ES5引入方式]:
1033
+ const { Polygon, LineString } = zondy.geometry
1034
+ const { MapView } = zondy.leaflet
1035
+ const { SketchEditor } = zondy.leaflet.tool.sketch
1036
+ [ES6引入方式]:
1037
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
1038
+ import { Polygon, LineString } from "@mapgis/webclient-common" &lt;br/>
1039
+ var map = new Map()
1040
+ var mapView = new MapView({
1041
+ viewId: "mapgis-2d-viewer",
1042
+ map: map,
1043
+ })
1044
+ var testGeometries = [
1045
+ new Polygon({
1046
+ coordinates: [
1047
+ [
1048
+ [114.0, 29.0],
1049
+ [117.0, 29.0],
1050
+ [117.0, 35.0],
1051
+ [114.0, 35.0],
1052
+ [114.0, 29.0]
1053
+ ]
1054
+ ]
1055
+ }),
1056
+ new Polygon({
1057
+ coordinates: [
1058
+ [
1059
+ [113.0, 29.0],
1060
+ [116.0, 29.0],
1061
+ [116.0, 35.0],
1062
+ [113.0, 35.0],
1063
+ [113.0, 29.0]
1064
+ ]
1065
+ ]
1066
+ })
1067
+ ]
1068
+ testFeatures = [
1069
+ new Feature({
1070
+ id: '11114',
1071
+ geometry: this.testGeometries[0],
1072
+ symbol: new SimpleFillSymbol({
1073
+ color: new Color(0, 255, 255, 0.5),
1074
+ outline: new SimpleLineSymbol({
1075
+ color: new Color(0, 255, 255, 0.8),
1076
+ width: 2
1077
+ })
1078
+ })
1079
+ }),
1080
+ new Feature({
1081
+ id: '11115',
1082
+ geometry: this.testGeometries[1],
1083
+ symbol: new SimpleFillSymbol({
1084
+ color: new Color(0, 255, 255, 0.5),
1085
+ outline: new SimpleLineSymbol({
1086
+ color: new Color(0, 255, 255, 0.8),
1087
+ width: 2
1088
+ })
1089
+ })
1090
+ }),
1091
+ ]
1092
+ var testLayer = new GraphicsLayer({
1093
+ graphics: this.testFeatures
1094
+ })
1095
+ map.add(testLayer)
1096
+ var sketchEditor = new SketchEditor({
1097
+ view: mapView,
1098
+ layer: new GraphicsLayer()
1099
+ })
1100
+ sketchEditor.drawPolylineToPolygon(testGeometries)</code></pre>
1101
+
1102
+
1103
+
1104
+ </div>
1105
+
1106
+ <div class="member">
1107
+
1108
+
1109
+
1110
+ <h4 class="name" id="getGeometry">
1111
+ <a class="href-link" href="#getGeometry">#</a>
1112
+
1113
+ <span class="code-name" style="font-size:30px">
1114
+
1115
+ getGeometry<span class="signature">()</span>
1116
+
1117
+ </span>
1118
+ </h4>
1119
+
1120
+
1121
+
1122
+ <div class="description">
1123
+ <p>获取草图几何对象<a id='getGeometry'></a></p>
1124
+ </div>
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+ <dl class="details">
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+ </dl>
1172
+
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+ <div class='columns method-parameter'>
1191
+ <div class="column is-2"><label>返回值:</label></div>
1192
+ <div class="column is-10">
1193
+
1194
+
1195
+
1196
+ <div class="columns">
1197
+
1198
+
1199
+ <div class='column is-5 has-text-left'>
1200
+ <label>类型: </label>
1201
+
1202
+ <span class="param-type">Geometry</span>
1203
+
1204
+
1205
+ </div>
1206
+
1207
+ </div>
1208
+
1209
+
1210
+ </div>
1211
+ </div>
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+
1218
+ </div>
1219
+
1220
+ <div class="member">
1221
+
1222
+
1223
+
1224
+ <h4 class="name" id="getSketchStyle">
1225
+ <a class="href-link" href="#getSketchStyle">#</a>
1226
+
1227
+ <span class="code-name" style="font-size:30px">
1228
+
1229
+ getSketchStyle<span class="signature">()</span>
1230
+
1231
+ </span>
1232
+ </h4>
1233
+
1234
+
1235
+
1236
+ <div class="description">
1237
+ <p>获取草图样式<a id='getSketchStyle'></a></p>
1238
+ </div>
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+ <dl class="details">
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+ </dl>
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+ <div class='columns method-parameter'>
1305
+ <div class="column is-2"><label>返回值:</label></div>
1306
+ <div class="column is-10">
1307
+
1308
+
1309
+
1310
+ <div class="columns">
1311
+
1312
+
1313
+ <div class='column is-5 has-text-left'>
1314
+ <label>类型: </label>
1315
+
1316
+ <span class="param-type">SketchStyle</span>
1317
+
1318
+
1319
+ </div>
1320
+
1321
+ </div>
1322
+
1323
+
1324
+ </div>
1325
+ </div>
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1332
+ </div>
1333
+
1334
+ <div class="member">
1335
+
1336
+
1337
+
1338
+ <h4 class="name" id="redo">
1339
+ <a class="href-link" href="#redo">#</a>
1340
+
1341
+ <span class="code-name" style="font-size:30px">
1342
+
1343
+ redo<span class="signature">()</span>
1344
+
1345
+ </span>
1346
+ </h4>
1347
+
1348
+
1349
+
1350
+ <div class="description">
1351
+ <p>恢复被撤销的草图<a id='redo'></a></p>
1352
+ </div>
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+ <dl class="details">
1368
+
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+ </dl>
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+ <div class='columns method-parameter'>
1419
+ <div class="column is-2"><label>返回值:</label></div>
1420
+ <div class="column is-10">
1421
+
1422
+
1423
+
1424
+ <div class="columns">
1425
+
1426
+
1427
+ <div class='column is-5 has-text-left'>
1428
+ <label>类型: </label>
1429
+
1430
+ <span class="param-type">Geometry</span>
1431
+
1432
+
1433
+ </div>
1434
+
1435
+ </div>
1436
+
1437
+
1438
+ </div>
1439
+ </div>
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+
1446
+ <h5>示例</h5>
1447
+
1448
+ <p class="code-caption"><h7>二维草图几何分割</h7></p>
1449
+
1450
+
1451
+ <pre class="prettyprint"><code>// [ES5引入方式]:
1452
+ const { Polygon, LineString } = zondy.geometry
1453
+ const { SketchDataType } = zondy.enum
1454
+ const { MapView } = zondy.leaflet
1455
+ const { SketchEditor } = zondy.leaflet.tool.sketch
1456
+ [ES6引入方式]:
1457
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
1458
+ import { Polygon, LineString, SketchDataType } from "@mapgis/webclient-common" &lt;br/>
1459
+ var map = new Map()
1460
+ var mapView = new MapView({
1461
+ viewId: "mapgis-2d-viewer",
1462
+ map: map,
1463
+ })
1464
+ var sketchEditor = new SketchEditor({
1465
+ view: mapView,
1466
+ layer: new GraphicsLayer()
1467
+ })
1468
+ sketchEditor.start(SketchDataType.POLYGON)
1469
+ console.log("是否可以进行恢复操作:" + sketchEditor.canRedo())
1470
+ const geometry = sketchEditor.redo()
1471
+ console.log("恢复后的几何对象" + geometry)</code></pre>
1472
+
1473
+
1474
+
1475
+ </div>
1476
+
1477
+ <div class="member">
1478
+
1479
+
1480
+
1481
+ <h4 class="name" id="remove">
1482
+ <a class="href-link" href="#remove">#</a>
1483
+
1484
+ <span class="code-name" style="font-size:30px">
1485
+
1486
+ remove<span class="signature">()</span>
1487
+
1488
+ </span>
1489
+ </h4>
1490
+
1491
+
1492
+
1493
+ <div class="description">
1494
+ <p>移除当前草图<a id='remove'></a></p>
1495
+ </div>
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+ <dl class="details">
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+
1522
+
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+ </dl>
1543
+
1544
+
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+
1551
+
1552
+
1553
+
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+
1565
+
1566
+ </div>
1567
+
1568
+ <div class="member">
1569
+
1570
+
1571
+
1572
+ <h4 class="name" id="removeVertex">
1573
+ <a class="href-link" href="#removeVertex">#</a>
1574
+
1575
+ <span class="code-name" style="font-size:30px">
1576
+
1577
+ removeVertex<span class="signature">(index)</span>
1578
+
1579
+ </span>
1580
+ </h4>
1581
+
1582
+
1583
+
1584
+ <div class="description">
1585
+ <p>移除草图图形的某个顶点<a id='removeVertex'></a></p>
1586
+ </div>
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+
1593
+
1594
+
1595
+
1596
+
1597
+ <h4>参数:</h4>
1598
+
1599
+ <div class="table-container">
1600
+ <table class="params table">
1601
+ <thead>
1602
+ <tr>
1603
+
1604
+ <th>名称</th>
1605
+
1606
+
1607
+ <th>类型</th>
1608
+
1609
+
1610
+
1611
+ <th class="last">描述</th>
1612
+ </tr>
1613
+ </thead>
1614
+
1615
+ <tbody>
1616
+
1617
+
1618
+
1619
+ <tr class="deep-level-0">
1620
+
1621
+ <td class="name"><code>index</code></td>
1622
+
1623
+
1624
+ <td class="type">
1625
+
1626
+
1627
+ <span class="param-type">Number</span>
1628
+
1629
+
1630
+
1631
+ </td>
1632
+
1633
+
1634
+
1635
+ <td class="description last"><p>需更新的顶点的序号</p></td>
1636
+ </tr>
1637
+
1638
+
1639
+
1640
+
1641
+ </tbody>
1642
+ </table>
1643
+ </div>
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+ <dl class="details">
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+
1680
+
1681
+
1682
+ </dl>
1683
+
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+
1690
+
1691
+
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+ </div>
1707
+
1708
+ <div class="member">
1709
+
1710
+
1711
+
1712
+ <h4 class="name" id="setSketchStyle">
1713
+ <a class="href-link" href="#setSketchStyle">#</a>
1714
+
1715
+ <span class="code-name" style="font-size:30px">
1716
+
1717
+ setSketchStyle<span class="signature">(sketchStyle)</span>
1718
+
1719
+ </span>
1720
+ </h4>
1721
+
1722
+
1723
+
1724
+ <div class="description">
1725
+ <p>设置草图样式<a id='setSketchStyle'></a></p>
1726
+ </div>
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+
1733
+
1734
+
1735
+
1736
+
1737
+ <h4>参数:</h4>
1738
+
1739
+ <div class="table-container">
1740
+ <table class="params table">
1741
+ <thead>
1742
+ <tr>
1743
+
1744
+ <th>名称</th>
1745
+
1746
+
1747
+ <th>类型</th>
1748
+
1749
+
1750
+
1751
+ <th class="last">描述</th>
1752
+ </tr>
1753
+ </thead>
1754
+
1755
+ <tbody>
1756
+
1757
+
1758
+
1759
+ <tr class="deep-level-0">
1760
+
1761
+ <td class="name"><code>sketchStyle</code></td>
1762
+
1763
+
1764
+ <td class="type">
1765
+
1766
+
1767
+ <span class="param-type">SketchStyle</span>
1768
+
1769
+
1770
+
1771
+ </td>
1772
+
1773
+
1774
+
1775
+ <td class="description last"></td>
1776
+ </tr>
1777
+
1778
+
1779
+
1780
+
1781
+ </tbody>
1782
+ </table>
1783
+ </div>
1784
+
1785
+
1786
+
1787
+
1788
+
1789
+
1790
+ <dl class="details">
1791
+
1792
+
1793
+
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+
1816
+
1817
+
1818
+
1819
+
1820
+
1821
+
1822
+ </dl>
1823
+
1824
+
1825
+
1826
+
1827
+
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+
1838
+
1839
+
1840
+
1841
+
1842
+
1843
+
1844
+
1845
+
1846
+ <h5>示例</h5>
1847
+
1848
+
1849
+ <pre class="prettyprint"><code>// ES5引入方式
1850
+ const { SimpleMarkerSymbol, SimpleFillSymbol, SimpleLineSymbol } = zondy.Symbol
1851
+ const { Map, Color } = zondy
1852
+ const { MapView } = zondy.leaflet
1853
+ const { SketchStyle } = zondy.tool.sketch
1854
+ const { SketchEditor } = zondy.leaflet.tool.sketch
1855
+ const { SketchDataType } = zondy.Enum
1856
+ // ES6引入方式
1857
+ import { Map, SimpleMarkerSymbol, SimpleFillSymbol, SimpleLineSymbol, Color, SketchStyle, SketchDataType } from "@mapgis/webclient-common"
1858
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
1859
+ var map = new Map()
1860
+ var mapView = new MapView({
1861
+ viewId: "mapgis-2d-viewer",
1862
+ map: map,
1863
+ })
1864
+ // 新建一个填充样式
1865
+ var fillStyle = new SimpleFillSymbol({
1866
+ color: new Color(0, 255, 255, 1),
1867
+ outline: new SimpleLineSymbol({
1868
+ color: new Color(255, 0, 0, 1),
1869
+ width: 2
1870
+ })
1871
+ })
1872
+ // 新建一个草图样式
1873
+ var sketchStyle = new SketchStyle({
1874
+ vertexStyle: new SimpleMarkerSymbol({
1875
+ color: new Color(0, 255, 255, 1),
1876
+ size: 10,
1877
+ outline: new SimpleLineSymbol({
1878
+ color: new Color(255, 255, 255, 1),
1879
+ width: 3
1880
+ })
1881
+ }),
1882
+ lineStyle: new SimpleLineSymbol({
1883
+ color: new Color(0, 255, 255, 0.8),
1884
+ width: 3
1885
+ }),
1886
+ fillStyle: new SimpleFillSymbol({
1887
+ color: new Color(0, 255, 255, 0.5),
1888
+ outline: new SimpleLineSymbol({
1889
+ color: new Color(0, 255, 255, 0.8),
1890
+ width: 2
1891
+ })
1892
+ }),
1893
+ selectBoxStyle: new SimpleFillSymbol({
1894
+ color: new Color(122, 22, 255, 0.5),
1895
+ outline: new SimpleLineSymbol({
1896
+ color: new Color(122, 22, 255, 0.8),
1897
+ width: 1
1898
+ })
1899
+ }),
1900
+ selectVertexStyle: new SimpleMarkerSymbol({
1901
+ color: new Color(122, 22, 255, 1),
1902
+ size: 12,
1903
+ outline: new SimpleLineSymbol({
1904
+ color: new Color(255, 255, 255, 1),
1905
+ width: 1
1906
+ })
1907
+ }),
1908
+ selectVertexStyle: new SimpleMarkerSymbol({
1909
+ color: new Color(0, 188, 0, 1),
1910
+ size: 11,
1911
+ outline: new SimpleLineSymbol({
1912
+ color: new Color(255, 255, 255, 1),
1913
+ width: 1
1914
+ })
1915
+ }),
1916
+ selectMidVertexStyle: new SimpleMarkerSymbol({
1917
+ color: new Color(0, 0, 255, 1),
1918
+ size: 8,
1919
+ outline: new SimpleLineSymbol({
1920
+ color: new Color(255, 255, 255, 1),
1921
+ width: 1
1922
+ })
1923
+ })
1924
+ })
1925
+ var sketchEditor = new SketchEditor({
1926
+ view: mapView,
1927
+ layer: graphicsLayer,
1928
+ })
1929
+ sketchEditor.setSketchStyle(sketchStyle)
1930
+ sketchEditor.start(SketchDataType.POLYGON)</code></pre>
1931
+
1932
+
1933
+
1934
+ </div>
1935
+
1936
+ <div class="member">
1937
+
1938
+
1939
+
1940
+ <h4 class="name" id="split">
1941
+ <a class="href-link" href="#split">#</a>
1942
+
1943
+ <span class="code-name" style="font-size:30px">
1944
+
1945
+ split<span class="signature">(target, splitPolyline)</span>
1946
+
1947
+ </span>
1948
+ </h4>
1949
+
1950
+
1951
+
1952
+ <div class="description">
1953
+ <p>分割草图对象或区几何对象<a id='split'></a></p>
1954
+ </div>
1955
+
1956
+
1957
+
1958
+
1959
+
1960
+
1961
+
1962
+
1963
+
1964
+
1965
+ <h4>参数:</h4>
1966
+
1967
+ <div class="table-container">
1968
+ <table class="params table">
1969
+ <thead>
1970
+ <tr>
1971
+
1972
+ <th>名称</th>
1973
+
1974
+
1975
+ <th>类型</th>
1976
+
1977
+
1978
+
1979
+ <th class="last">描述</th>
1980
+ </tr>
1981
+ </thead>
1982
+
1983
+ <tbody>
1984
+
1985
+
1986
+
1987
+ <tr class="deep-level-0">
1988
+
1989
+ <td class="name"><code>target</code></td>
1990
+
1991
+
1992
+ <td class="type">
1993
+
1994
+
1995
+ <span class="param-type">Polygon</span>
1996
+ |
1997
+
1998
+ <span class="param-type"><a href="SketchEditor.html">SketchEditor</a></span>
1999
+
2000
+
2001
+
2002
+ </td>
2003
+
2004
+
2005
+
2006
+ <td class="description last"><p>被分割的几何/草图对象</p></td>
2007
+ </tr>
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+ <tr class="deep-level-0">
2015
+
2016
+ <td class="name"><code>splitPolyline</code></td>
2017
+
2018
+
2019
+ <td class="type">
2020
+
2021
+
2022
+ <span class="param-type">Polyline</span>
2023
+
2024
+
2025
+
2026
+ </td>
2027
+
2028
+
2029
+
2030
+ <td class="description last"><p>线几何对象</p></td>
2031
+ </tr>
2032
+
2033
+
2034
+
2035
+
2036
+ </tbody>
2037
+ </table>
2038
+ </div>
2039
+
2040
+
2041
+
2042
+
2043
+
2044
+
2045
+ <dl class="details">
2046
+
2047
+
2048
+
2049
+
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+
2061
+
2062
+
2063
+
2064
+
2065
+
2066
+
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+
2077
+ </dl>
2078
+
2079
+
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+
2087
+
2088
+
2089
+
2090
+
2091
+
2092
+
2093
+
2094
+
2095
+
2096
+ <div class='columns method-parameter'>
2097
+ <div class="column is-2"><label>返回值:</label></div>
2098
+ <div class="column is-10">
2099
+
2100
+
2101
+
2102
+ <div class="columns">
2103
+
2104
+ <div class='param-desc column is-7'><p>分割后的几何对象</p></div>
2105
+
2106
+
2107
+ <div class='column is-5 has-text-left'>
2108
+ <label>类型: </label>
2109
+
2110
+ <span class="param-type">Array.&lt;Polygon></span>
2111
+
2112
+
2113
+ </div>
2114
+
2115
+ </div>
2116
+
2117
+
2118
+ </div>
2119
+ </div>
2120
+
2121
+
2122
+
2123
+
2124
+
2125
+
2126
+ <h5>示例</h5>
2127
+
2128
+ <p class="code-caption"><h7>二维草图几何分割</h7></p>
2129
+
2130
+
2131
+ <pre class="prettyprint"><code>// [ES5引入方式]:
2132
+ const { Polygon, LineString } = zondy.geometry
2133
+ const { MapView } = zondy.leaflet
2134
+ const { SketchEditor } = zondy.leaflet.tool.sketch
2135
+ [ES6引入方式]:
2136
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
2137
+ import { Polygon, LineString } from "@mapgis/webclient-common" &lt;br/>
2138
+ var map = new Map()
2139
+ var mapView = new MapView({
2140
+ viewId: "mapgis-2d-viewer",
2141
+ map: map,
2142
+ })
2143
+ var sketchEditor = new SketchEditor({
2144
+ view: mapView,
2145
+ layer: new GraphicsLayer()
2146
+ })
2147
+ const polygon = new Polygon({
2148
+ coordinates: [
2149
+ [
2150
+ [108, 29],
2151
+ [116, 29],
2152
+ [116, 33],
2153
+ [108, 33],
2154
+ [108, 29]
2155
+ ]
2156
+ ]
2157
+ })
2158
+ const polyline = new LineString({
2159
+ coordinates: [
2160
+ [100, 30],
2161
+ [120, 30]
2162
+ ]
2163
+ })
2164
+ const newSketchEditors = SketchEditor.split(polygon,polyline)</code></pre>
2165
+
2166
+
2167
+
2168
+ </div>
2169
+
2170
+ <div class="member">
2171
+
2172
+
2173
+
2174
+ <h4 class="name" id="start">
2175
+ <a class="href-link" href="#start">#</a>
2176
+
2177
+ <span class="code-name" style="font-size:30px">
2178
+
2179
+ start<span class="signature">(dataType, extensionOptions)</span>
2180
+
2181
+ </span>
2182
+ </h4>
2183
+
2184
+
2185
+
2186
+ <div class="description">
2187
+ <p>开始绘制草图<a id='start'></a></p>
2188
+ </div>
2189
+
2190
+
2191
+
2192
+
2193
+
2194
+
2195
+
2196
+
2197
+
2198
+
2199
+ <h4>参数:</h4>
2200
+
2201
+ <div class="table-container">
2202
+ <table class="params table">
2203
+ <thead>
2204
+ <tr>
2205
+
2206
+ <th>名称</th>
2207
+
2208
+
2209
+ <th>类型</th>
2210
+
2211
+
2212
+
2213
+ <th class="last">描述</th>
2214
+ </tr>
2215
+ </thead>
2216
+
2217
+ <tbody>
2218
+
2219
+
2220
+
2221
+ <tr class="deep-level-0">
2222
+
2223
+ <td class="name"><code>dataType</code></td>
2224
+
2225
+
2226
+ <td class="type">
2227
+
2228
+
2229
+ <span class="param-type">SketchDataType</span>
2230
+
2231
+
2232
+
2233
+ </td>
2234
+
2235
+
2236
+
2237
+ <td class="description last"><p>草图编辑类型</p></td>
2238
+ </tr>
2239
+
2240
+
2241
+
2242
+
2243
+
2244
+
2245
+ <tr class="deep-level-0">
2246
+
2247
+ <td class="name"><code>extensionOptions</code></td>
2248
+
2249
+
2250
+ <td class="type">
2251
+
2252
+
2253
+ <span class="param-type">Object</span>
2254
+
2255
+
2256
+
2257
+ </td>
2258
+
2259
+
2260
+
2261
+ <td class="description last"><p>草图编辑的扩展属性,可以通过该属性传入草图编辑额外需要的参数</p></td>
2262
+ </tr>
2263
+
2264
+
2265
+
2266
+
2267
+ </tbody>
2268
+ </table>
2269
+ </div>
2270
+
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+ <dl class="details">
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+
2284
+
2285
+
2286
+
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+
2307
+
2308
+ </dl>
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+ <h5>示例</h5>
2333
+
2334
+ <p class="code-caption"><h7>初始化一个二维场景草图编辑类</h7></p>
2335
+
2336
+
2337
+ <pre class="prettyprint"><code>// [ES5引入方式]:
2338
+ const { Color } = zondy
2339
+ const { SketchDataType } = zondy.enum
2340
+ const { SimpleMarkerSymbol } = zondy.symbol
2341
+ const { SketchStyle } = zondy.tool.sketch
2342
+ const { MapView } = zondy.leaflet
2343
+ const { SketchEditor } = zondy.leaflet.tool.sketch
2344
+ [ES6引入方式]:
2345
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
2346
+ import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" &lt;br/>
2347
+ var map = new Map()
2348
+ var mapView = new MapView({
2349
+ viewId: "mapgis-2d-viewer",
2350
+ map: map,
2351
+ })
2352
+ var simpleMarkerSymbol = new SimpleMarkerSymbol({
2353
+ color: new Color(24, 144, 255, 1),
2354
+ size: 10,
2355
+ });
2356
+ var sketchStyle = new SketchStyle({
2357
+ vertexStyle: simpleMarkerSymbol,
2358
+ lineStyle: undefined,
2359
+ fillStyle: undefined
2360
+ })
2361
+ var sketchEditor = new SketchEditor({
2362
+ view: mapView,
2363
+ layer: new GraphicsLayer(),
2364
+ vertexStyle: vertexStyle
2365
+ })
2366
+ sketchEditor.start(SketchDataType.POINT) // 绘制点
2367
+ sketchEditor.start(SketchDataType.POLYLINE) // 绘制线
2368
+ sketchEditor.start(SketchDataType.POLYGON) // 绘制区</code></pre>
2369
+
2370
+
2371
+
2372
+ </div>
2373
+
2374
+ <div class="member">
2375
+
2376
+
2377
+
2378
+ <h4 class="name" id="startCustomDrawTool">
2379
+ <a class="href-link" href="#startCustomDrawTool">#</a>
2380
+
2381
+ <span class="code-name" style="font-size:30px">
2382
+
2383
+ startCustomDrawTool<span class="signature">(dataType)</span>
2384
+
2385
+ </span>
2386
+ </h4>
2387
+
2388
+
2389
+
2390
+ <div class="description">
2391
+ <p>开始绘制草图<a id='start'></a></p>
2392
+ </div>
2393
+
2394
+
2395
+
2396
+
2397
+
2398
+
2399
+
2400
+
2401
+
2402
+
2403
+ <h4>参数:</h4>
2404
+
2405
+ <div class="table-container">
2406
+ <table class="params table">
2407
+ <thead>
2408
+ <tr>
2409
+
2410
+ <th>名称</th>
2411
+
2412
+
2413
+ <th>类型</th>
2414
+
2415
+
2416
+
2417
+ <th class="last">描述</th>
2418
+ </tr>
2419
+ </thead>
2420
+
2421
+ <tbody>
2422
+
2423
+
2424
+
2425
+ <tr class="deep-level-0">
2426
+
2427
+ <td class="name"><code>dataType</code></td>
2428
+
2429
+
2430
+ <td class="type">
2431
+
2432
+
2433
+ <span class="param-type">SketchDataType</span>
2434
+
2435
+
2436
+
2437
+ </td>
2438
+
2439
+
2440
+
2441
+ <td class="description last"><p>草图编辑类型</p></td>
2442
+ </tr>
2443
+
2444
+
2445
+
2446
+
2447
+ </tbody>
2448
+ </table>
2449
+ </div>
2450
+
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+ <dl class="details">
2457
+
2458
+
2459
+
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+
2476
+
2477
+
2478
+
2479
+
2480
+
2481
+
2482
+
2483
+
2484
+
2485
+
2486
+
2487
+
2488
+ </dl>
2489
+
2490
+
2491
+
2492
+
2493
+
2494
+
2495
+
2496
+
2497
+
2498
+
2499
+
2500
+
2501
+
2502
+
2503
+
2504
+
2505
+
2506
+
2507
+
2508
+
2509
+
2510
+
2511
+
2512
+ <h5>示例</h5>
2513
+
2514
+ <p class="code-caption"><h7>初始化一个二维场景草图编辑类</h7></p>
2515
+
2516
+
2517
+ <pre class="prettyprint"><code>// [ES5引入方式]:
2518
+ const { Color } = zondy
2519
+ const { SketchDataType } = zondy.enum
2520
+ const { SimpleMarkerSymbol } = zondy.symbol
2521
+ const { SketchStyle } = zondy.tool.sketch
2522
+ const { MapView } = zondy.leaflet
2523
+ const { SketchEditor } = zondy.leaflet.tool.sketch
2524
+ [ES6引入方式]:
2525
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
2526
+ import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" &lt;br/>
2527
+ import SketchEllipseDrawTool from "./SketchEllipseDrawTool" &lt;br/>
2528
+ var map = new Map()
2529
+ var mapView = new MapView({
2530
+ viewId: "mapgis-2d-viewer",
2531
+ map: map,
2532
+ })
2533
+ var simpleMarkerSymbol = new SimpleMarkerSymbol({
2534
+ color: new Color(24, 144, 255, 1),
2535
+ size: 10,
2536
+ });
2537
+ var sketchStyle = new SketchStyle({
2538
+ vertexStyle: simpleMarkerSymbol,
2539
+ lineStyle: undefined,
2540
+ fillStyle: undefined
2541
+ })
2542
+ var sketchEditor = new SketchEditor({
2543
+ view: mapView,
2544
+ layer: new GraphicsLayer(),
2545
+ vertexStyle: vertexStyle
2546
+ })
2547
+ sketchEditor.startCustomDrawTool(SketchEllipseDrawTool, "ellipse") // 绘制椭圆</code></pre>
2548
+
2549
+
2550
+
2551
+ </div>
2552
+
2553
+ <div class="member">
2554
+
2555
+
2556
+
2557
+ <h4 class="name" id="stop">
2558
+ <a class="href-link" href="#stop">#</a>
2559
+
2560
+ <span class="code-name" style="font-size:30px">
2561
+
2562
+ stop<span class="signature">()</span>
2563
+
2564
+ </span>
2565
+ </h4>
2566
+
2567
+
2568
+
2569
+ <div class="description">
2570
+ <p>停止绘制<a id='stop'></a></p>
2571
+ </div>
2572
+
2573
+
2574
+
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+
2584
+
2585
+
2586
+ <dl class="details">
2587
+
2588
+
2589
+
2590
+
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+
2602
+
2603
+
2604
+
2605
+
2606
+
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+
2618
+ </dl>
2619
+
2620
+
2621
+
2622
+
2623
+
2624
+
2625
+
2626
+
2627
+
2628
+
2629
+
2630
+
2631
+
2632
+
2633
+
2634
+
2635
+
2636
+
2637
+
2638
+
2639
+
2640
+
2641
+
2642
+ </div>
2643
+
2644
+ <div class="member">
2645
+
2646
+
2647
+
2648
+ <h4 class="name" id="undo">
2649
+ <a class="href-link" href="#undo">#</a>
2650
+
2651
+ <span class="code-name" style="font-size:30px">
2652
+
2653
+ undo<span class="signature">()</span>
2654
+
2655
+ </span>
2656
+ </h4>
2657
+
2658
+
2659
+
2660
+ <div class="description">
2661
+ <p>撤销当前编辑操作<a id='undo'></a></p>
2662
+ </div>
2663
+
2664
+
2665
+
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+
2673
+
2674
+
2675
+
2676
+
2677
+ <dl class="details">
2678
+
2679
+
2680
+
2681
+
2682
+
2683
+
2684
+
2685
+
2686
+
2687
+
2688
+
2689
+
2690
+
2691
+
2692
+
2693
+
2694
+
2695
+
2696
+
2697
+
2698
+
2699
+
2700
+
2701
+
2702
+
2703
+
2704
+
2705
+
2706
+
2707
+
2708
+
2709
+ </dl>
2710
+
2711
+
2712
+
2713
+
2714
+
2715
+
2716
+
2717
+
2718
+
2719
+
2720
+
2721
+
2722
+
2723
+
2724
+
2725
+
2726
+
2727
+
2728
+ <div class='columns method-parameter'>
2729
+ <div class="column is-2"><label>返回值:</label></div>
2730
+ <div class="column is-10">
2731
+
2732
+
2733
+
2734
+ <div class="columns">
2735
+
2736
+
2737
+ <div class='column is-5 has-text-left'>
2738
+ <label>类型: </label>
2739
+
2740
+ <span class="param-type">Geometry</span>
2741
+
2742
+
2743
+ </div>
2744
+
2745
+ </div>
2746
+
2747
+
2748
+ </div>
2749
+ </div>
2750
+
2751
+
2752
+
2753
+
2754
+
2755
+
2756
+ <h5>示例</h5>
2757
+
2758
+ <p class="code-caption"><h7>二维草图几何分割</h7></p>
2759
+
2760
+
2761
+ <pre class="prettyprint"><code>// [ES5引入方式]:
2762
+ const { Polygon, LineString } = zondy.geometry
2763
+ const { MapView } = zondy.leaflet
2764
+ const { SketchDataType } = zondy.enum
2765
+ const { SketchEditor } = zondy.leaflet.tool.sketch
2766
+ [ES6引入方式]:
2767
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
2768
+ import { Polygon, LineString, SketchDataType } from "@mapgis/webclient-common" &lt;br/>
2769
+ var map = new Map()
2770
+ var mapView = new MapView({
2771
+ viewId: "mapgis-2d-viewer",
2772
+ map: map,
2773
+ })
2774
+ var sketchEditor = new SketchEditor({
2775
+ view: mapView,
2776
+ layer: new GraphicsLayer()
2777
+ })
2778
+ sketchEditor.start(SketchDataType.POLYGON)
2779
+ console.log("是否可以进行撤销操作:" + sketchEditor.canUndo())
2780
+ const geometry = sketchEditor.undo()
2781
+ console.log("恢复后的几何对象" + geometry)</code></pre>
2782
+
2783
+
2784
+
2785
+ </div>
2786
+
2787
+ <div class="member">
2788
+
2789
+
2790
+
2791
+ <h4 class="name" id="union">
2792
+ <a class="href-link" href="#union">#</a>
2793
+
2794
+ <span class="code-name" style="font-size:30px">
2795
+
2796
+ union<span class="signature">(polygons)</span>
2797
+
2798
+ </span>
2799
+ </h4>
2800
+
2801
+
2802
+
2803
+ <div class="description">
2804
+ <p>合并多个区几何<a id='union'></a></p>
2805
+ </div>
2806
+
2807
+
2808
+
2809
+
2810
+
2811
+
2812
+
2813
+
2814
+
2815
+
2816
+ <h4>参数:</h4>
2817
+
2818
+ <div class="table-container">
2819
+ <table class="params table">
2820
+ <thead>
2821
+ <tr>
2822
+
2823
+ <th>名称</th>
2824
+
2825
+
2826
+ <th>类型</th>
2827
+
2828
+
2829
+
2830
+ <th class="last">描述</th>
2831
+ </tr>
2832
+ </thead>
2833
+
2834
+ <tbody>
2835
+
2836
+
2837
+
2838
+ <tr class="deep-level-0">
2839
+
2840
+ <td class="name"><code>polygons</code></td>
2841
+
2842
+
2843
+ <td class="type">
2844
+
2845
+
2846
+ <span class="param-type">Polygon</span>
2847
+
2848
+
2849
+
2850
+ </td>
2851
+
2852
+
2853
+
2854
+ <td class="description last"><p>被合并的区几何对象</p></td>
2855
+ </tr>
2856
+
2857
+
2858
+
2859
+
2860
+ </tbody>
2861
+ </table>
2862
+ </div>
2863
+
2864
+
2865
+
2866
+
2867
+
2868
+
2869
+ <dl class="details">
2870
+
2871
+
2872
+
2873
+
2874
+
2875
+
2876
+
2877
+
2878
+
2879
+
2880
+
2881
+
2882
+
2883
+
2884
+
2885
+
2886
+
2887
+
2888
+
2889
+
2890
+
2891
+
2892
+
2893
+
2894
+
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+
2901
+ </dl>
2902
+
2903
+
2904
+
2905
+
2906
+
2907
+
2908
+
2909
+
2910
+
2911
+
2912
+
2913
+
2914
+
2915
+
2916
+
2917
+
2918
+
2919
+
2920
+ <div class='columns method-parameter'>
2921
+ <div class="column is-2"><label>返回值:</label></div>
2922
+ <div class="column is-10">
2923
+
2924
+
2925
+
2926
+ <div class="columns">
2927
+
2928
+ <div class='param-desc column is-7'><p>合并后的几何对象</p></div>
2929
+
2930
+
2931
+ <div class='column is-5 has-text-left'>
2932
+ <label>类型: </label>
2933
+
2934
+ <span class="param-type">Polygon</span>
2935
+
2936
+
2937
+ </div>
2938
+
2939
+ </div>
2940
+
2941
+
2942
+ </div>
2943
+ </div>
2944
+
2945
+
2946
+
2947
+
2948
+
2949
+
2950
+ <h5>示例</h5>
2951
+
2952
+ <p class="code-caption"><h7>二维草图几何合并</h7></p>
2953
+
2954
+
2955
+ <pre class="prettyprint"><code>// [ES5引入方式]:
2956
+ const { Polygon } = zondy.geometry
2957
+ const { MapView } = zondy.leaflet
2958
+ const { SketchEditor } = zondy.leaflet.tool.sketch
2959
+ [ES6引入方式]:
2960
+ import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" &lt;br/>
2961
+ import { polygon } from "@mapgis/webclient-common" &lt;br/>
2962
+ var map = new Map()
2963
+ var mapView = new MapView({
2964
+ viewId: "mapgis-2d-viewer",
2965
+ map: map,
2966
+ })
2967
+ var sketchEditor = new SketchEditor({
2968
+ view: mapView,
2969
+ layer: new GraphicsLayer()
2970
+ })
2971
+ const polygon = new Polygon({
2972
+ coordinates: [
2973
+ [
2974
+ [0, -60],
2975
+ [0, 60],
2976
+ [160, 60],
2977
+ [160, -60],
2978
+ [0, -60]
2979
+ ]
2980
+ ]
2981
+ })
2982
+ const polygon1 = new Polygon({
2983
+ coordinates: [
2984
+ [
2985
+ [10, -60],
2986
+ [10, 60],
2987
+ [170, 60],
2988
+ [170, -60],
2989
+ [10, -60]
2990
+ ]
2991
+ ]
2992
+ })
2993
+ const polygons = [polygon,polygon1]
2994
+ sketchEditor.union(polygons)</code></pre>
2995
+
2996
+
2997
+
2998
+ </div>
2999
+
3000
+ <div class="member">
3001
+
3002
+
3003
+
3004
+ <h4 class="name" id="updateVertex">
3005
+ <a class="href-link" href="#updateVertex">#</a>
3006
+
3007
+ <span class="code-name" style="font-size:30px">
3008
+
3009
+ updateVertex<span class="signature">(point, index)</span>
3010
+
3011
+ </span>
3012
+ </h4>
3013
+
3014
+
3015
+
3016
+ <div class="description">
3017
+ <p>更新当前草图图形的某个顶点<a id='updateVertex'></a></p>
3018
+ </div>
3019
+
3020
+
3021
+
3022
+
3023
+
3024
+
3025
+
3026
+
3027
+
3028
+
3029
+ <h4>参数:</h4>
3030
+
3031
+ <div class="table-container">
3032
+ <table class="params table">
3033
+ <thead>
3034
+ <tr>
3035
+
3036
+ <th>名称</th>
3037
+
3038
+
3039
+ <th>类型</th>
3040
+
3041
+
3042
+
3043
+ <th class="last">描述</th>
3044
+ </tr>
3045
+ </thead>
3046
+
3047
+ <tbody>
3048
+
3049
+
3050
+
3051
+ <tr class="deep-level-0">
3052
+
3053
+ <td class="name"><code>point</code></td>
3054
+
3055
+
3056
+ <td class="type">
3057
+
3058
+
3059
+ <span class="param-type">Point</span>
3060
+
3061
+
3062
+
3063
+ </td>
3064
+
3065
+
3066
+
3067
+ <td class="description last"><p>新的顶点</p></td>
3068
+ </tr>
3069
+
3070
+
3071
+
3072
+
3073
+
3074
+
3075
+ <tr class="deep-level-0">
3076
+
3077
+ <td class="name"><code>index</code></td>
3078
+
3079
+
3080
+ <td class="type">
3081
+
3082
+
3083
+ <span class="param-type">Number</span>
3084
+
3085
+
3086
+
3087
+ </td>
3088
+
3089
+
3090
+
3091
+ <td class="description last"><p>需更新的顶点的序号</p></td>
3092
+ </tr>
3093
+
3094
+
3095
+
3096
+
3097
+ </tbody>
3098
+ </table>
3099
+ </div>
3100
+
3101
+
3102
+
3103
+
3104
+
3105
+
3106
+ <dl class="details">
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+
3113
+
3114
+
3115
+
3116
+
3117
+
3118
+
3119
+
3120
+
3121
+
3122
+
3123
+
3124
+
3125
+
3126
+
3127
+
3128
+
3129
+
3130
+
3131
+
3132
+
3133
+
3134
+
3135
+
3136
+
3137
+
3138
+ </dl>
3139
+
3140
+
3141
+
3142
+
3143
+
3144
+
3145
+
3146
+
3147
+
3148
+
3149
+
3150
+
3151
+
3152
+
3153
+
3154
+
3155
+
3156
+
3157
+
3158
+
3159
+
3160
+
3161
+
3162
+ </div>
3163
+
3164
+ </div>
3165
+ </div>
3166
+
3167
+
3168
+
3169
+
3170
+
3171
+ </article>
3172
+
3173
+ </section>
3174
+
3175
+
3176
+
3177
+
3178
+ </div>
3179
+
3180
+ <footer class="footer">
3181
+ <div class="content has-text-centered">
3182
+ <p>文档生成<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a></p>
3183
+ <p class="sidebar-created-by">
3184
+ <a href="http://www.smaryun.com" target="_blank">司马云</a> <span>© 2023 云生态圈</span>
3185
+ <a href="http://webclient.smaryun.com:8086/#/index" target="_blank">MapGIS Client for JavaScript</a>
3186
+ </p>
3187
+ </div>
3188
+ </footer>
3189
+
3190
+ </div>
3191
+ <div id="side-nav" class="side-nav">
3192
+ <div style="margin-bottom: 10px;">
3193
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#page-title">构造函数</a>
3194
+ </div>
3195
+ <div style="margin-bottom: 10px;">
3196
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#member">成员变量</a>
3197
+ </div>
3198
+ <div style="margin-bottom: 10px;">
3199
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#function">方法</a>
3200
+ </div>
3201
+ <div>
3202
+ <img style="vertical-align: middle;margin-right: 10px;width: 30px;" src="./styles/anchor.png"/><a href="#event">事件</a>
3203
+ </div>
3204
+ </div>
3205
+ </div>
3206
+ <script src="scripts/linenumber.js"> </script>
3207
+
3208
+ <script src="scripts/search.js"> </script>
3209
+
3210
+ </body>
3211
+ </html>