Util | |
Functions | |
distVincenty | Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid. |
destinationVincenty | Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) & distance (in m). |
Constants | |
INCHES_PER_UNIT | {Object} Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c. |
DOTS_PER_INCH | {Integer} 72 (A sensible default) |
IS_GECKO | {Boolean} True if the userAgent reports the browser to use the Gecko engine |
CANVAS_SUPPORTED | {Boolean} True if canvas 2d is supported. |
BROWSER_NAME | {String} A substring of the navigator.userAgent property. |
Functions | |
getScrollbarWidth | This function has been modified by the OpenLayers from the original version, written by Matthew Eernisse and released under the Apache 2 license here: |
getFormattedLonLat | This function will return latitude or longitude value formatted as |
OpenLayers.Util.distVincenty = function( p1, p2 )
Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
p1 | {OpenLayers.LonLat} (or any object with both .lat, .lon properties) |
p2 | {OpenLayers.LonLat} (or any object with both .lat, .lon properties) |
{Float} The distance (in km) between the two input points as measured on an ellipsoid. Note that the input point objects must be in geographic coordinates (decimal degrees) and the return distance is in kilometers.
OpenLayers.Util.destinationVincenty = function( lonlat, brng, dist )
Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) &
distance (in m). Adapted from Chris Veness work, see http://www.movable-type.co.uk
lonlat | {OpenLayers.LonLat} (or any object with both .lat, .lon properties) The start point. |
brng | {Float} The bearing (degrees). |
dist | {Float} The ground distance (meters). |
{OpenLayers.LonLat} The destination point.
{Object} Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c.
OpenLayers.Util.getScrollbarWidth = function()
This function has been modified by the OpenLayers from the original version, written by Matthew Eernisse and released under the Apache 2 license here:
http://www.fleegix.org
It has been modified simply to cache its value, since it is physically impossible that this code could ever run in more than one browser at once.
{Integer}
OpenLayers.Util.getFormattedLonLat = function( coordinate, axis, dmsOption )
This function will return latitude or longitude value formatted as
coordinate | {Float} the coordinate value to be formatted |
axis | {String} value of either ‘lat’ or ‘lon’ to indicate which axis is to to be formatted (default = lat) |
dmsOption | {String} specify the precision of the output can be one of: ‘dms’ show degrees minutes and seconds ‘dm’ show only degrees and minutes ‘d’ show only degrees |
{String} the coordinate value formatted as a string
Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
OpenLayers.Util.distVincenty = function( p1, p2 )
Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) & distance (in m).
OpenLayers.Util.destinationVincenty = function( lonlat, brng, dist )
This function has been modified by the OpenLayers from the original version, written by Matthew Eernisse and released under the Apache 2 license here:
OpenLayers.Util.getScrollbarWidth = function()
This function will return latitude or longitude value formatted as
OpenLayers.Util.getFormattedLonLat = function( coordinate, axis, dmsOption )