Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Mercator

The Mercator module provides utility functions when working with a map in Mercator project, such as converting between geographical coordinates and pixel coordinates and calculating coordinate bounds.

Index

Functions

Const coordToPoint

  • coordToPoint(lat: number, lon: number, zoom: number, center?: Coordinate, size?: Size): Point
  • Returns the pixel location for the specified pixel location on a map.

    Parameters

    • lat: number
    • lon: number
    • zoom: number
    • Default value center: Coordinate = undefined
    • Default value size: Size = undefined

    Returns Point

Const coordToTile

  • Returns the map tile coordinate that contains the given geographical coordinate based on a specific zoom level.

    Parameters

    Returns Point

Const getBoundsCenter

  • Returns the center coordinate for the specified coordinate bounds.

    Parameters

    Returns Coordinate

Const getBoundsThatFits

  • Returns a new coordinate bounds that best fits the given coordinate bounds based on the map size and any amount of padding.

    Parameters

    Returns GeoBounds

Const getBoundsZoomLevel

  • Returns the zoom level that best fits the given coordinate bounds based on the map size.

    Parameters

    Returns number

Const getSizeForBounds

  • Returns the map size for the given coordinate bounds and zoom level.

    Parameters

    Returns Size

Const pointToCoord

  • Returns the coordinate for the specified pixel location on a map.

    Parameters

    • x: number
    • y: number
    • zoom: number
    • Default value center: Coordinate = undefined
    • Default value size: Size = undefined

    Returns Coordinate

Const tileToCoord

  • Returns the geographical coordinate for the top-left corner of the given map tile coordinate based on a specific zoom level.

    Parameters

    • tile: Point
    • zoom: number

    Returns Coordinate

Generated using TypeDoc