From 1a1cb9fe4e1b70b3a09faa936122dc7d0d85697c Mon Sep 17 00:00:00 2001
From: Tom Payne
Date: Wed, 25 Jan 2012 16:25:36 +0100
Subject: [PATCH 01/91] Add OpenLayers/Spherical.js
---
lib/OpenLayers/Spherical.js | 59 +++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100644 lib/OpenLayers/Spherical.js
diff --git a/lib/OpenLayers/Spherical.js b/lib/OpenLayers/Spherical.js
new file mode 100644
index 0000000000..ed64c844f8
--- /dev/null
+++ b/lib/OpenLayers/Spherical.js
@@ -0,0 +1,59 @@
+/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the Clear BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * 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
+ */
+OpenLayers.Spherical = OpenLayers.Spherical || {};
+
+
+OpenLayers.Spherical.DEFAULT_RADIUS = 6378137;
+
+
+/**
+ * APIFunction: computeDistanceBetween
+ * Computes the distance between two LonLats.
+ *
+ * Parameters:
+ * from - {}
+ * to - {}
+ * radius - {Float}
+ *
+ * Returns:
+ * {Float} The distance in meters.
+ */
+OpenLayers.Spherical.computeDistanceBetween = function(from, to, radius) {
+ var R = radius || OpenLayers.Spherical.DEFAULT_RADIUS;
+ var sinHalfDeltaLon = Math.sin(Math.PI * (to.lon - from.lon) / 360);
+ var sinHalfDeltaLat = Math.sin(Math.PI * (to.lat - from.lat) / 360);
+ var a = sinHalfDeltaLat * sinHalfDeltaLat +
+ sinHalfDeltaLon * sinHalfDeltaLon * Math.cos(Math.PI * from.lat / 180) * Math.cos(Math.PI * to.lat / 180);
+ return 2 * R * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
+};
+
+
+/**
+ * APIFunction: computeHeading
+ * Computes the heading from one LonLat to another LonLat.
+ *
+ * Parameters:
+ * from - {}
+ * to - {}
+ *
+ * Returns:
+ * {Float} The heading in degrees.
+ */
+OpenLayers.Spherical.computeHeading = function(from, to) {
+ var y = Math.sin(Math.PI * (from.lon - to.lon) / 180) * Math.cos(Math.PI * to.lat / 180);
+ var x = Math.cos(Math.PI * from.lat / 180) * Math.sin(Math.PI * to.lat / 180) -
+ Math.sin(Math.PI * from.lat / 180) * Math.cos(Math.PI * to.lat / 180) * Math.cos(Math.PI * (from.lon - to.lon) / 180);
+ return 180 * Math.atan2(y, x) / Math.PI;
+};
From ef85f43d21e58f7a8d840e091097b0e10dffa82c Mon Sep 17 00:00:00 2001
From: ahocevar
Date: Thu, 26 Jan 2012 01:24:11 +0100
Subject: [PATCH 02/91] A tile queue that can be aborted.
This saves server requests, and because we use OpenLayers.Animation, setting img.src on a tile should not freeze iOS any more, so we can hopefully get rid of scheduleMoveGriddedTiles.
---
examples/mobile-wmts-vienna.html | 3 +-
examples/mobile-wmts-vienna.js | 2 -
lib/OpenLayers/Layer/Grid.js | 274 ++++++++----------
tests/Layer/ArcGIS93Rest.html | 5 +
tests/Layer/Grid.html | 19 +-
tests/Layer/MapServer.html | 5 +
tests/Layer/WMS.html | 5 +
tests/Layer/WrapDateLine.html | 5 +
tests/deprecated/Layer/MapServer/Untiled.html | 5 +
9 files changed, 165 insertions(+), 158 deletions(-)
diff --git a/examples/mobile-wmts-vienna.html b/examples/mobile-wmts-vienna.html
index 280f66ce74..11e1ee995e 100644
--- a/examples/mobile-wmts-vienna.html
+++ b/examples/mobile-wmts-vienna.html
@@ -6,8 +6,8 @@
+
-
City of Vienna WMTS for Desktop and Mobile Devices
@@ -22,6 +22,7 @@
functionality and uses the Geolocate control.
+