Skip to content

m-gis核心库 v0.4.4


m-gis核心库 / Position

类: Position ​

定义于: base/Position.ts:16

基类,用于规范传入的坐标格式

const ps = new Position(117.95166139, 38.01728123, 0)

构造函数 ​

构造函数 ​

new Position(lng?, lat?, alt?, heading?, pitch?, roll?): Position

定义于: base/Position.ts:32

参数 ​

lng? ​

number

经度

lat? ​

number

纬度

alt? ​

number

高度

heading? ​

number

俯仰角

pitch? ​

number

偏航角

roll? ​

number

滚转角

返回 ​

Position

属性 ​

_alt ​

_alt: number

定义于: base/Position.ts:19


_heading ​

_heading: number

定义于: base/Position.ts:20


_lat ​

_lat: number

定义于: base/Position.ts:18


_lng ​

_lng: number

定义于: base/Position.ts:17


_pitch ​

_pitch: number

定义于: base/Position.ts:21


_roll ​

_roll: number

定义于: base/Position.ts:22


_type ​

_type: string

定义于: base/Position.ts:23

访问器 ​

alt ​

Getter 签名 ​

get alt(): number

定义于: base/Position.ts:69

返回 ​

number

Setter 签名 ​

set alt(alt): void

定义于: base/Position.ts:65

参数 ​
alt ​

number

返回 ​

void


heading ​

Getter 签名 ​

get heading(): number

定义于: base/Position.ts:77

返回 ​

number

Setter 签名 ​

set heading(heading): void

定义于: base/Position.ts:73

参数 ​
heading ​

number

返回 ​

void


lat ​

Getter 签名 ​

get lat(): number

定义于: base/Position.ts:61

返回 ​

number

Setter 签名 ​

set lat(lat): void

定义于: base/Position.ts:57

参数 ​
lat ​

number

返回 ​

void


lng ​

Getter 签名 ​

get lng(): number

定义于: base/Position.ts:53

返回 ​

number

Setter 签名 ​

set lng(lng): void

定义于: base/Position.ts:49

参数 ​
lng ​

number

返回 ​

void


pitch ​

Getter 签名 ​

get pitch(): number

定义于: base/Position.ts:85

返回 ​

number

Setter 签名 ​

set pitch(pitch): void

定义于: base/Position.ts:81

参数 ​
pitch ​

number

返回 ​

void


roll ​

Getter 签名 ​

get roll(): number

定义于: base/Position.ts:93

返回 ​

number

Setter 签名 ​

set roll(roll): void

定义于: base/Position.ts:89

参数 ​
roll ​

number

返回 ​

void


type ​

Getter 签名 ​

get type(): string

定义于: base/Position.ts:97

返回 ​

string

方法 ​

distance() ​

distance(target): number

定义于: base/Position.ts:118

求距

参数 ​

target ​

Position

返回 ​

number

返回两点距离


serialize() ​

serialize(): string

定义于: base/Position.ts:101

返回 ​

string


toCartesian3() ​

toCartesian3(): Cartesian3

定义于: base/Position.ts:151

转换为Cartesian3

返回 ​

Cartesian3

返回Cartesian3实例


toCartographic() ​

toCartographic(): Cartographic

定义于: base/Position.ts:160

转换为Cartographic

返回 ​

Cartographic

返回Cartographic实例


toNumber() ​

toNumber(val): number

定义于: base/Position.ts:132

deal with illigal input value

参数 ​

val ​

string | number

返回 ​

number


copy() ​

static copy(src): Position

定义于: base/Position.ts:170

复制一个Position示例

参数 ​

src ​

Position

Position实例

返回 ​

Position

position 返回复制的新Position实例


deserialize() ​

static deserialize(valStr): Position

定义于: base/Position.ts:189

反序列化

参数 ​

valStr ​

string

坐标字符串

返回 ​

Position

返回Postion实例


fromCartesian3() ​

static fromCartesian3(data): Position

定义于: base/Position.ts:233

参数 ​

data ​

Cartesian3

返回 ​

Position


fromCoordArray() ​

static fromCoordArray(arr): Position

定义于: base/Position.ts:223

解析数组数据 [lng,lat,alt]=> Position

参数 ​

arr ​

(string | number)[]

坐标数值数组

返回 ​

Position

返回Postion实例


fromCoordString() ​

static fromCoordString(str): Position

定义于: base/Position.ts:209

解析字符串

参数 ​

str ​

string

坐标字符串 "117.90165568,38.05254374,1.94979821"

返回 ​

Position

返回Postion实例

MGis 地理三维库