Class MapUtil

This is a utility class that performs various calculations related to maps. All methods are static so an instance of this class should not be created.

Since

2.0.0

Hierarchy

  • MapUtil

Constructors

Methods

  • Parameters

    Returns Map<string, number>

  • Parameters

    Returns Map<string, number>

  • Averages the location for a list of coordinates

    Parameters

    • coordinates: LatLng[][]

      the list of coordinates

    Returns {
        latitude: number;
        longitude: number;
    }

    the average point

    • latitude: number
    • longitude: number

    Since

    2.0.0

  • Calculates the distance between two LatLng coordinates.

    Parameters

    • pt1: LatLng

      First coordinate

    • pt2: LatLng

      Second coordinate

    Returns number

    The distance in METERS.

  • Calculates the heading (bearing) between two coordinates

    Parameters

    Returns number

    the heading in DEGREES

  • Calculates offset location given source location, heading (bearing), and distance.

    Parameters

    • source: LatLng

      the original coordinate

    • bearing: number

      the bearing in DEGREES

    • distance: number

      the offset distance in METERS

    Returns {
        latitude: number;
        longitude: number;
    }

    the new location

    • latitude: number
    • longitude: number
  • Parameters

    Returns boolean

    Since

    1.3.2

  • Calculates the tile bounds on a mercator projection given an x, y, and zoom.

    Parameters

    • x: number

      X coordinate on a mercator projection.

    • y: number

      Y coordinate on a mercator projection.

    • zoom: number

      Zoom of the map.

    Returns LatLngBounds

    a LatLngBounds containing the tile coordinates

  • Combine multiple coordinate bounds into a single one

    Parameters

    Returns LatLngBounds

    the merged bounds

    Since

    2.0.0

Generated using TypeDoc