A standalone point geometry with useful accessor, comparison, and modification methods.
调用方法:
var point = new Point(-77, 38);
参数描述:
名称 | 类型 | 描述 |
---|---|---|
x |
Number | the x-coordinate. this could be longitude or screen pixels, or any other sort of unit. |
y |
Number | the y-coordinate. this could be latitude or screen pixels, or any other sort of unit. |
属性
海拔高度
方法
Construct a point from an array if necessary, otherwise if the input is already a Point, or an unknown type, return it unchanged
static SmartEarth.Point.convert(a) → Point
调用方法:
// this
var point = Point.convert([0, 1]);
// is equivalent to
var point = new Point(0, 1);
参数描述:
名称 | 类型 | 描述 |
---|---|---|
a |
Array.<Number> | Point | * | any kind of input value |
返回:
constructed point, or passed-through value.
Add this point's x & y coordinates to another point, yielding a new point.
add(p) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
output point
Get the angle from the 0, 0 coordinate to this point, in radians coordinates.
返回:
angle
Get the angle from this point to another point, in radians
参数描述:
名称 | 类型 | 描述 |
---|---|---|
b |
Point | the other point |
返回:
angle
Get the angle between this point and another point, in radians
参数描述:
名称 | 类型 | 描述 |
---|---|---|
b |
Point | the other point |
返回:
angle
Clone this point, returning a new point that can be modified without affecting the old one.
clone() → Point
返回:
the clone
向三维场景中添加一个兴趣点。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
name |
String | 可选 名称 |
position |
Array | 可选 一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String | Int | 可选 线的颜色。 |
向三维场景中添加一个兴趣点。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
name |
String | 可选 名称 |
position |
Array | 可选 一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String | Int | 可选 线的颜色。 |
返回:
返回一个Cesium的对象。
点击获取坐标点的经纬度。
向三维场景中添加一个点。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
position |
Array | 可选 一个经纬度数组 例如:[x, y, z]。 |
fillColor |
String | 可选 线的颜色。 |
返回:
返回一个Cesium的对象。
向三维场景中添加一个点动态创建(优化)。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
method |
object | 可选 回调函数 |
返回:
返回一个Cesium的对象。
向三维场景中添加一个点。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
position |
Array | 可选 一个经纬度数组 例如:[x, y, z]。 |
fillColor |
String | 可选 线的颜色。 |
返回:
返回一个Cesium的对象。
添加一个富文本点。
createRichTextPoint(Content, position, option) → Point
调用方法:
var RichTextPoint = sgworld.Creator.createRichTextPoint('泰瑞天际', [120, 30.004], {
fontColor: '#ffff00',
fontSize: 18
}, '0');
参数描述:
名称 | 类型 | 描述 | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Content |
String | 可选 内容。 | ||||||||||||||||||||||||||||||||||||
position |
Array | Object | 可选 一个经纬度数组或对象 例如:[112, 32, 50]或{x:112,y:32,z:50}。 | ||||||||||||||||||||||||||||||||||||
option |
Object | Cesium.BillboardGraphics.ConstructorOptions |
可选
参数
|
返回:
返回一个Point的对象。
删除Point
Calculate the distance from this point to another point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
distance
Calculate the distance from this point to another point, without the square root step. Useful if you're comparing relative distances.
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
distance
Divide this point's x & y coordinates by a factor, yielding a new point.
div(k) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
k |
Point | factor |
返回:
output point
Divide this point's x & y coordinates by point, yielding a new point.
divByPoint(p) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
output point
Judge whether this point is equal to another point, returning true or false.
参数描述:
名称 | 类型 | 描述 |
---|---|---|
other |
Point | the other point |
返回:
whether the points are equal
向三维场景中添加一个点动态创建。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
method |
object | 可选 回调函数 |
返回:
返回一个Cesium的对象。
向三维场景中添加一个点动态创建。
参数描述:
名称 | 类型 | 描述 |
---|---|---|
method |
object | 可选 回调函数 |
返回:
返回一个Cesium的对象。
point导出工程数据
获取point样式
获取Point的显示隐藏
Return the magitude of this point: this is the Euclidean distance from the 0, 0 coordinate to this point's x and y coordinates.
返回:
magnitude
Multiply this point by a 4x1 transformation matrix
matMult(m) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
m |
Array.<Number> | transformation matrix |
返回:
output point
Multiply this point's x & y coordinates by a factor, yielding a new point.
mult(k) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
k |
Point | factor |
返回:
output point
Multiply this point's x & y coordinates by point, yielding a new point.
multByPoint(p) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
output point
Compute a perpendicular point, where the new y coordinate is the old x coordinate and the new x coordinate is the old y coordinate multiplied by -1
perp() → Point
返回:
perpendicular point
Rotate this point around the 0, 0 origin by an angle a, given in radians
rotate(a) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
a |
Number | angle to rotate around, in radians |
返回:
output point
Rotate this point around p point by an angle a, given in radians
rotateAround(a, p) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
a |
Number | angle to rotate around, in radians |
p |
Point | Point to rotate around |
返回:
output point
Return a version of this point with the x & y coordinates rounded to integers.
round() → Point
返回:
rounded point
设置点的轮廓颜色
参数描述:
名称 | 类型 | 描述 |
---|---|---|
point |
Object | 可选 point对象 |
htmlColor |
htmlColor |
返回:
返回一个point对象。
设置点的填充透明度
参数描述:
名称 | 类型 | 描述 |
---|---|---|
point |
Object | 可选 point对象 |
a |
Float | 可选 透明度 0-1 |
返回:
返回一个point对象。
设置点的填充颜色
参数描述:
名称 | 类型 | 描述 |
---|---|---|
point |
Object | 可选 point对象 |
htmlColor颜色。 |
htmlColor |
返回:
返回一个point对象。
设置点的缓冲区添加
参数描述:
名称 | 类型 | 描述 |
---|---|---|
point |
Object | 可选 point对象 |
线宽。 |
radius |
返回:
返回一个point对象。
设置Point的显示隐藏
参数描述:
名称 | 类型 | 描述 |
---|---|---|
b |
boolean | 可选 true|false |
动态标会 绑定鼠标
Subtract this point's x & y coordinates to from point, yielding a new point.
sub(p) → Point
参数描述:
名称 | 类型 | 描述 |
---|---|---|
p |
Point | the other point |
返回:
output point
Calculate this point but as a unit vector from 0, 0, meaning that the distance from the resulting point to the 0, 0 coordinate will be equal to 1 and the angle from the resulting point to the 0, 0 coordinate will be the same as before.
unit() → Point
返回:
unit vector point