API Docs for: 7.2
Show:

MQA.Transform Class

Module: MQA

Provides common transformation methods to convert points between local display coordinates (the DOM), global display coordinates (x/y), and lat/lng coordinates.

Methods

deviceToProjected

(
  • xy
)
Array

Converts "local" coordinates (i.e. the coordinates in "div" space") to coordinates that the displayProj is expecting.

Parameters:

  • xy Array

    the x/y local coordinate (in pixels)

Returns <Array>

x/y coordinate pair, converted to global display coordinates.

displayToLatLng

(
  • x
  • y
)
Object

Convert local display coordinates to a lat/lng coordinate.

Parameters:

Returns <Object>

a lat/lng coordinate

latLngToDisplay

(
  • lat
  • lng
)
Object

Converts a lat/lng coordinate into local display XY coordinates. Note that the display coordinates are returned as truncated integers, so that they are suitable for using as left/top values for a DOM element.

Parameters:

Returns <Object>

the x/y local display coordinate

projectedToDevice

(
  • xy
)
Array

Converts "display" coordinates (ie. coordinates that the displayProj works with to "local" coordinates (ie. what gets set on the left/top of any div.

Parameters:

  • xy Array

    the x/y global coordinate

Returns <Array>

x/y coordinate pair, coverted to local coordinates (in pixels)