Class Projection

Index

Constructor methods

Methods

Constructor methods

constructor(projCode: string, options?: any): Projection

This class offers several methods for interacting with a wrapped pro4js projection object.

Parameters

  • projCode: string
  • options?: any optional

Returns

Projection

Methods

public addTransform(from: string, to: string, method: () => void)

Set a custom transform method between two projections. Use this method in cases where the proj4js lib is not available or where custom projections need to be handled.

Parameters

  • from: string
  • to: string
  • method: () => void

public getCode(): string

Get the string SRS code.

Returns

string

public getUnits(): string

Get the units string for the projection -- returns null if proj4js is not available.

Returns

string

public nullTransform(point: Object): Function

A null transformation useful for defining projection aliases when proj4js is not available:

Parameters

  • point: Object

Returns

Function

public transform(point: Point, source: Projection, dest: Projection): Object

Transform a point coordinate from one projection to another. Note that the input point is transformed in place.

Parameters

Returns

Object

public transform(point: Object, source: Projection, dest: Projection): Object

Transform a point coordinate from one projection to another. Note that the input point is transformed in place.

Parameters

Returns

Object