Interface ICRS

Index

Properties

Methods

Properties

public code: string

Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857').

public projection: IProjection

Projection that this CRS uses.

public transformation: Transformation

Transformation that this CRS uses to turn projected coordinates into screen coordinates for a particular tile service.

Methods

public latLngToPoint(latlng: LatLng, zoom: number): Point

Projects geographical coordinates on a given zoom into pixel coordinates.

Parameters

Returns

Point

public pointToLatLng(point: Point, zoom: number): LatLng

The inverse of latLngToPoint. Projects pixel coordinates on a given zoom into geographical coordinates.

Parameters

  • point: Point
  • zoom: number

Returns

LatLng

public project(latlng: LatLng): Point

Projects geographical coordinates into coordinates in units accepted for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).

Parameters

Returns

Point

public scale(zoom: number): number

Returns the scale used when transforming projected coordinates into pixel coordinates for a particular zoom. For example, it returns 256 * 2^zoom for Mercator-based CRS.

Parameters

  • zoom: number

Returns

number