Search


Search something to see results

getCoordinateInMap

Compute GPS coordinates into pixels x, y coordinates in a map. Here, we adopt the OSM standard for mappinp. Therefore, you should generate your bitmap earth map with a tool using OSM tiles (like MapBox, TileMill). You should give the zoom factor and the map bounds (in lognititude and latitude) to this method for the calculation to be effective

Parameters

  • lng: number

    longitute

  • lat: number

    latitude

  • mapCoord: [number, number, number, number]

    MapBox/TileMill map coords array, like [-180,-85.0511,180,85.0511]

  • mapWidth: number

    the map width in pixels

  • mapHeight: number

    the map height in pixels

  • zoom: number = 1

    zoom factor fo this map

  • tileSize: number = 512

Returns { x: number; y: number }