Skip to content

Commit 7651107

Browse files
committed
【API】 优化 geojson链接 & features类型 API review by songym
1 parent ef458d4 commit 7651107

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+229
-156
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var lfapi = "http://leafletjs.com/reference-1.3.1.html";
33
var mbglapi = "https://www.mapbox.com/mapbox-gl-js/api/";
44
var mapv = "https://github.com/huiyan-fe/mapv/blob/master/src/";
55
var classicapi="http://iclient.supermap.io/libs/iclient8c/apidoc/files/SuperMap"
6+
var geojsonapi = "http://geojson.org";
67
var typeLinks = {
78
//openlayers
89
"ol.Map": olapi + "ol.Map.html",
@@ -52,6 +53,8 @@ var typeLinks = {
5253
"L.CircleMarker": lfapi + '#circlemarker',
5354
"L.Path-option": lfapi + '#path-option',
5455
"L.Rectangle": lfapi + '#rectangle',
56+
'L.LatLngBounds': lfapi+ '#latlngbounds',
57+
'L.Map': lfapi + '#map-example',
5558

5659
//mapboxgl
5760
"mapboxgl.Evented": mbglapi + '#Evented',
@@ -62,7 +65,10 @@ var typeLinks = {
6265

6366
//classic
6467
"SuperMap.Layer":classicapi + '/Layer-js.html',
65-
68+
"SuperMap.Layer.Graph": classicapi + '/Layer/Theme/Graph-js.html#SuperMap.Layer.Graph',
69+
70+
//GeoJSON
71+
"GeoJSONObject": geojsonapi
6672

6773
}
6874
exports.typeLinks = typeLinks;

src/classic/overlay/MapVLayer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ export class MapVLayer extends SuperMap.Layer {
2323
super(name, options);
2424

2525
/**
26-
* @member {mapv.DataSet} - SuperMap.Layer.MapVLayer.prototype.dataSet
26+
* @member {mapv.DataSet} SuperMap.Layer.MapVLayer.prototype.dataSet
2727
* @description mapv dataset 对象。
2828
*/
2929
this.dataSet = null;
3030

3131
/**
32-
* @member {Object} - SuperMap.Layer.MapVLayer.prototype.options
32+
* @member {Object} SuperMap.Layer.MapVLayer.prototype.options
3333
* @description mapv 绘图风格配置信息。
3434
*/
3535
this.options = null;
3636

3737
/**
38-
* @member {boolean} - [SuperMap.Layer.MapVLayer.prototype.supported=false]
38+
* @member {boolean} [SuperMap.Layer.MapVLayer.prototype.supported=false]
3939
* @description 当前浏览器是否支持 canvas 绘制。决定了 MapV 图是否可用,内部判断使用。
4040
*/
4141
this.supported = false;
@@ -48,7 +48,7 @@ export class MapVLayer extends SuperMap.Layer {
4848

4949
/**
5050
* @private
51-
* @member {CanvasContext} - SuperMap.Layer.MapVLayer.prototype.canvasContext
51+
* @member {CanvasContext} SuperMap.Layer.MapVLayer.prototype.canvasContext
5252
* @description MapV 图主绘制对象。
5353
*/
5454
this.canvasContext = null;

src/common/format/GeoJSON.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class GeoJSON extends JSONFormat {
183183
/**
184184
* @function SuperMap.Format.GeoJSON.extract.feature
185185
* @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
186-
* @param {Object} feature - iServer 要素对象。
186+
* @param {SuperMap.ServerFeature} feature - iServer 要素对象。
187187
* @returns {Object} 一个表示点的对象。
188188
*/
189189
'feature': function (feature) {
@@ -358,7 +358,7 @@ export class GeoJSON extends JSONFormat {
358358
/**
359359
* @function SuperMap.Format.GeoJSON.prototype.read
360360
* @description 反序列化一个 GeoJSON 字符串。
361-
* @param {string} json - GeoJSON 字符串
361+
* @param {GeoJSONObject} json - GeoJSON 字符串
362362
* @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
363363
* @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
364364
* @returns {Object} 返回值依赖于 type 参数的值。
@@ -475,7 +475,7 @@ export class GeoJSON extends JSONFormat {
475475
/**
476476
* @function SuperMap.Format.GeoJSON.prototype.parseFeature
477477
* @description 将一个 GeoJSON 中的 feature 转化成 {@link SuperMap.Feature.Vector}> 对象。
478-
* @param {Object} obj - 从 GeoJSON 对象中创建一个对象。
478+
* @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
479479
* @returns {SuperMap.Feature.Vector} 一个要素。
480480
*/
481481
parseFeature(obj) {
@@ -502,7 +502,7 @@ export class GeoJSON extends JSONFormat {
502502
/**
503503
* @function SuperMap.Format.GeoJSON.prototype.parseGeometry
504504
* @description 将一个 GeoJSON 中的几何要素转化成 {@link SuperMap.Geometry} 对象。
505-
* @param {Object} obj - 从 GeoJSON 对象中创建一个对象。
505+
* @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
506506
* @returns {SuperMap.Geometry} 一个几何要素。
507507
*/
508508
parseGeometry(obj) {
@@ -544,9 +544,9 @@ export class GeoJSON extends JSONFormat {
544544
/**
545545
* @function SuperMap.Format.GeoJSON.write
546546
* @description 序列化一个要素对象,几何对象,要素对象数组为一个 GeoJSON 字符串。
547-
* @param {Object} obj - 一个 {@link SuperMap.Feature.Vector}> 对象,一个 {@link SuperMap.Geometry} 对象或者一个要素对象数组。
547+
* @param {Object} obj - 一个 {@link SuperMap.Feature.Vector} 对象,一个 {@link SuperMap.Geometry} 对象或者一个要素对象数组。
548548
* @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
549-
* @returns {string} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
549+
* @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
550550
*/
551551
write(obj, pretty) {
552552
var geojson = {
@@ -584,7 +584,7 @@ export class GeoJSON extends JSONFormat {
584584
* @function SuperMap.Format.GeoJSON.createCRSObject
585585
* @description 从一个要素对象中创建一个坐标参考系对象。
586586
* @param {SuperMap.Feature.Vector} object - 要素对象。
587-
* @returns {Object} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
587+
* @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
588588
*/
589589
createCRSObject(object) {
590590
var proj = object.layer.projection.toString();

src/common/iServer/DataFlowService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export class DataFlowService extends CommonServiceBase {
8686

8787
/**
8888
* @function SuperMap.DataFlowService.prototype.broadcast
89-
* @description 加载广播数据
90-
* @param {Object} geoJSONFeature - JSON 格式的要素数据
89+
* @description 加载广播数据
90+
* @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据
9191
*/
9292
broadcast(geoJSONFeature) {
9393
if (!this.broadcastWebSocket||!this.broadcastWebSocket.isOpen) {

src/common/iServer/EditFeaturesParameters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {ServerGeometry} from './ServerGeometry';
1212
* @classdesc 数据服务中数据集添加、修改、删除参数类。
1313
* @category iServer Data
1414
* @param {Object} options - 参数。
15-
* @param {Array.<SuperMap.Feature.Vector|GeoJSON|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
15+
* @param {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
1616
* @param {boolean} [options.returnContent=false] - 是返回创建要素的 ID 数组还是返回 featureResult 资源的 URI。
1717
* @param {SuperMap.EditType} [options.editType=SuperMap.EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
1818
* @param {Array.<string|integer>} [options.IDs] - 删除要素时的要素的 ID 数组。
@@ -34,7 +34,7 @@ export class EditFeaturesParameters {
3434
this.dataSetName = null;
3535

3636
/**
37-
* @member {Array.<SuperMap.Feature.Vector|GeoJSON|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
37+
* @member {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
3838
* @description 当前需要创建或者是修改的要素集。
3939
*/
4040
this.features = null;

src/common/iServer/GeometryOverlayAnalystParameters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {ServerGeometry} from './ServerGeometry';
1414
* @param {Object} options - 参数。
1515
* @param {Object} options.operateGeometry - 叠加分析的操作几何对象。 </br>
1616
* 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Point}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
17-
* 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|GeoJSON。</br>
18-
* 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|GeoJSON
17+
* 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。</br>
18+
* 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}
1919
* @param {Object} options.sourceGeometry - 叠加分析的源几何对象。
2020
* @param {Array.<Object>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
2121
* @param {Array.<Object>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。

src/common/iServer/NetworkAnalystServiceBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class NetworkAnalystServiceBase extends CommonServiceBase {
5959
* @function SuperMap.NetworkAnalystServiceBase.prototype.toGeoJSONResult
6060
* @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
6161
* @param {Object} result - 服务器返回的结果对象。
62-
* @returns {Object} GeoJSON 对象。
62+
* @returns {GeoJSONObject} GeoJSON 对象。
6363
*/
6464
toGeoJSONResult(result) { // eslint-disable-line no-unused-vars
6565
return null;

src/common/overlay/ThemeVector.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,49 +52,49 @@ export class ThemeVector extends Theme {
5252
}
5353

5454
/**
55-
* @member {SuperMap.Bounds} - SuperMap.Feature.Theme.Vector.prototype.dataBounds
55+
* @member {SuperMap.Bounds} [SuperMap.Feature.Theme.Vector.prototype.dataBounds]
5656
* @description 用户数据的(feature.geometry)地理范围。
5757
*/
5858
this.dataBounds = data.geometry.getBounds();
5959

6060
/**
61-
* @member {number} - [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
61+
* @member {number} [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
6262
* @description 节点抽稀像素距离。
6363
*/
6464
this.nodesClipPixel = 2;
6565

6666
/**
67-
* @member {boolean} - [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
67+
* @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
6868
* @description 图形是否可 hover。
6969
*/
7070
this.isHoverAble = true;
7171

7272
/**
73-
* @member {boolean} - [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
73+
* @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
7474
* @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
7575
*/
7676
this.isMultiHover = true;
7777

7878
/**
79-
* @member {boolean} - [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
79+
* @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
8080
* @description 图形是否可点击。
8181
*/
8282
this.isClickAble = true;
8383

8484
/**
85-
* @member {Object} - [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
85+
* @member {Object} [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
8686
* @description 高亮样式。
8787
*/
8888
this.highlightStyle = null;
8989

9090
/**
91-
* @member {Object} - SuperMap.Feature.Theme.Vector.prototype.shapeOptions
91+
* @member {Object} [SuperMap.Feature.Theme.Vector.prototype.shapeOptions]
9292
* @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
9393
*/
9494
this.shapeOptions = {};
9595

9696
/**
97-
* @member {Object} - SuperMap.Feature.Theme.Vector.prototype.style
97+
* @member {Object} [SuperMap.Feature.Theme.Vector.prototype.style]
9898
* @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
9999
*/
100100
this.style = style || {};

0 commit comments

Comments
 (0)