Geoportal Extension for OpenLayers
API Reference

Module: MathUtils

module:~utils/MathUtils

...

Example

modulo();
decimalToDMS();
coordinateTo();
toInteger();
isInteger();
toFloat();

Methods

innercoordinateToDecimal(olCoordinate){Object}

Utils/MathUtils.js, line 87

ol coordinate to decimal

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
lng, unit:°}

innercoordinateToDMS(olCoordinate){Object}

Utils/MathUtils.js, line 102

ol coordinate to dms

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
lng, unit:dms}

innercoordinateToGon(olCoordinate){Object}

Utils/MathUtils.js, line 135

ol coordinate to gon

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
lng, unit:gon}

innercoordinateToKMeter(olCoordinate){Object}

Utils/MathUtils.js, line 169

ol coordinate to kilometer

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
lyng, unit:km}

innercoordinateToMeter(olCoordinate){Object}

Utils/MathUtils.js, line 153

ol coordinate to meter

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
y, unit:m}

innercoordinateToRad(olCoordinate){Object}

Utils/MathUtils.js, line 117

ol coordinate to rad

Name Type Description
olCoordinate *

see ol/coordinate.js

Returns:
lng, unit:rad}

innerdecimalToDMS(degrees, hemispheres, numDigits){Object}

Utils/MathUtils.js, line 29

Transform degrees, minutes, seconds form decimal degrees -
Largely inspired by the private function degreesToStringHDMS from ol/coordinate.js

Name Type Description
degrees Number

decimal degrees

hemispheres Array

"NS" ou "EO"

numDigits Number

number of digits for seconds

Returns:
coordinate

innerdmsToDecimal(degrees, minutes, seconds, hemispheres){Number}

Utils/MathUtils.js, line 69

Transform decimal degrees form degrees, minutes, seconds

Name Type Description
degrees *

degrees

minutes *

minutes

seconds *

seconds

hemispheres *

"NS" ou "EO"

Returns:
coordinate

innerisInteger(s){Boolean}

Utils/MathUtils.js, line 202

check if s represents an integer

Name Type Description
s String

string number

Returns:
integer

innermodulo(a, b){Number}

Utils/MathUtils.js, line 16

Reste de la division euclidienne

Name Type Description
a Number

divisor

b Number

quotient

innertoFloat(s){null|Numeric}

Utils/MathUtils.js, line 218

Converts s to float

Name Type Description
s String

string number

innertoInteger(s, base){null|Numeric}

Utils/MathUtils.js, line 185

Converts string to Integer

Name Type Description
s String

string number

base Numeric

between 2 and 36