|
| 1 | +/** |
| 2 | + * Class: SuperMap.DatasetInfo |
| 3 | + * 数据集信息类。 |
| 4 | + * 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(grid |
| 5 | + * dataset)和影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。 |
| 6 | + * |
| 7 | + * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合, |
| 8 | + * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集, |
| 9 | + * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。 |
| 10 | + * |
| 11 | + * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD |
| 12 | + * 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。 |
| 13 | + */ |
| 14 | +SuperMap.DatasetInfo = SuperMap.Class({ |
| 15 | + |
| 16 | + /** |
| 17 | + * APIProperty: bounds |
| 18 | + * {<SuperMap.Bounds>} 数据集范围,该字段只读。 |
| 19 | + */ |
| 20 | + bounds: null, |
| 21 | + |
| 22 | + /** |
| 23 | + * APIProperty: dataSourceName |
| 24 | + * {String} 数据源名称,该字段只读。 |
| 25 | + */ |
| 26 | + dataSourceName: null, |
| 27 | + |
| 28 | + /** |
| 29 | + * APIProperty: description |
| 30 | + * {String} 数据集的描述信息。 |
| 31 | + */ |
| 32 | + description: null, |
| 33 | + |
| 34 | + /** |
| 35 | + * APIProperty: encodeType |
| 36 | + * {String} 数据集存储时的压缩编码方式,该字段只读。 |
| 37 | + */ |
| 38 | + encodeType: null, |
| 39 | + |
| 40 | + /** |
| 41 | + * APIProperty: isReadOnly |
| 42 | + * {Boolean} 数据集是否为只读。 |
| 43 | + */ |
| 44 | + isReadOnly: null, |
| 45 | + |
| 46 | + /** |
| 47 | + * APIProperty: name |
| 48 | + * {String} 数据集名称,该字段必须且只读。 |
| 49 | + */ |
| 50 | + name: null, |
| 51 | + |
| 52 | + /** |
| 53 | + * APIProperty: prjCoordSys |
| 54 | + * {<SuperMap.Projection>} 数据集的投影信息。 |
| 55 | + */ |
| 56 | + prjCoordSys: null, |
| 57 | + |
| 58 | + /** |
| 59 | + * APIProperty: tableName |
| 60 | + * {String} 表名,该字段只读。 |
| 61 | + */ |
| 62 | + tableName: null, |
| 63 | + |
| 64 | + /** |
| 65 | + * APIProperty: type |
| 66 | + * {String} 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD |
| 67 | + * 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。 |
| 68 | + */ |
| 69 | + type: null, |
| 70 | + |
| 71 | + /** |
| 72 | + * Constructor: SuperMap.DatasetInfo |
| 73 | + * 数据集信息类构造函数。 |
| 74 | + * |
| 75 | + * Parameters: |
| 76 | + * options - {Object} 参数。 |
| 77 | + * |
| 78 | + * Allowed options properties: |
| 79 | + * bounds - {<SuperMap.Bounds>} 数据集范围,该字段只读。 |
| 80 | + * dataSourceName - {String} 数据源名称,该字段只读。 |
| 81 | + * description - {String} 数据集的描述信息。 |
| 82 | + * encodeType - {String} 数据集存储时的压缩编码方式,该字段只读。 |
| 83 | + * isReadOnly - {Boolean} 数据集是否为只读。 |
| 84 | + * name - {String} 数据集名称,该字段必须且只读。 |
| 85 | + * prjCoordSys - {<SuperMap.Projection>} 数据集的投影信息。 |
| 86 | + * tableName - {String} 表名,该字段只读。 |
| 87 | + * type - {String} 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD |
| 88 | + * 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。 |
| 89 | + */ |
| 90 | + initialize: function (options) { |
| 91 | + options = options || {}; |
| 92 | + SuperMap.Util.extend(this, options); |
| 93 | + var b = this.bounds; |
| 94 | + if (b) { |
| 95 | + this.bounds = new SuperMap.Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y); |
| 96 | + } |
| 97 | + }, |
| 98 | + |
| 99 | + /** |
| 100 | + * APIMethod: destroy |
| 101 | + * 释放资源,将引用资源的属性置空。 |
| 102 | + */ |
| 103 | + destroy: function () { |
| 104 | + SuperMap.Util.reset(this); |
| 105 | + }, |
| 106 | + |
| 107 | + /** |
| 108 | + * Method: toServerJSONObject |
| 109 | + * 转换成对应的 JSON 格式对象。 |
| 110 | + */ |
| 111 | + toServerJSONObject: function () { |
| 112 | + var dataObj = {}; |
| 113 | + dataObj = SuperMap.Util.copyAttributes(dataObj, this); |
| 114 | + if (dataObj.bounds) { |
| 115 | + if (dataObj.bounds.toServerJSONObject) { |
| 116 | + dataObj.bounds = dataObj.bounds.toServerJSONObject(); |
| 117 | + } |
| 118 | + } |
| 119 | + return dataObj; |
| 120 | + }, |
| 121 | + |
| 122 | + CLASS_NAME: "SuperMap.DatasetInfo" |
| 123 | +}); |
| 124 | +module.exports = function (options) { |
| 125 | + return new SuperMap.DatasetInfo(options); |
| 126 | +}; |
0 commit comments