forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeature.js
More file actions
59 lines (50 loc) · 1.67 KB
/
Copy pathFeature.js
File metadata and controls
59 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
import {SuperMap} from '../SuperMap';
import {Util} from './Util';
/**
* @class SuperMap.Feature
* @category BaseTypes Geometry
* @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
* @param {SuperMap.Layer} layer - 图层。
* @param {SuperMap.LonLat} lonlat - 经纬度。
* @param {Object} data - 数据对象。
*/
export class Feature {
constructor(layer, lonlat, data) {
this.CLASS_NAME = "SuperMap.Feature";
/**
* @deprecated
* @member {SuperMap.Layer} SuperMap.Feature.prototype.layer
* @description 图层。
*/
this.layer = layer;
/**
* @member {string} SuperMap.Feature.prototype.id
* @description 要素 ID。
*/
this.id = Util.createUniqueID(this.CLASS_NAME + "_");
/**
* @member {SuperMap.LonLat} SuperMap.Feature.prototype.lonlat
* @description 经纬度。
*
*/
this.lonlat = lonlat;
/**
* @member {Object} SuperMap.Feature.prototype.data
* @description 数据对象。
*/
this.data = (data != null) ? data : {};
}
/**
* @function SuperMap.Feature.prototype.destroy
* @description 释放相关资源。
*/
destroy() {
this.id = null;
this.lonlat = null;
this.data = null;
}
}
SuperMap.Feature = Feature;