@mapgis/webclient-leaflet-plugin 17.2.0 → 17.2.2
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 +22 -4
- package/dist/es5/webclient-common.min.js +5 -5
- package/dist/es5/webclient-leaflet-plugin.min.js +6 -6
- package/dist/webclient-leaflet-plugin-es6.min.js +6 -6
- package/documention/ArcGISMapImageLayer.html +820 -0
- package/documention/ArcGISTileLayer.html +498 -0
- package/documention/EchartsLayer.html +261 -0
- package/documention/FeatureLayer.html +212 -0
- package/documention/FeatureLayerUtil.html +288 -0
- package/documention/IGSMapImageLayer.html +948 -0
- package/documention/IGSTileLayer.html +562 -0
- package/documention/MapLayer.html +330 -0
- package/documention/MapVLayer.html +320 -0
- package/documention/MapViewLeaflet.html +7 -7
- package/documention/Popup.html +4 -2
- package/documention/Screenshot.html +5 -3
- package/documention/SketchEditorLeaflet.html +76 -46
- package/documention/TileLayer.html +279 -0
- package/documention/TileLayerWMS.html +222 -0
- package/documention/VectorTileLayer.html +529 -0
- package/documention/WMSLayerView.html +689 -0
- package/documention/WebMapServiceLayer.html +723 -0
- package/documention/WebMapTileServiceLayer.html +754 -0
- package/documention/WebTileLayer.html +663 -0
- package/documention/Zondy.ThemeLayer.GeoFeatureThemeLayer.html +22 -22
- package/documention/Zondy.ThemeLayer.GraphThemeLayer.html +30 -30
- package/documention/Zondy.ThemeLayer.RandomThemeLayer.html +34 -34
- package/documention/Zondy.ThemeLayer.ThemeLayer.html +3 -3
- package/documention/Zondy.ThemeLayer.rangeThemeLayer.html +34 -34
- package/documention/Zondy.ThemeLayer.rankSymbolThemeLayer.html +47 -47
- package/documention/Zondy.ThemeLayer.simpleThemeLayer.html +33 -33
- package/documention/Zondy.ThemeLayer.uniqueThemeLayer.html +30 -30
- package/documention/Zondy.Widget.html +5 -5
- package/documention/global.html +454 -0
- package/documention/index.html +3 -3
- package/package.json +3 -2
|
@@ -1172,7 +1172,7 @@ import { MapViewLeaflet } from '@mapgis/webclient-leaflet-plugin' <br/></p>
|
|
|
1172
1172
|
<p class="code-caption"><h7 id='MapViewLeaflet'>初始化一个二维场景视图</h7></p>
|
|
1173
1173
|
|
|
1174
1174
|
|
|
1175
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
1176
1175
|
// 二维场景视图的容器(html的div标签)ID
|
|
1177
1176
|
viewId: "二维场景视图的容器的id",
|
|
1178
1177
|
// 图层管理容器
|
|
1179
1178
|
map: map
|
|
1179
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
1180
1180
|
// 二维场景视图的容器(html的div标签)ID
|
|
1181
1181
|
viewId: "二维场景视图的容器的id",
|
|
1182
1182
|
// 图层管理容器
|
|
1183
1183
|
map: map
|
|
1184
1184
|
|
|
1185
1185
|
|
|
1186
1186
|
|
|
@@ -4074,19 +4074,19 @@ import { MapViewLeaflet } from '@mapgis/webclient-leaflet-plugin' <br/></p>
|
|
|
4074
4074
|
<p class="code-caption"><h7>中心点跳转示例</h7></p>
|
|
4075
4075
|
|
|
4076
4076
|
|
|
4077
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
4078
4077
|
// 视图id
|
|
4079
4078
|
viewId: "view-id",
|
|
4080
4079
|
// 图层管理容器
|
|
4081
4080
|
map: map
|
|
4082
4081
|
// 跳转中心点
|
|
4083
4082
|
center: [{x}, {y}],
|
|
4084
4083
|
// 地图层级
|
|
4085
4084
|
zoom: {zoom}
|
|
4085
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
4086
4086
|
// 视图id
|
|
4087
4087
|
viewId: "view-id",
|
|
4088
4088
|
// 图层管理容器
|
|
4089
4089
|
map: map
|
|
4090
4090
|
// 跳转中心点
|
|
4091
4091
|
center: [{x}, {y}],
|
|
4092
4092
|
// 地图层级
|
|
4093
4093
|
zoom: {zoom}
|
|
4094
4094
|
|
|
4095
4095
|
|
|
4096
4096
|
<p class="code-caption"><h7>按范围跳转示例</h7></p>
|
|
4097
4097
|
|
|
4098
4098
|
|
|
4099
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
4100
4099
|
// 视图id
|
|
4101
4100
|
viewId: "view-id",
|
|
4102
4101
|
// 图层管理容器
|
|
4103
4102
|
map: map
|
|
4104
4103
|
// 范围几何
|
|
4105
4104
|
extent: new Extent({
|
|
4106
4105
|
"xmin":10,
|
|
4107
4106
|
"xmax":210,
|
|
4108
4107
|
"ymin":0,
|
|
4109
4108
|
"ymax":100,
|
|
4110
4109
|
})
|
|
4110
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
4111
4111
|
// 视图id
|
|
4112
4112
|
viewId: "view-id",
|
|
4113
4113
|
// 图层管理容器
|
|
4114
4114
|
map: map
|
|
4115
4115
|
// 范围几何
|
|
4116
4116
|
extent: new Extent({
|
|
4117
4117
|
"xmin":10,
|
|
4118
4118
|
"xmax":210,
|
|
4119
4119
|
"ymin":0,
|
|
4120
4120
|
"ymax":100,
|
|
4121
4121
|
})
|
|
4122
4122
|
|
|
4123
4123
|
|
|
4124
4124
|
<p class="code-caption"><h7>按范围跳转示例-拿到图层信息后跳转</h7></p>
|
|
4125
4125
|
|
|
4126
4126
|
|
|
4127
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
4128
4127
|
url: 'http://192.168.82.89:8089/igs/rest/services/Map/Hubei4326/MapServer'
|
|
4129
4128
|
console.log("加载完毕:", result.layer)
|
|
4130
4129
|
//视点跳转
|
|
4131
4130
|
mapView.flyTo({
|
|
4132
4131
|
extent: result.layer.extent
|
|
4133
4132
|
});
|
|
4133
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
4134
4134
|
url: 'http://192.168.82.89:8089/igs/rest/services/Map/Hubei4326/MapServer'
|
|
4135
4135
|
console.log("加载完毕:", result.layer)
|
|
4136
4136
|
//视点跳转
|
|
4137
4137
|
mapView.flyTo({
|
|
4138
4138
|
extent: result.layer.extent
|
|
4139
4139
|
});
|
|
4140
4140
|
|
|
4141
4141
|
|
|
4142
4142
|
|
|
@@ -5863,13 +5863,13 @@ import { MapViewLeaflet } from '@mapgis/webclient-leaflet-plugin' <br/></p>
|
|
|
5863
5863
|
<p class="code-caption"><h7>中心点跳转示例</h7></p>
|
|
5864
5864
|
|
|
5865
5865
|
|
|
5866
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
5867
5866
|
// 视图id
|
|
5868
5867
|
viewId: "view-id",
|
|
5869
5868
|
// 图层管理容器
|
|
5870
5869
|
map: map
|
|
5871
5870
|
// 跳转中心点
|
|
5872
5871
|
center: [115.47643872463577, 30.980700423496124],
|
|
5873
5872
|
// 地图层级
|
|
5874
5873
|
zoom: 8
|
|
5874
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
5875
5875
|
// 视图id
|
|
5876
5876
|
viewId: "view-id",
|
|
5877
5877
|
// 图层管理容器
|
|
5878
5878
|
map: map
|
|
5879
5879
|
// 跳转中心点
|
|
5880
5880
|
center: [115.47643872463577, 30.980700423496124],
|
|
5881
5881
|
// 地图层级
|
|
5882
5882
|
zoom: 8
|
|
5883
5883
|
|
|
5884
5884
|
|
|
5885
5885
|
<p class="code-caption"><h7>按范围跳转示例</h7></p>
|
|
5886
5886
|
|
|
5887
5887
|
|
|
5888
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
5889
5888
|
// 视图id
|
|
5890
5889
|
viewId: "view-id",
|
|
5891
5890
|
// 图层管理容器
|
|
5892
5891
|
map: map
|
|
5893
5892
|
xmin: 111.88463529230717,
|
|
5894
5893
|
ymin: 28.646934514163803,
|
|
5895
5894
|
xmax: 116.89989408129225,
|
|
5896
5895
|
ymax: 33.07991791253288,
|
|
5897
5896
|
center: [111, 29],
|
|
5898
5897
|
radius: 100,
|
|
5899
5898
|
radiusUnit: "kilometers",
|
|
5900
5899
|
.goTo({
|
|
5901
5900
|
target: [extent1, geometry2],
|
|
5902
5901
|
})
|
|
5903
5902
|
.then(() => {
|
|
5904
5903
|
console.log("gotoExtent callback")
|
|
5905
5904
|
})</code></pre>
|
|
5905
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
5906
5906
|
// 视图id
|
|
5907
5907
|
viewId: "view-id",
|
|
5908
5908
|
// 图层管理容器
|
|
5909
5909
|
map: map
|
|
5910
5910
|
xmin: 111.88463529230717,
|
|
5911
5911
|
ymin: 28.646934514163803,
|
|
5912
5912
|
xmax: 116.89989408129225,
|
|
5913
5913
|
ymax: 33.07991791253288,
|
|
5914
5914
|
center: [111, 29],
|
|
5915
5915
|
radius: 100,
|
|
5916
5916
|
radiusUnit: "kilometers",
|
|
5917
5917
|
.goTo({
|
|
5918
5918
|
target: [extent1, geometry2],
|
|
5919
5919
|
})
|
|
5920
5920
|
.then(() => {
|
|
5921
5921
|
console.log("gotoExtent callback")
|
|
5922
5922
|
})</code></pre>
|
|
5923
5923
|
|
|
5924
5924
|
|
|
5925
5925
|
|
|
@@ -6471,7 +6471,7 @@ import { MapViewLeaflet } from '@mapgis/webclient-leaflet-plugin' <br/></p>
|
|
|
6471
6471
|
<p class="code-caption"><h7>屏幕快照</h7></p>
|
|
6472
6472
|
|
|
6473
6473
|
|
|
6474
|
-
<pre class="prettyprint"><code>// ES5引入方式
|
|
6475
6474
|
// 二维场景视图的容器(html的div标签)ID
|
|
6476
6475
|
viewId: "二维场景视图的容器的id",
|
|
6477
6476
|
// 图层管理容器
|
|
6478
6477
|
map: map
|
|
6479
6478
|
format: PictureFormat.png
|
|
6480
6479
|
// 获取base64格式的url字符串
|
|
6481
6480
|
console.log("dataUrl:", result.dataUrl)
|
|
6481
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
6482
6482
|
// 二维场景视图的容器(html的div标签)ID
|
|
6483
6483
|
viewId: "二维场景视图的容器的id",
|
|
6484
6484
|
// 图层管理容器
|
|
6485
6485
|
map: map
|
|
6486
6486
|
format: PictureFormat.png
|
|
6487
6487
|
// 获取base64格式的url字符串
|
|
6488
6488
|
console.log("dataUrl:", result.dataUrl)
|
|
6489
6489
|
|
|
6490
6490
|
|
|
6491
6491
|
|
package/documention/Popup.html
CHANGED
|
@@ -376,9 +376,11 @@ zondy-popup__footer 弹窗底部样式<br/></p>
|
|
|
376
376
|
|
|
377
377
|
|
|
378
378
|
<pre class="prettyprint"><code>// ES5引入方式
|
|
379
|
-
const { Map
|
|
379
|
+
const { Map } = zondy
|
|
380
|
+
const { MapView } = zondy.leaflet
|
|
380
381
|
// ES6引入方式
|
|
381
|
-
import {
|
|
382
|
+
import { MapView } from "@mapgis/webclient-leaflet-plugin"
|
|
383
|
+
import { Map } from "@mapgis/webclient-common"
|
|
382
384
|
// 初始化图层管理容器
|
|
383
385
|
const map = new Map();
|
|
384
386
|
// 初始化地图视图对象
|
|
@@ -278,10 +278,12 @@
|
|
|
278
278
|
|
|
279
279
|
|
|
280
280
|
<pre class="prettyprint"><code>// ES5引入方式
|
|
281
|
-
const { Map
|
|
282
|
-
const {
|
|
281
|
+
const { Map } = zondy
|
|
282
|
+
const { MapView } = zondy.leaflet
|
|
283
|
+
const { Screenshot } = zondy.leaflet.tool
|
|
283
284
|
// ES6引入方式
|
|
284
|
-
import {
|
|
285
|
+
import { MapView, Screenshot } from "@mapgis/webclient-leaflet-plugin"
|
|
286
|
+
import { Map } from "@mapgis/webclient-common"
|
|
285
287
|
// 初始化图层管理容器
|
|
286
288
|
const map = new Map();
|
|
287
289
|
// 初始化地图视图对象
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
<div class="description">
|
|
38
38
|
<p>二维Leaflet引擎草图编辑类<br/>
|
|
39
39
|
<br>[ES5引入方式]:<br/>
|
|
40
|
-
const {
|
|
40
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch <br/>
|
|
41
41
|
[ES6引入方式]:<br/>
|
|
42
|
-
import {
|
|
42
|
+
import { SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/></p>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
@@ -317,9 +317,14 @@ import { SketchEditorLeaflet } from "@mapgis/webclient-leaflet-plugin"
|
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
320
|
-
const {
|
|
320
|
+
const { Color } = zondy
|
|
321
|
+
const { SketchDataType } = zondy.enum
|
|
322
|
+
const { SimpleMarkerSymbol } = zondy.symbol
|
|
323
|
+
const { SketchStyle } = zondy.tool.sketch
|
|
324
|
+
const { MapView } = zondy.leaflet
|
|
325
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
321
326
|
[ES6引入方式]:
|
|
322
|
-
import { MapView,
|
|
327
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
323
328
|
import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" <br/>
|
|
324
329
|
var map = new Map()
|
|
325
330
|
var mapView = new MapView({
|
|
@@ -335,14 +340,14 @@ var sketchStyle = new SketchStyle({
|
|
|
335
340
|
lineStyle: undefined,
|
|
336
341
|
fillStyle: undefined
|
|
337
342
|
})
|
|
338
|
-
var
|
|
343
|
+
var sketchEditor = new SketchEditor({
|
|
339
344
|
view: mapView,
|
|
340
345
|
layer: new GraphicsLayer(),
|
|
341
346
|
vertexStyle: vertexStyle
|
|
342
347
|
})
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
sketchEditor.start(SketchDataType.POINT) // 绘制点
|
|
349
|
+
sketchEditor.start(SketchDataType.POLYLINE) // 绘制线
|
|
350
|
+
sketchEditor.start(SketchDataType.POLYGON) // 绘制区
|
|
346
351
|
*</code></pre>
|
|
347
352
|
|
|
348
353
|
|
|
@@ -1212,7 +1217,9 @@ SketchEditorLeaflet.start(SketchDataType.POLYGON) // 绘制区
|
|
|
1212
1217
|
|
|
1213
1218
|
|
|
1214
1219
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
1215
|
-
const {
|
|
1220
|
+
const { Polygon, LineString } = zondy.geometry
|
|
1221
|
+
const { MapView } = zondy.leaflet
|
|
1222
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
1216
1223
|
[ES6引入方式]:
|
|
1217
1224
|
import { MapView, SketchEditorLeaflet } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
1218
1225
|
import { Polygon, LineString } from "@mapgis/webclient-common" <br/>
|
|
@@ -1273,11 +1280,11 @@ var testLayer = new GraphicsLayer({
|
|
|
1273
1280
|
graphics: this.testFeatures
|
|
1274
1281
|
})
|
|
1275
1282
|
map.add(testLayer)
|
|
1276
|
-
var
|
|
1283
|
+
var sketchEditor = new SketchEditor({
|
|
1277
1284
|
view: mapView,
|
|
1278
1285
|
layer: new GraphicsLayer()
|
|
1279
1286
|
})
|
|
1280
|
-
|
|
1287
|
+
sketchEditor.drawPolylineToPolygon(testGeometries)</code></pre>
|
|
1281
1288
|
|
|
1282
1289
|
|
|
1283
1290
|
|
|
@@ -1644,22 +1651,25 @@ sketchEditorLeaflet.drawPolylineToPolygon(testGeometries)</code></pre>
|
|
|
1644
1651
|
|
|
1645
1652
|
|
|
1646
1653
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
1647
|
-
const {
|
|
1654
|
+
const { Polygon, LineString } = zondy.geometry
|
|
1655
|
+
const { SketchDataType } = zondy.enum
|
|
1656
|
+
const { MapView } = zondy.leaflet
|
|
1657
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
1648
1658
|
[ES6引入方式]:
|
|
1649
|
-
import { MapView,
|
|
1650
|
-
import { Polygon, LineString } from "@mapgis/webclient-common" <br/>
|
|
1659
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
1660
|
+
import { Polygon, LineString, SketchDataType } from "@mapgis/webclient-common" <br/>
|
|
1651
1661
|
var map = new Map()
|
|
1652
1662
|
var mapView = new MapView({
|
|
1653
1663
|
viewId: "mapgis-2d-viewer",
|
|
1654
1664
|
map: map,
|
|
1655
1665
|
})
|
|
1656
|
-
var
|
|
1666
|
+
var sketchEditor = new SketchEditor({
|
|
1657
1667
|
view: mapView,
|
|
1658
1668
|
layer: new GraphicsLayer()
|
|
1659
1669
|
})
|
|
1660
|
-
|
|
1661
|
-
console.log("是否可以进行恢复操作:" +
|
|
1662
|
-
const geometry =
|
|
1670
|
+
sketchEditor.start(SketchDataType.POLYGON)
|
|
1671
|
+
console.log("是否可以进行恢复操作:" + sketchEditor.canRedo())
|
|
1672
|
+
const geometry = sketchEditor.redo()
|
|
1663
1673
|
console.log("恢复后的几何对象" + geometry)</code></pre>
|
|
1664
1674
|
|
|
1665
1675
|
|
|
@@ -2049,12 +2059,15 @@ console.log("恢复后的几何对象" + geometry)</code></pre>
|
|
|
2049
2059
|
|
|
2050
2060
|
|
|
2051
2061
|
<pre class="prettyprint"><code>// ES5引入方式
|
|
2052
|
-
const { SimpleMarkerSymbol, SimpleFillSymbol, SimpleLineSymbol } =
|
|
2053
|
-
const { Map,
|
|
2054
|
-
const {
|
|
2062
|
+
const { SimpleMarkerSymbol, SimpleFillSymbol, SimpleLineSymbol } = zondy.Symbol
|
|
2063
|
+
const { Map, Color } = zondy
|
|
2064
|
+
const { MapView } = zondy.leaflet
|
|
2065
|
+
const { SketchStyle } = zondy.tool.sketch
|
|
2066
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
2067
|
+
const { SketchDataType } = zondy.Enum
|
|
2055
2068
|
// ES6引入方式
|
|
2056
2069
|
import { Map, SimpleMarkerSymbol, SimpleFillSymbol, SimpleLineSymbol, Color, SketchStyle, SketchDataType } from "@mapgis/webclient-common"
|
|
2057
|
-
import { MapView,
|
|
2070
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
2058
2071
|
var map = new Map()
|
|
2059
2072
|
var mapView = new MapView({
|
|
2060
2073
|
viewId: "mapgis-2d-viewer",
|
|
@@ -2121,7 +2134,7 @@ var sketchStyle = new SketchStyle({
|
|
|
2121
2134
|
})
|
|
2122
2135
|
})
|
|
2123
2136
|
})
|
|
2124
|
-
var sketchEditor = new
|
|
2137
|
+
var sketchEditor = new SketchEditor({
|
|
2125
2138
|
view: mapView,
|
|
2126
2139
|
layer: graphicsLayer,
|
|
2127
2140
|
})
|
|
@@ -2347,16 +2360,18 @@ sketchEditor.start(SketchDataType.POLYGON)</code></pre>
|
|
|
2347
2360
|
|
|
2348
2361
|
|
|
2349
2362
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
2350
|
-
const {
|
|
2363
|
+
const { Polygon, LineString } = zondy.geometry
|
|
2364
|
+
const { MapView } = zondy.leaflet
|
|
2365
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
2351
2366
|
[ES6引入方式]:
|
|
2352
|
-
import { MapView,
|
|
2367
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
2353
2368
|
import { Polygon, LineString } from "@mapgis/webclient-common" <br/>
|
|
2354
2369
|
var map = new Map()
|
|
2355
2370
|
var mapView = new MapView({
|
|
2356
2371
|
viewId: "mapgis-2d-viewer",
|
|
2357
2372
|
map: map,
|
|
2358
2373
|
})
|
|
2359
|
-
var
|
|
2374
|
+
var sketchEditor = new SketchEditor({
|
|
2360
2375
|
view: mapView,
|
|
2361
2376
|
layer: new GraphicsLayer()
|
|
2362
2377
|
})
|
|
@@ -2377,7 +2392,7 @@ const polyline = new LineString({
|
|
|
2377
2392
|
[120, 30]
|
|
2378
2393
|
]
|
|
2379
2394
|
})
|
|
2380
|
-
const newSketchEditors =
|
|
2395
|
+
const newSketchEditors = SketchEditor.split(polygon,polyline)</code></pre>
|
|
2381
2396
|
|
|
2382
2397
|
|
|
2383
2398
|
|
|
@@ -2561,9 +2576,14 @@ const newSketchEditors = SketchEditorLeaflet.split(polygon,polyline)</code></pre
|
|
|
2561
2576
|
|
|
2562
2577
|
|
|
2563
2578
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
2564
|
-
const {
|
|
2579
|
+
const { Color } = zondy
|
|
2580
|
+
const { SketchDataType } = zondy.enum
|
|
2581
|
+
const { SimpleMarkerSymbol } = zondy.symbol
|
|
2582
|
+
const { SketchStyle } = zondy.tool.sketch
|
|
2583
|
+
const { MapView } = zondy.leaflet
|
|
2584
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
2565
2585
|
[ES6引入方式]:
|
|
2566
|
-
import { MapView,
|
|
2586
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
2567
2587
|
import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" <br/>
|
|
2568
2588
|
var map = new Map()
|
|
2569
2589
|
var mapView = new MapView({
|
|
@@ -2579,14 +2599,14 @@ var sketchStyle = new SketchStyle({
|
|
|
2579
2599
|
lineStyle: undefined,
|
|
2580
2600
|
fillStyle: undefined
|
|
2581
2601
|
})
|
|
2582
|
-
var
|
|
2602
|
+
var sketchEditor = new SketchEditor({
|
|
2583
2603
|
view: mapView,
|
|
2584
2604
|
layer: new GraphicsLayer(),
|
|
2585
2605
|
vertexStyle: vertexStyle
|
|
2586
2606
|
})
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2607
|
+
sketchEditor.start(SketchDataType.POINT) // 绘制点
|
|
2608
|
+
sketchEditor.start(SketchDataType.POLYLINE) // 绘制线
|
|
2609
|
+
sketchEditor.start(SketchDataType.POLYGON) // 绘制区</code></pre>
|
|
2590
2610
|
|
|
2591
2611
|
|
|
2592
2612
|
|
|
@@ -2741,9 +2761,14 @@ SketchEditorLeaflet.start(SketchDataType.POLYGON) // 绘制区</code></pre>
|
|
|
2741
2761
|
|
|
2742
2762
|
|
|
2743
2763
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
2744
|
-
const {
|
|
2764
|
+
const { Color } = zondy
|
|
2765
|
+
const { SketchDataType } = zondy.enum
|
|
2766
|
+
const { SimpleMarkerSymbol } = zondy.symbol
|
|
2767
|
+
const { SketchStyle } = zondy.tool.sketch
|
|
2768
|
+
const { MapView } = zondy.leaflet
|
|
2769
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
2745
2770
|
[ES6引入方式]:
|
|
2746
|
-
import { MapView,
|
|
2771
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
2747
2772
|
import { SketchStyle, SimpleMarkerSymbol, Color, SketchDataType} from "@mapgis/webclient-common" <br/>
|
|
2748
2773
|
import SketchEllipseDrawTool from "./SketchEllipseDrawTool" <br/>
|
|
2749
2774
|
var map = new Map()
|
|
@@ -2760,12 +2785,12 @@ var sketchStyle = new SketchStyle({
|
|
|
2760
2785
|
lineStyle: undefined,
|
|
2761
2786
|
fillStyle: undefined
|
|
2762
2787
|
})
|
|
2763
|
-
var
|
|
2788
|
+
var sketchEditor = new SketchEditor({
|
|
2764
2789
|
view: mapView,
|
|
2765
2790
|
layer: new GraphicsLayer(),
|
|
2766
2791
|
vertexStyle: vertexStyle
|
|
2767
2792
|
})
|
|
2768
|
-
|
|
2793
|
+
sketchEditor.startCustomDrawTool(SketchEllipseDrawTool, "ellipse") // 绘制椭圆</code></pre>
|
|
2769
2794
|
|
|
2770
2795
|
|
|
2771
2796
|
|
|
@@ -2985,7 +3010,10 @@ sketchEditorLeaflet.startCustomDrawTool(SketchEllipseDrawTool, "ellipse") // 绘
|
|
|
2985
3010
|
|
|
2986
3011
|
|
|
2987
3012
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
2988
|
-
const {
|
|
3013
|
+
const { Polygon, LineString } = zondy.geometry
|
|
3014
|
+
const { MapView } = zondy.leaflet
|
|
3015
|
+
const { SketchDataType } = zondy.enum
|
|
3016
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
2989
3017
|
[ES6引入方式]:
|
|
2990
3018
|
import { MapView, SketchEditorLeaflet } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
2991
3019
|
import { Polygon, LineString, SketchDataType } from "@mapgis/webclient-common" <br/>
|
|
@@ -2994,13 +3022,13 @@ var mapView = new MapView({
|
|
|
2994
3022
|
viewId: "mapgis-2d-viewer",
|
|
2995
3023
|
map: map,
|
|
2996
3024
|
})
|
|
2997
|
-
var
|
|
3025
|
+
var sketchEditor = new SketchEditor({
|
|
2998
3026
|
view: mapView,
|
|
2999
3027
|
layer: new GraphicsLayer()
|
|
3000
3028
|
})
|
|
3001
|
-
|
|
3002
|
-
console.log("是否可以进行撤销操作:" +
|
|
3003
|
-
const geometry =
|
|
3029
|
+
sketchEditor.start(SketchDataType.POLYGON)
|
|
3030
|
+
console.log("是否可以进行撤销操作:" + sketchEditor.canUndo())
|
|
3031
|
+
const geometry = sketchEditor.undo()
|
|
3004
3032
|
console.log("恢复后的几何对象" + geometry)</code></pre>
|
|
3005
3033
|
|
|
3006
3034
|
|
|
@@ -3186,16 +3214,18 @@ console.log("恢复后的几何对象" + geometry)</code></pre>
|
|
|
3186
3214
|
|
|
3187
3215
|
|
|
3188
3216
|
<pre class="prettyprint"><code>// [ES5引入方式]:
|
|
3189
|
-
const {
|
|
3217
|
+
const { Polygon } = zondy.geometry
|
|
3218
|
+
const { MapView } = zondy.leaflet
|
|
3219
|
+
const { SketchEditor } = zondy.leaflet.tool.sketch
|
|
3190
3220
|
[ES6引入方式]:
|
|
3191
|
-
import { MapView,
|
|
3221
|
+
import { MapView, SketchEditor } from "@mapgis/webclient-leaflet-plugin" <br/>
|
|
3192
3222
|
import { polygon } from "@mapgis/webclient-common" <br/>
|
|
3193
3223
|
var map = new Map()
|
|
3194
3224
|
var mapView = new MapView({
|
|
3195
3225
|
viewId: "mapgis-2d-viewer",
|
|
3196
3226
|
map: map,
|
|
3197
3227
|
})
|
|
3198
|
-
var
|
|
3228
|
+
var sketchEditor = new SketchEditor({
|
|
3199
3229
|
view: mapView,
|
|
3200
3230
|
layer: new GraphicsLayer()
|
|
3201
3231
|
})
|
|
@@ -3222,7 +3252,7 @@ const polygon1 = new Polygon({
|
|
|
3222
3252
|
]
|
|
3223
3253
|
})
|
|
3224
3254
|
const polygons = [polygon,polygon1]
|
|
3225
|
-
|
|
3255
|
+
sketchEditor.union(polygons)</code></pre>
|
|
3226
3256
|
|
|
3227
3257
|
|
|
3228
3258
|
|