API Docs for: 7.2
Show:

MQA.DisplayProjection Class

Module: MQA

Display projection that converts global physical x/y coordinates into display x/y pixel coordinates.

Note: The pixel coordinates are directly related to the current resolution level, and change based on the given resolution of the projection. (i.e. the more zoomed in the view is, the more pixels it takes to cover the earth's flattened surface.)

Methods

copy

() Object

Creates a new copy of the projection, with the same zoomLevel and global projection.

Returns <Object>

an instance of DisplayProjection

forwardGlobal

(
  • lngLat
)
Array

Project from global (lng,lat) coordinates to display (x,y) coordinates.

Parameters:

  • lngLat Array

    [lng,lat] global coordinate in degrees

Returns <Array>

[x,y] display coordinates in meters/pixel

forwardPhysical

(
  • xy
)
Array

Project from physical coordinates to display coordinates.

Parameters:

  • xy Array

    [x,y] global coordinates

Returns <Array>

[x,y] display coordinates

fromTileCoordsToLngLat

(
  • xy
)
Array

Converts [x,y] tile coordinates in display space into the [left,top] latlng coordinate in global space.

Parameters:

  • xy Array

    the [x,y] tile coordinate

Returns <Array>

lngLat the [lng,lat] global coordinate

getTileCoords

(
  • lngLat
)
Array

Converts a global [lng,lat] coordinate into [x,y] tile coordinates, suitable for generating a tile url request.

Parameters:

  • lngLat Array

    [lng,lat] global coordinate in degrees

Returns <Array>

xy [x,y] tile coordinates in display space

inverseGlobal

(
  • xy
)
Array

Invert from display pixel coordinates to global lnglat coordinates.

Parameters:

  • xy Array

    [x,y] display coordinates

Returns <Array>

lngLat [lng,lat] global coordinates

inversePhysical

(
  • xy
)
Array

Project from display coordinates to physical coordinates.

Parameters:

  • xy Array

    [x,y] display coordinates

Returns <Array>

[x,y] global coordinates

setResolution

(
  • resolution
)
Number

Set the desired numerical resolution value, in meters / pixel. This is value is then mapped to the nearest fixed resolution, and sets the zoomLevel of the projection.

Parameters:

  • resolution Number

    resolution value in meters / pixel

Returns <Number>

the fixed zoomLevel the resolution value mapped to