geovisearth / Exports / GvolPoint
# Class: GvolPoint
@类别 需要用户创建的类
@描述 GvolPoint经纬度坐标对象
提供了经纬度坐标系和各种坐标系之间的相互转换
# Table of contents
# Properties
# Methods
- clone
- formatDegree
- fromCartesian3
- fromGCJ02
- fromMercator
- fromScreen
- isEqual
- isEqualArr
- pack
- packArray
- toCartesian3
- toGCJ02
- toMercator
- toScreen
- unpack
- unpackArray
# Properties
# alt
• alt: any
= 0
高度
# Defined in
Core/GvolPoint.ts:25
# lat
• lat: any
= 0
维度
# Defined in
Core/GvolPoint.ts:21
# lon
• lon: any
= 0
经度
# Defined in
Core/GvolPoint.ts:17
# time
• Optional
time: Date
时间,可选参数
# Defined in
Core/GvolPoint.ts:29
# Methods
# clone
▸ Static
clone(point
, res?
): GvolPoint
深度复制
# Parameters
Name | Type |
---|---|
point | GvolPoint |
res? | GvolPoint |
# Returns
# Defined in
Core/GvolPoint.ts:382
# formatDegree
▸ Static
formatDegree(point
): FormatGvolPoint
度转换度分秒
# Parameters
Name | Type |
---|---|
point | GvolPoint |
# Returns
FormatGvolPoint
# Defined in
Core/GvolPoint.ts:420
# fromCartesian3
▸ Static
fromCartesian3(Cart3Point
): GvolPoint
Cartesian3坐标转GvolPoint(经纬度)坐标
# Parameters
Name | Type |
---|---|
Cart3Point | Cartesian3 |
# Returns
示例代码:
let geoPoint = GVOL.Core.GvolPoint.fromCartesian3(new Cesium.Cartesian3(8065, 3650, 150000))
# Defined in
Core/GvolPoint.ts:92
# fromGCJ02
▸ Static
fromGCJ02(gcjPoint
): GvolPoint
火星坐标转GvolPoint(经纬度)坐标
# Parameters
Name | Type |
---|---|
gcjPoint | any |
# Returns
示例代码:
let geoPoint = GVOL.Core.GvolPoint.fromGCJ02({x:8.013949658676198, y:39.99879386130122})
# Defined in
Core/GvolPoint.ts:221
# fromMercator
▸ Static
fromMercator(x
, y
): GvolPoint
墨卡托坐标转GvolPoint(经纬度)坐标
# Parameters
Name | Type |
---|---|
x | number |
y | number |
# Returns
示例代码:
let geoPoint = GVOL.Core.GvolPoint.fromMercator(8905559.263461886, 4865942.279503175)
# Defined in
Core/GvolPoint.ts:134
# fromScreen
▸ Static
fromScreen(x
, y
, viewer
): GvolPoint
屏幕坐标转GvolPoint(经纬度)坐标(注:屏幕坐标范围必须在地球显示范围内)
# Parameters
Name | Type | Description |
---|---|---|
x | number | 屏幕x轴坐标 |
y | number | 屏幕y轴坐标 |
viewer | Viewer |
# Returns
示例代码:
let mct = GVOL.Core.GvolPoint.fromScreen(50,40,viewer)
# Defined in
Core/GvolPoint.ts:173
# isEqual
▸ Static
isEqual(point1
, point2
): boolean
判断经纬坐标点是否相等
# Parameters
Name | Type |
---|---|
point1 | GvolPoint |
point2 | GvolPoint |
# Returns
boolean
# Defined in
Core/GvolPoint.ts:351
# isEqualArr
▸ Static
isEqualArr(arr1
, arr2
): boolean
判断经纬坐标数组是否相等
# Parameters
Name | Type |
---|---|
arr1 | GvolPoint [] |
arr2 | GvolPoint [] |
# Returns
boolean
# Defined in
Core/GvolPoint.ts:366
# pack
▸ Static
pack(geoPoint
): number
[]
geoPoint转换成数组
# Parameters
Name | Type | Description |
---|---|---|
geoPoint | GvolPoint | 点信息 |
# Returns
number
[]
示例代码:
let res = GVOL.Core.GvolPoint.pack({lon:8,lat:40,alt:5000})
# Defined in
Core/GvolPoint.ts:279
# packArray
▸ Static
packArray(geoPoints
): number
[][]
批量geoPoint转换成数组
# Parameters
Name | Type | Description |
---|---|---|
geoPoints | GvolPoint [] | 点数组信息 |
# Returns
number
[][]
示例代码:
let res = GVOL.Core.GvolPoint.packArray([{lon:8,lat:40,alt:5000},{lon:45,lat:30,alt:55}])
# Defined in
Core/GvolPoint.ts:325
# toCartesian3
▸ Static
toCartesian3(geoPoint
): Cartesian3
GvolPoint(经纬度)坐标转Cartesian3坐标
# Parameters
Name | Type |
---|---|
geoPoint | GvolPoint |
# Returns
Cartesian3
示例代码:
let cart3 = GVOL.Core.GvolPoint.toCartesian3({lon:80,lat:40,alt:50000})
# Defined in
Core/GvolPoint.ts:112
# toGCJ02
▸ Static
toGCJ02(geoPoint
): object
GvolPoint(经纬度)坐标转火星坐标
# Parameters
Name | Type |
---|---|
geoPoint | GvolPoint |
# Returns
object
示例代码:
let gcj = GVOL.Core.GvolPoint.toGCJ02({lon:8,lat:40,alt:5000});
# Defined in
Core/GvolPoint.ts:247
# toMercator
▸ Static
toMercator(geoPoint
): object
GvolPoint(经纬度)坐标转墨卡托坐标
# Parameters
Name | Type |
---|---|
geoPoint | GvolPoint |
# Returns
object
示例代码:
let mct = GVOL.Core.GvolPoint.toMercator({lon:80,lat:40,alt:50000})
# Defined in
Core/GvolPoint.ts:152
# toScreen
▸ Static
toScreen(geoPoint
, viewer
): Cartesian2
GvolPoint(经纬度)坐标转屏幕坐标
# Parameters
Name | Type |
---|---|
geoPoint | GvolPoint |
viewer | Viewer |
# Returns
Cartesian2
示例代码:
let cart2 = GVOL.Core.GvolPoint.toScreen({lon:8,lat:40,alt:5000},viewer)
# Defined in
Core/GvolPoint.ts:201
# unpack
▸ Static
unpack(arr
): GvolPoint
数组转换成geoPoint
# Parameters
Name | Type | Description |
---|---|---|
arr | any | 数组信息 |
# Returns
示例代码:
let res = GVOL.Core.GvolPoint.unpack([50,45,1555])
# Defined in
Core/GvolPoint.ts:298
# unpackArray
▸ Static
unpackArray(arr
): GvolPoint
[]
批量数组转换成geoPoint
# Parameters
Name | Type | Description |
---|---|---|
arr | any | 数组信息 |
# Returns
示例代码:
let res = GVOL.Core.GvolPoint.unpackArray([[50,45,1555],[22,54,4545]])
# Defined in
Core/GvolPoint.ts:340
← GvolEngine Graph →