Module: helpers/converters

Methods

(inner) calculateDegrees(input, min, max) → {Number}

Converts the given input to degrees, using the provided min and max values.
Parameters:
Name Type Description
input Number Variable to convert to degrees.
min Number Minimum value of the range.
max Number Maximu value of the range.
Source:
Returns:
- Returns a between or equal to 0 - 360.
Type
Number

(inner) degreesToColor(degrees) → {Array.<Number>}

Converts degrees to a color (RGB).
Parameters:
Name Type Description
degrees Number Degrees to convert to a color.
Source:
Returns:
- Red, Green and Blue
Type
Array.<Number>

(inner) getIncrement(z) → {Number}

Converts the Z-level of an OpenLayers map to an increment.
Parameters:
Name Type Description
z Number Z-level of the OpenLayers map.
Source:
Returns:
- Increment.
Type
Number

(inner) getLatLong(z, x, y) → {Array.<Number>}

Converts a tile-coordinate to latitude and longitude.
Parameters:
Name Type Description
z Number The z-coordinate.
x Number The x-coordinate.
y Number The y-coordinate.
Source:
Returns:
- Latitude and Longitude
Type
Array.<Number>

(inner) subtractDays(date, numberOfDays) → {Date}

Subtracts a given number of days from a Date.
Parameters:
Name Type Description
date Date Date object to subtract from.
numberOfDays Number Number of days to subtract.
Source:
Returns:
- Red, Green and Blue
Type
Date

(inner) temperatureToColor(temperature) → {Array.<Number>}

Converts temperature, in °C, to a color (RGB).
Parameters:
Name Type Description
temperature Number Temperature to convert to a color.
Source:
Returns:
- Red, Green and Blue
Type
Array.<Number>

(inner) temperatureToDegrees(temperature) → {Number}

Converts temperature, in °C, to degrees.
Parameters:
Name Type Description
temperature Number Temperature to convert to degrees.
Source:
Returns:
0 - 300
Type
Number

(inner) tileToLat(y, z) → {Number}

Converts a tile with y- and z-coordinates to a latitude.
Parameters:
Name Type Description
y Number The y-coordinate.
z Number The z-coordinate.
Source:
Returns:
- The latitude.
Type
Number

(inner) tileToLong(x, z) → {Number}

Converts a tile with x- and z-coordinates to a longitude.
Parameters:
Name Type Description
x Number The x-coordinate.
z Number The z-coordinate.
Source:
Returns:
- The longitude.
Type
Number