# Class: SpaProjection

## SpaProjection()

#### new SpaProjection()

空间投影

Source:
  - SpaProjection.js, line 11

### Methods

#### (async, static) createObj() → {Promise.<SpaProjection>}

构造一个新的 SpaProjection 对象。

Source:
  - SpaProjection.js, line 21

##### Returns:

Type
  Promise.<SpaProjection>

#### (async, static) getDestinationPara() → {Promise.<SRefData>}

取目标投影参数

Source:
  - SpaProjection.js, line 87

##### Returns:

目标投影参数

Type
  Promise.<SRefData>

#### (async, static) getEllipTransId() → {Promise.<int>}

获得椭球坐标系变换参数的索引

Source:
  - SpaProjection.js, line 138
See:
  - ElpTransformation

##### Returns:

椭球坐标系变换参数的索引

Type
  Promise.<int>

#### (async, static) getSourcePara() → {Promise.<SRefData>}

取源投影参数

Source:
  - SpaProjection.js, line 54

##### Returns:

源投影参数

Type
  Promise.<SRefData>

#### (async, static) lonLat2Mercator(dot) → {Promise.<void>}

WGS84 （度）到 web墨卡托投影（米）

##### Parameters:

Name | Type | Description
--- | --- | ---
`dot` | Dot | 点坐标

Source:
  - SpaProjection.js, line 166

##### Returns:

Type
  Promise.<void>

#### (async, static) mercator2LonLat(dot) → {Promise.<void>}

web墨卡托投影（米）到 WGS84（度）

##### Parameters:

Name | Type | Description
--- | --- | ---
`dot` | Dot | 点坐标

Source:
  - SpaProjection.js, line 180

##### Returns:

Type
  Promise.<void>

#### (async, static) projTrans(xy) → {Promise.<int>}

单点投影

##### Parameters:

Name | Type | Description
--- | --- | ---
`xy` | Dot | 点坐标

Source:
  - SpaProjection.js, line 152

##### Returns:

>0成功； <=0-失败

Type
  Promise.<int>

#### (async, static) setDestinationPara(sRef) → {Promise.<int>}

设置目标投影参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`sRef` | SRefData | 目标投影参数

Source:
  - SpaProjection.js, line 71

##### Returns:

>0成功； <=0-失败

Type
  Promise.<int>

#### (async, static) setEllipTransId(transID) → {Promise.<int>}

设置椭球坐标系变换参数的索引，当投影前后椭球体不一样时，必须设置椭球坐标系变换参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`transID` | int | 椭球坐标系变换参数的索引,从0开始

Source:
  - SpaProjection.js, line 107
See:
  - ElpTransformation

##### Returns:

>0成功； <=0-失败

Type
  Promise.<int>

#### (async, static) setEllipTransParam(param) → {Promise.<int>}

设置椭球坐标系变换参数，当投影前后椭球体不一样时，必须设置椭球坐标系变换参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`param` | ElpTransParam | 椭球坐标系变换参数

Source:
  - SpaProjection.js, line 121

##### Returns:

>0成功； <=0-失败

Type
  Promise.<int>

#### (async, static) setSourcePara(sRef) → {Promise.<int>}

设置源投影参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`sRef` | SRefData | 源投影参数

Source:
  - SpaProjection.js, line 38

##### Returns:

>0成功； <=0-失败

Type
  Promise.<int>