Class: Coordinate

Coordinate

Represents a coordinate point
e.g.
A geographical point (longitude, latitude)

new Coordinate() [source]

var coord = new Coordinate(0, 0);
var coord = new Coordinate([ 0, 0 ]);
var coord = new Coordinate({ x : 0, y : 0 });

Static Methods

  • (static) toNumberArrays(coordinates) [source]

  • Convert one or more Coordinate objects to GeoJSON style coordinates
    // result is [[100,0], [101,1]]
    var numCoords = Coordinate.toNumberArrays([new Coordinate(100,0), new Coordinate(101,1)]);
    Parameter Type Description
    coordinates Coordinate | Array.<Coordinate> coordinates to convert
    Returns:
    Array.<Number>|Array.<Array.<Number>>:
  • (static) toCoordinates(coordinates) [source]

  • Convert one or more GeoJSON style coordiantes to Coordinate objects
    var coordinates = Coordinate.toCoordinates([[100,0], [101,1]]);
    Parameter Type Description
    coordinates Array.<Number> | Array.<Array.<Number>> coordinates to convert
    Returns:
    Coordinate|Array.<Coordinate>: