@mapgis/webclient-common 17.2.7 → 17.2.8

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.
@@ -232,7 +232,7 @@ import { Feature } from &quot;@mapgis/webclient-common&quot; <br/>
232
232
  </td>
233
233
 
234
234
 
235
- <td class="description last"><p>要素的样式,支持如下:<br/>
235
+ <td class="description last"><p>客户端要素渲染样式,当使用GraphicsLayer图层绘制要素时,设置此参数来决定渲染结果,支持如下:<br/>
236
236
  <a class="mapgis-link-name" title="PictureMarkerSymbol" PictureMarkerSymbol.html><code>图片Marker符号</code></a>、<a class="mapgis-link-name" title="SimpleMarkerSymbol" SimpleMarkerSymbol.html><code>简单Marker符号</code></a>、
237
237
  <a class="mapgis-link-name" title="SimpleFillSymbol" SimpleFillSymbol.html><code>简单填充符号</code></a>、<a class="mapgis-link-name" title="SimpleLineSymbol" SimpleLineSymbol.html><code>简单线符号</code></a>、<a class="mapgis-link-name" title="TextSymbol" TextSymbol.html><code>文本符号</code></a></p></td>
238
238
  </tr>
@@ -303,6 +303,39 @@ import { Feature } from &quot;@mapgis/webclient-common&quot; <br/>
303
303
 
304
304
 
305
305
 
306
+
307
+ <tr class="deep-level-1">
308
+
309
+ <td class="name"><code>styleInfo</code></td>
310
+
311
+
312
+ <td class="type">
313
+
314
+
315
+ <span class="param-type">
316
+
317
+ Object
318
+
319
+ </span>
320
+
321
+
322
+
323
+
324
+ </td>
325
+
326
+
327
+ <td class="default">
328
+
329
+ </td>
330
+
331
+
332
+ <td class="description last"><p>服务端要素渲染样式,说明如下:<br>
333
+ 1、当使用FeatureServer的查询操作并返回要素时,styleInfo会记录查询到的服务端要素渲染样式
334
+ 2、当执行FeatureServer的要素编辑操作时,设置此参数来更改要素样式,具体参数说明请参考IGS文档</p></td>
335
+ </tr>
336
+
337
+
338
+
306
339
 
307
340
 
308
341
 
@@ -457,7 +490,7 @@ let feature = new Feature({
457
490
 
458
491
  <span class="param-type">
459
492
 
460
- additional
493
+ Object
461
494
 
462
495
  </span>
463
496
 
@@ -542,6 +575,24 @@ default {}</p></code></td>
542
575
  default 随机id</p></code></td>
543
576
  </tr>
544
577
 
578
+ <tr class="deep-level-0">
579
+ <td class="name"><code><a href="#styleInfo">styleInfo</a></code></td>
580
+ <td class="name">
581
+ <code>
582
+
583
+ <span class="param-type">
584
+
585
+ Object
586
+
587
+ </span>
588
+
589
+
590
+
591
+ </code>
592
+ </td>
593
+ <td class="name"><code><p>服务端要素的样式,用于IGS的要素编辑操作,具体参数说明请参考IGS文档</p></code></td>
594
+ </tr>
595
+
545
596
  <tr class="deep-level-0">
546
597
  <td class="name"><code><a href="#symbol">symbol</a></code></td>
547
598
  <td class="name">
@@ -610,7 +661,7 @@ default = true</p></code></td>
610
661
 
611
662
  <span class="param-type">
612
663
 
613
- additional
664
+ Object
614
665
 
615
666
  </span>
616
667
 
@@ -961,6 +1012,81 @@ default 随机id</p>
961
1012
 
962
1013
 
963
1014
 
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+ </dl>
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+ </div>
1033
+
1034
+ <div class="member">
1035
+
1036
+ <span class="method-parameter is-pulled-right">
1037
+ <label>类型:</label>
1038
+
1039
+ <span class="param-type">
1040
+
1041
+ Object
1042
+
1043
+ </span>
1044
+
1045
+
1046
+
1047
+ </span>
1048
+
1049
+ <h4 class="name" id="styleInfo">
1050
+ <a class="href-link" href="#styleInfo">#</a>
1051
+
1052
+ <span class="code-name">
1053
+ styleInfo
1054
+ </span>
1055
+
1056
+ </h4>
1057
+
1058
+
1059
+
1060
+
1061
+ <div class="description">
1062
+ <p>服务端要素的样式,用于IGS的要素编辑操作,具体参数说明请参考IGS文档</p>
1063
+ </div>
1064
+
1065
+
1066
+
1067
+
1068
+
1069
+ <dl class="details">
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+
964
1090
 
965
1091
 
966
1092
 
@@ -2142,7 +2142,7 @@ const lineString = new Feature({
2142
2142
  //可填空或者和数据库中的表结构一一对应
2143
2143
  attributes: {},
2144
2144
  //可填空或者和系统库中的样式一一对应
2145
- symbol: {},
2145
+ styleInfo: {},
2146
2146
  //设置几何
2147
2147
  geometry: new zondy.geometry.LineString({
2148
2148
  coordinates: [
@@ -2206,21 +2206,7 @@ resourceServer.queryGDBPInfo({
2206
2206
  "mpLayer": "0"
2207
2207
  },
2208
2208
  //设置样式
2209
- symbol: {
2210
- SymID": 43,
2211
- SymHeight": 3.200000047683716,
2212
- SymWidth": 3.200000047683716,
2213
- Angle": 0,
2214
- Color": 1467,
2215
- Color1": 4,
2216
- Color2": 3,
2217
- Space": 1,
2218
- OutPenW": [
2219
- 0.1,
2220
- 0.05,
2221
- 0.05
2222
- ]
2223
- }
2209
+ styleInfo: {}
2224
2210
  })
2225
2211
  // 创建新增要素的结构体
2226
2212
  const featureSet = {
@@ -2285,21 +2271,7 @@ resourceServer.queryGDBPInfo({
2285
2271
  "mpLayer": "0"
2286
2272
  },
2287
2273
  // 设置样式
2288
- symbol: {
2289
- "SymID": 43,
2290
- "SymHeight": 3.200000047683716,
2291
- "SymWidth": 3.200000047683716,
2292
- "Angle": 0,
2293
- "Color": 1467,
2294
- "Color1": 4,
2295
- "Color2": 3,
2296
- "Space": 1,
2297
- "OutPenW": [
2298
- 0.1,
2299
- 0.05,
2300
- 0.05
2301
- ]
2302
- }
2274
+ styleInfo: {}
2303
2275
  })
2304
2276
 
2305
2277
  // 创建新增要素的结构体
@@ -6941,8 +6913,6 @@ import { Feature } from "@mapgis/webclient-common"
6941
6913
  const lineString = new Feature({
6942
6914
  // 更新要素时需要传一个FID来指定要素,其他的属性值可以根据需求来盖面
6943
6915
  attributes: { FID:'0' },
6944
- // 更新样式
6945
- symbol: {},
6946
6916
  // 更新几何,注意几何一定要是GDBP表对应的几何类型
6947
6917
  geometry: new LineString({
6948
6918
  coordinates: [
@@ -7001,22 +6971,6 @@ resourceServer.queryGDBPInfo({
7001
6971
  "CODE": "1",
7002
6972
  "NAME": "新的神龙架林区",
7003
6973
  "mpLayer": "0"
7004
- },
7005
- //更新样式
7006
- symbol: {
7007
- SymID": 43,
7008
- SymHeight": 3.200000047683716,
7009
- SymWidth": 3.200000047683716,
7010
- Angle": 0,
7011
- Color": 1467,
7012
- Color1": 4,
7013
- Color2": 3,
7014
- Space": 1,
7015
- OutPenW": [
7016
- 0.1,
7017
- 0.05,
7018
- 0.05
7019
- ]
7020
6974
  }
7021
6975
  })
7022
6976
  // 创建更新要素的结构体
@@ -7081,22 +7035,6 @@ resourceServer.queryGDBPInfo({
7081
7035
  "CODE": "0",
7082
7036
  "Name": "多点",
7083
7037
  "mpLayer": "0"
7084
- },
7085
- // 更新样式
7086
- symbol: {
7087
- "SymID": 43,
7088
- "SymHeight": 3.200000047683716,
7089
- "SymWidth": 3.200000047683716,
7090
- "Angle": 0,
7091
- "Color": 1467,
7092
- "Color1": 4,
7093
- "Color2": 3,
7094
- "Space": 1,
7095
- "OutPenW": [
7096
- 0.1,
7097
- 0.05,
7098
- 0.05
7099
- ]
7100
7038
  }
7101
7039
  })
7102
7040
 
@@ -7129,6 +7067,87 @@ resourceServer.queryGDBPInfo({
7129
7067
  })</code></pre>
7130
7068
 
7131
7069
 
7070
+ <p class="code-caption"><h5>更新要素样式</h5></p>
7071
+
7072
+
7073
+ <pre class="prettyprint"><code>// ES5引入方式
7074
+ const { ResourceServer, FeatureServer } = zondy.service
7075
+ const { Polygon } = zondy.geometry
7076
+ const { Feature } = zondy
7077
+ // ES6引入方式
7078
+ import { ResourceServer, FeatureServer, Polygon, Feature } from "@mapgis/webclient-common"
7079
+
7080
+ // 初始化资源服务对象
7081
+ const resourceServer = new ResourceServer({
7082
+ url: 'http://{ip}:{port}/igs/rest/services/system/ResourceServer'
7083
+ })
7084
+
7085
+ // 初始化要素服务对象
7086
+ const featureServer = new FeatureServer({
7087
+ url: 'http://{ip}:{port}/igs/rest/services/{要素服务名}/FeatureServer'
7088
+ })
7089
+
7090
+ // 查询要素图层信息
7091
+ featureServer.queryLayerInfo({
7092
+ // 要素图层ID
7093
+ layerId: '0'
7094
+ }).then(function (layerInfo) {
7095
+ // 通过gdbp地址查询系统库
7096
+ resourceServer.queryTempDataInfo({
7097
+ // gdbp地址
7098
+ url: layerInfo.data.url
7099
+ }).then(function (tempDataInfo) {
7100
+ // 获取系统库名称
7101
+ const systemLibGuid = tempDataInfo.data.systemLibGuid
7102
+ // 查询要素
7103
+ featureServer.queryFeaturesInLayers({
7104
+ // 图层id
7105
+ layerId: '0',
7106
+ // 返回要素样式
7107
+ returnStyle: true
7108
+ }).then(function (featureInfo) {
7109
+ // 获取要素
7110
+ const featureData = featureInfo.data.layers[0].features[0]
7111
+ // 当通过颜色查找色号时,MapGIS桌面会通过颜色值的模糊匹配去查找色号,两个不同的颜色,查找出的色号可能会一样,因此无法通过颜色查找色号
7112
+ // 因此推荐用户通过querySystemColorList查询到指定系统库的颜色列表,然后再前端根据自己的项目实际情况,写一个调色板来选择色号,注意该接口需要设置翻页参数
7113
+ // 此步骤是可选项,也可以像下方代码,直接更改色号
7114
+ resourceServer.querySystemColorList({
7115
+ // 系统库ID
7116
+ sysLib: systemLibGuid,
7117
+ // 查询第几页
7118
+ page: 1,
7119
+ // 每页数量
7120
+ pageSize: 20,
7121
+ }).then(function (colorList) {
7122
+ console.log("色号列表:", colorList)
7123
+ })
7124
+ // 直接更改色号
7125
+ featureData.styleInfo.fillColor = 112
7126
+ // 构造要更新的要素对象
7127
+ const feature = new Feature({
7128
+ // 更新属性,可以更新部分属性,但是FID是必选项,{FID:'xxx'}
7129
+ attributes: featureData.attributes,
7130
+ // 更新几何,必须更新几何
7131
+ geometry: new Polygon({
7132
+ coordinates: featureData.geometry.coordinates
7133
+ }),
7134
+ // 更新样式,可选项
7135
+ styleInfo: featureData.styleInfo
7136
+ })
7137
+ // 更新要素对象
7138
+ featureServer.updateFeature({
7139
+ // 请求方式
7140
+ method: 'POST',
7141
+ // 要更新的图层ID
7142
+ layerId: '0',
7143
+ // 要更新要素对象
7144
+ features: [feature]
7145
+ })
7146
+ })
7147
+ })
7148
+ })</code></pre>
7149
+
7150
+
7132
7151
 
7133
7152
  </div>
7134
7153
 
@@ -354,7 +354,7 @@ if(layer.loadStatus === 'loaded') {<br/>
354
354
  </td>
355
355
 
356
356
 
357
- <td class="description last"><p>渲染模式,分为客户端渲染'client'和服务器端渲染'server'</p></td>
357
+ <td class="description last"><p>渲染模式,分为客户端渲染'client'和服务器端渲染'server',目前仅当gdbp存在时,server模式生效。</p></td>
358
358
  </tr>
359
359
 
360
360
 
@@ -472,7 +472,7 @@ import { SpatialReference } from &quot;@mapgis/webclient-common&quot; <br/>
472
472
  zondy.Feature() <br/>
473
473
  [ES6引入方式]:<br/>
474
474
  import { Feature } from &quot;@mapgis/webclient-common&quot; <br/>
475
- <br/></p></span></li><div class="mapgis-link-detail" id="Feature-detail"><div><a linkTo="#page-title" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold">构造函数</a></div><div><a linkTo="#function" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold" class="mapgis-link-name">方法</a></div><div><ul><li><a linkTo="#fromJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="fromJSON" id="api-member" class="mapgis-link-name">fromJSON</a></li><li><a linkTo="#clone" link="/static/modules/common/api/common-mapgis/Feature.html" title="clone" id="api-member" class="mapgis-link-name">clone</a></li><li><a linkTo="#fromGeoJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="fromGeoJSON" id="api-member" class="mapgis-link-name">fromGeoJSON</a></li><li><a linkTo="#toAttValue" link="/static/modules/common/api/common-mapgis/Feature.html" title="toAttValue" id="api-member" class="mapgis-link-name">toAttValue</a></li><li><a linkTo="#toFType" link="/static/modules/common/api/common-mapgis/Feature.html" title="toFType" id="api-member" class="mapgis-link-name">toFType</a></li><li><a linkTo="#toGeoJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="toGeoJSON" id="api-member" class="mapgis-link-name">toGeoJSON</a></li><li><a linkTo="#toGraphicInfo" link="/static/modules/common/api/common-mapgis/Feature.html" title="toGraphicInfo" id="api-member" class="mapgis-link-name">toGraphicInfo</a></li><li><a linkTo="#toIGSFeature" link="/static/modules/common/api/common-mapgis/Feature.html" title="toIGSFeature" id="api-member" class="mapgis-link-name">toIGSFeature</a></li><li><a linkTo="#toJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="toJSON" id="api-member" class="mapgis-link-name">toJSON</a></li><li><a linkTo="#toOldIGSFeature" link="/static/modules/common/api/common-mapgis/Feature.html" title="toOldIGSFeature" id="api-member" class="mapgis-link-name">toOldIGSFeature</a></li></ul></div><div><a linkTo="#member" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold" class="mapgis-link-name">成员变量</a></div><div><ul><li><a linkTo="#additional" link="/static/modules/common/api/common-mapgis/Feature.html" title="additional" id="api-member" class="mapgis-link-name">additional</a></li><li><a linkTo="#attributes" link="/static/modules/common/api/common-mapgis/Feature.html" title="attributes" id="api-member" class="mapgis-link-name">attributes</a></li><li><a linkTo="#elevationInfo" link="/static/modules/common/api/common-mapgis/Feature.html" title="elevationInfo" id="api-member" class="mapgis-link-name">elevationInfo</a></li><li><a linkTo="#geometry" link="/static/modules/common/api/common-mapgis/Feature.html" title="geometry" id="api-member" class="mapgis-link-name">geometry</a></li><li><a linkTo="#id" link="/static/modules/common/api/common-mapgis/Feature.html" title="id" id="api-member" class="mapgis-link-name">id</a></li><li><a linkTo="#symbol" link="/static/modules/common/api/common-mapgis/Feature.html" title="symbol" id="api-member" class="mapgis-link-name">symbol</a></li><li><a linkTo="#type" link="/static/modules/common/api/common-mapgis/Feature.html" title="type" id="api-member" class="mapgis-link-name">type</a></li><li><a linkTo="#visible" link="/static/modules/common/api/common-mapgis/Feature.html" title="visible" id="api-member" class="mapgis-link-name">visible</a></li></ul></div></div><li class="mapgis-link"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a class="mapgis-link-name" link="/static/modules/common/api/common-mapgis/FeatureSet.html"id="FeatureSet" title="FeatureSet" FeatureSet.html>FeatureSet</a><img id="FeatureSet-detail-arrow" onclick="toggleLinkDetail('FeatureSet-detail')" style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/up-arrow.png" alt=""><span style="display: none;"><p>要素集合类,示例如下:<a id='add-FeatureSet'>[初始化要素集合对象]</a>
475
+ <br/></p></span></li><div class="mapgis-link-detail" id="Feature-detail"><div><a linkTo="#page-title" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold">构造函数</a></div><div><a linkTo="#function" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold" class="mapgis-link-name">方法</a></div><div><ul><li><a linkTo="#fromJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="fromJSON" id="api-member" class="mapgis-link-name">fromJSON</a></li><li><a linkTo="#clone" link="/static/modules/common/api/common-mapgis/Feature.html" title="clone" id="api-member" class="mapgis-link-name">clone</a></li><li><a linkTo="#fromGeoJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="fromGeoJSON" id="api-member" class="mapgis-link-name">fromGeoJSON</a></li><li><a linkTo="#toAttValue" link="/static/modules/common/api/common-mapgis/Feature.html" title="toAttValue" id="api-member" class="mapgis-link-name">toAttValue</a></li><li><a linkTo="#toFType" link="/static/modules/common/api/common-mapgis/Feature.html" title="toFType" id="api-member" class="mapgis-link-name">toFType</a></li><li><a linkTo="#toGeoJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="toGeoJSON" id="api-member" class="mapgis-link-name">toGeoJSON</a></li><li><a linkTo="#toGraphicInfo" link="/static/modules/common/api/common-mapgis/Feature.html" title="toGraphicInfo" id="api-member" class="mapgis-link-name">toGraphicInfo</a></li><li><a linkTo="#toIGSFeature" link="/static/modules/common/api/common-mapgis/Feature.html" title="toIGSFeature" id="api-member" class="mapgis-link-name">toIGSFeature</a></li><li><a linkTo="#toJSON" link="/static/modules/common/api/common-mapgis/Feature.html" title="toJSON" id="api-member" class="mapgis-link-name">toJSON</a></li><li><a linkTo="#toOldIGSFeature" link="/static/modules/common/api/common-mapgis/Feature.html" title="toOldIGSFeature" id="api-member" class="mapgis-link-name">toOldIGSFeature</a></li></ul></div><div><a linkTo="#member" link="/static/modules/common/api/common-mapgis/Feature.html" id="api-fold" class="mapgis-link-name">成员变量</a></div><div><ul><li><a linkTo="#additional" link="/static/modules/common/api/common-mapgis/Feature.html" title="additional" id="api-member" class="mapgis-link-name">additional</a></li><li><a linkTo="#attributes" link="/static/modules/common/api/common-mapgis/Feature.html" title="attributes" id="api-member" class="mapgis-link-name">attributes</a></li><li><a linkTo="#elevationInfo" link="/static/modules/common/api/common-mapgis/Feature.html" title="elevationInfo" id="api-member" class="mapgis-link-name">elevationInfo</a></li><li><a linkTo="#geometry" link="/static/modules/common/api/common-mapgis/Feature.html" title="geometry" id="api-member" class="mapgis-link-name">geometry</a></li><li><a linkTo="#id" link="/static/modules/common/api/common-mapgis/Feature.html" title="id" id="api-member" class="mapgis-link-name">id</a></li><li><a linkTo="#styleInfo" link="/static/modules/common/api/common-mapgis/Feature.html" title="styleInfo" id="api-member" class="mapgis-link-name">styleInfo</a></li><li><a linkTo="#symbol" link="/static/modules/common/api/common-mapgis/Feature.html" title="symbol" id="api-member" class="mapgis-link-name">symbol</a></li><li><a linkTo="#type" link="/static/modules/common/api/common-mapgis/Feature.html" title="type" id="api-member" class="mapgis-link-name">type</a></li><li><a linkTo="#visible" link="/static/modules/common/api/common-mapgis/Feature.html" title="visible" id="api-member" class="mapgis-link-name">visible</a></li></ul></div></div><li class="mapgis-link"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a class="mapgis-link-name" link="/static/modules/common/api/common-mapgis/FeatureSet.html"id="FeatureSet" title="FeatureSet" FeatureSet.html>FeatureSet</a><img id="FeatureSet-detail-arrow" onclick="toggleLinkDetail('FeatureSet-detail')" style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/up-arrow.png" alt=""><span style="display: none;"><p>要素集合类,示例如下:<a id='add-FeatureSet'>[初始化要素集合对象]</a>
476
476
  <br><br>[ES5引入方式]:<br/>
477
477
  zondy.FeatureSet() <br/>
478
478
  [ES6引入方式]:<br/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapgis/webclient-common",
3
- "version":"17.2.7",
3
+ "version":"17.2.8",
4
4
  "description": "mapgis ES6 format for igserver",
5
5
  "main": "dist/webclient-common-es6.min.js",
6
6
  "scripts": {},