Merge pull request #1 from elemoine/spherical

make OpenLayers.js autoload Spherical.js, plus doc improvements
This commit is contained in:
Tom Payne
2012-02-10 00:41:19 -08:00
3 changed files with 21 additions and 14 deletions
+1
View File
@@ -458,6 +458,7 @@ Group: OpenLayers {
File: Tween (no auto-title, OpenLayers/Tween.js) File: Tween (no auto-title, OpenLayers/Tween.js)
File: Util (no auto-title, OpenLayers/Util.js) File: Util (no auto-title, OpenLayers/Util.js)
File: Spherical (no auto-title, OpenLayers/Spherical.js)
File: Deprecated (no auto-title, deprecated.js) File: Deprecated (no auto-title, deprecated.js)
} # Group: OpenLayers } # Group: OpenLayers
+2 -1
View File
@@ -348,7 +348,8 @@
"OpenLayers/Symbolizer/Text.js", "OpenLayers/Symbolizer/Text.js",
"OpenLayers/Symbolizer/Raster.js", "OpenLayers/Symbolizer/Raster.js",
"OpenLayers/Lang.js", "OpenLayers/Lang.js",
"OpenLayers/Lang/en.js" "OpenLayers/Lang/en.js",
"OpenLayers/Spherical.js"
]; // etc. ]; // etc.
} }
+18 -13
View File
@@ -3,29 +3,32 @@
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */ * full text of the license. */
/**
* @see http://www.movable-type.co.uk/scripts/latlong.html
* @see http://code.google.com/apis/maps/documentation/javascript/reference.html#spherical
*/
/** /**
* Namespace: Spherical * Namespace: Spherical
* The OpenLayers.Spherical namespace includes utility functions for
* calculations on the basis of a spherical earth (ignoring ellipsoidal
* effects), which is accurate enough for most purposes.
*
* Relevant links:
* * http://www.movable-type.co.uk/scripts/latlong.html
* * http://code.google.com/apis/maps/documentation/javascript/reference.html#spherical
*/ */
OpenLayers.Spherical = OpenLayers.Spherical || {}; OpenLayers.Spherical = OpenLayers.Spherical || {};
OpenLayers.Spherical.DEFAULT_RADIUS = 6378137; OpenLayers.Spherical.DEFAULT_RADIUS = 6378137;
/** /**
* APIFunction: computeDistanceBetween * APIFunction: computeDistanceBetween
* Computes the distance between two LonLats. * Computes the distance between two LonLats.
* *
* Parameters: * Parameters:
* from - {<OpenLayers.LonLat>} * from - {<OpenLayers.LonLat>} or {Object} Starting point. A LonLat or
* to - {<OpenLayers.LonLat>} * a JavaScript litteral with lon lat properties.
* radius - {Float} * to - {<OpenLayers.LonLat>} or {Object} Ending point. A LonLat or a
* JavaScript litteral with lon lat properties.
* radius - {Float} The radius. Optional. Defaults to the earth's
* radius, i.e. 6378137 meters.
* *
* Returns: * Returns:
* {Float} The distance in meters. * {Float} The distance in meters.
@@ -45,8 +48,10 @@ OpenLayers.Spherical.computeDistanceBetween = function(from, to, radius) {
* Computes the heading from one LonLat to another LonLat. * Computes the heading from one LonLat to another LonLat.
* *
* Parameters: * Parameters:
* from - {<OpenLayers.LonLat>} * from - {<OpenLayers.LonLat>} or {Object} Starting point. A LonLat or
* to - {<OpenLayers.LonLat>} * a JavaScript litteral with lon lat properties.
* to - {<OpenLayers.LonLat>} or {Object} Ending point. A LonLat or a
* JavaScript litteral with lon lat properties.
* *
* Returns: * Returns:
* {Float} The heading in degrees. * {Float} The heading in degrees.