Repository
``import GPSUtils from '@mobilizing/library/js/Mobilizing/input/GPSUtils.js'``
public class

# GPSUtils

Some GPS coordinates convertion tools to use maps in Mobilizing.js

## Static Method Summary

 Static Public Methods public static getCoordinateInMap(longitute: Number, latitude: Number, zoom: Number, mapCoord: Array, mapWidth: Number, mapHeight: Number): *Compute GPS coordinates into pixels x, y coordinates in a map. public static getPixelsCoordsFromOSMLngLat(longitute: Number, latitude: Number, zoom: Number): {"x": *, "y": *}Converts longitude and latitude coords (from an OpenStreetMap map) into absolute pixels coords. public static getPolarFromLngLat(longitude: Number, latitude: Number, radius: Number): ObjectConvert GPS coords to cartesian coords. public static latY(lat: Number): Numberlatitude to absolute y coord public static lngX(lon: Number): Numberlatitude to absolute x coord public static xLng(x: *): * public static yLat(y: *): *

## Static Public Methods

### publicstaticgetCoordinateInMap(longitute: Number, latitude: Number, zoom: Number, mapCoord: Array, mapWidth: Number, mapHeight: Number): *source

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

#### Params:

 Name Type Attribute Description longitute Number latitude Number zoom Number zoom factor fo this map mapCoord Array 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

 *

### publicstaticgetPixelsCoordsFromOSMLngLat(longitute: Number, latitude: Number, zoom: Number): {"x": *, "y": *}source

Converts longitude and latitude coords (from an OpenStreetMap map) into absolute pixels coords. This method don't calculate the pixels coords within a given map bound's! Use getCoordinateInMap for this.

#### Params:

 Name Type Attribute Description longitute Number longitute latitude Number latitude zoom Number the zoom factor fo this map

#### Return:

 {"x": *, "y": *}

### publicstaticgetPolarFromLngLat(longitude: Number, latitude: Number, radius: Number): Objectsource

Convert GPS coords to cartesian coords. NB : this algorithm is adapted to three.js geoms!

#### Params:

 Name Type Attribute Description longitude Number latitude Number radius Number

#### Return:

 Object {x, y, z} coordinates

### publicstaticlatY(lat: Number): Numbersource

latitude to absolute y coord

#### Params:

 Name Type Attribute Description lat Number

#### Return:

 Number pixel coordinate

### publicstaticlngX(lon: Number): Numbersource

latitude to absolute x coord

#### Params:

 Name Type Attribute Description lon Number

#### Return:

 Number pixel coordinate

### publicstaticxLng(x: *): *source

#### Params:

 Name Type Attribute Description x *

 *

### publicstaticyLat(y: *): *source

#### Params:

 Name Type Attribute Description y *

 *