crs

Available for:Map Panel

Coordinate Reference System

The crs interface manages coordinate reference system. It provides methods to change operating CRS as well as transform coordinates between different coordinate systems. Application API does not provide the concept of registering coordinate systems as it operates directly on the CRS definitions provided. Currently it does not support code mappings.

Methods

Name Summary
equal

Returns true if crs codes are equal.

getCurrent

Returns current CRS

register

For compatibility, this method always returns the success callback in the Application API.

setCurrent

Sets current map CRS

transform

Transform coordinates

Methods • Details

equal(crs1, crs2) → {Boolean}

Available for:Map Panel

Returns true if crs codes are equal. Application API in this version doesn't support CRS code mappings and returns true only if the codes are the same strings.

Parameters

Name Type Description
crs1 String

First crs to compare

crs2 String

Second crs to compare

Returns

TypeDescription
Boolean

Returns true if codes are equal

getCurrent() → {String}

Available for:Map Panel

Returns current CRS

Returns

TypeDescription
String

current CRS

register(config, callback) → {void}

deprecated
Available for:Map Panel

For compatibility, this method always returns the success callback in the Application API.

Parameters

Name Type Description
config Object|String
{
 "code": String
}

Configuration parameters or CRS code as String

code optional

Code to register

callback

Callback exectuted on success.

Returns

TypeDescription
void

setCurrent(config, callback, errback) → {void}

Available for:Map Panel

Sets current map CRS

Parameters

Name Type Description
config Object|String
{
 "code": String
}

Configuration parameters or CRS code as String

code

CRS code to set

callback optional

Callback exectuted on success

errback optional

Callback exectuted on failure

Returns

TypeDescription
void

transform(config, callback, errback) → {void}

Available for:Map Panel

Transform coordinates

Parameters

Name Type Description
config Object
{
 "sourceCrsId": String,
 "targetCrsId": String,
 "sourceCrsFixedAxesEnu": Boolean,
 "targetCrsFixedAxesEnu": Boolean,
 "sourceCrsFixedAxes": Boolean,
 "targetCrsFixedAxes": Boolean,
 "points": Array
}

Configuration parameters

sourceCrsId optional

Source CRS identifier. If not provided, current map CRS identifier will be used

targetCrsId optional

Destination CRS identifier. If not provided, current map CRS identifier will be used

sourceCrsFixedAxesEnu optional

Default value: true.

Indicates that provided point has fixed axes - x is easting coordinate and y is the northing coordinate

targetCrsFixedAxesEnu optional

Default value: true.

Indicates that transformed point has fixed axes - x is easting coordinate and y is the northing coordinate

sourceCrsFixedAxes optional

Fixed axes order of source CRS

targetCrsFixedAxes optional

Fixed axes order of target CRS

points

Array of points objects {x, y} (by default referring to the following coordinates: x - easting, y - northing)

callback optional

Callback exectuted on success

errback optional

Callback exectuted on failure

Returns

TypeDescription
void