Namespace: ProjectionTransform

ProjectionTransform

坐标转换类(将坐标从一种投影转换到另一种投影)

Example

var transform = new KQCommon.ProjectionTransform('EPSG:4326', 'EPSG:3857');
var pos = transform.transformForward([114.33097, 30.54715]);
console.log("pos:" + pos);
// 12724930.992579103, 3570567.652113043

Methods

KQCommon.ProjectionTransform.constructor(sourProjection, destProjection)

common/core/ProjectionTransform.js, line 24

构造函数

Name Type Description
sourProjection string

原始投影(投影可以是proj或wkt格式的字符串)

destProjection string

目标投影(投影可以是proj或wkt格式的字符串)

KQCommon.ProjectionTransform.setDestProjection(destProjection)

common/core/ProjectionTransform.js, line 45

设置目标投影

Name Type Description
destProjection string

目标投影(投影可以是proj或wkt格式的字符串)

Returns:
none

KQCommon.ProjectionTransform.setSourProjection(sourProjection)

common/core/ProjectionTransform.js, line 35

设置原始投影

Name Type Description
sourProjection string

原始投影(投影可以是proj或wkt格式的字符串)

Returns:
none

KQCommon.ProjectionTransform.transformForward(coordinates){Array}

common/core/ProjectionTransform.js, line 55

坐标转换

Name Type Description
coordinates Array | Object

原始投影的坐标(格式:{x:x,y:y}或[x,y])

Returns:
Type Description
Array 目标投影的坐标(格式:[x,y])

KQCommon.ProjectionTransform.transfromInverse(coordinates){Array}

common/core/ProjectionTransform.js, line 65

坐标反转

Name Type Description
coordinates Array | Object

目标投影的坐标(格式:{x:x,y:y}或[x,y])

Returns:
Type Description
Array 原始投影的坐标(格式:[x,y])