Summary
Constructor
new Offset(x, y, z)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
x |
Number | 0 | 在经线方向上的偏移量 |
y |
Number | 0 | 在纬线方向上的偏移量 |
z |
Number | 0 | 在高程方向上的偏移量 |
Example
let offset = new hmap.basetype.Offset(1,2,3);
Methods
-
clone() → {module:basetype~Offset}
-
克隆方法
Example
let newOffset = offset.clone();
-
getValue(axis) → {Number|undefined}
-
返回某个坐标轴方向上的偏移值.
Parameters:
Name Type Description axis
String x、y、z三个坐标轴之一。不区分大小写
Returns:
Number | undefined -偏移值或undefined,当传入的参数不是x、y或z时
Example
let value = offset.getValue("x");
-
setValue(axis, val)
-
设置某坐标轴方向上的偏移量
如果坐标轴不在限定值之内,则此方法不生效。Parameters:
Name Type Description axis
String x、y、z三者之一,不区分大小写
val
Number 设置某个坐标轴方向上的偏移量
Example
offset.setValue("y",10);
-
toString() → {String}
-
获取字符串格式的偏移量
Returns:
String -偏移量
Example
let str = offset.toString();