convert static method

LngLat convert(
  1. dynamic input
)

Converts an array of two numbers or an object with lng and lat or lon and lat properties to a LngLat object.

If a LngLat object is passed in, the function returns it unchanged.

@param {LngLatLike} input An array of two numbers or object to convert, or a LngLat object to return. @returns {LngLat} A new LngLat object, if a conversion occurred, or the original LngLat object. @example var arr = -73.9749, 40.7736; var ll = mapboxgl.LngLat.convert(arr); ll; // = LngLat {lng: -73.9749, lat: 40.7736}

Implementation

static LngLat convert(dynamic input) =>
    LngLat.fromJsObject(LngLatJsImpl.convert(input));