diff --git a/build/license.txt b/build/license.txt
index 9c7635d802..7ea36accff 100644
--- a/build/license.txt
+++ b/build/license.txt
@@ -2,7 +2,7 @@
OpenLayers.js -- OpenLayers Map Viewer Library
- Copyright (c) 2006-2012 by OpenLayers Contributors
+ Copyright (c) 2006-2013 by OpenLayers Contributors
Published under the 2-clause BSD license.
See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors.
diff --git a/build/mobile.cfg b/build/mobile.cfg
index bfe4543412..b41f0bd04c 100644
--- a/build/mobile.cfg
+++ b/build/mobile.cfg
@@ -29,6 +29,7 @@ OpenLayers/Protocol/HTTP.js
OpenLayers/Protocol/WFS.js
OpenLayers/Protocol/WFS/v1_0_0.js
OpenLayers/Strategy/Fixed.js
+OpenLayers/TileManager.js
[exclude]
diff --git a/examples/encoded-polyline.html b/examples/encoded-polyline.html
new file mode 100644
index 0000000000..c40a243201
--- /dev/null
+++ b/examples/encoded-polyline.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Encoded Polyline Example
+
+
+ Encoded Polyline, Google
+
+
+
+ Demonstrate the use of the Encoded Polyline format.
+
+
+
+
This example uses the Encoded Polyline format.
+
+
+
diff --git a/examples/mobile-base.js b/examples/mobile-base.js
index 5440f932e2..6d8c35b1d8 100644
--- a/examples/mobile-base.js
+++ b/examples/mobile-base.js
@@ -42,6 +42,7 @@ var init = function (onSelectFeatureFunction) {
theme: null,
projection: sm,
numZoomLevels: 18,
+ tileManager: new OpenLayers.TileManager(),
controls: [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.TouchNavigation({
diff --git a/examples/mobile-wmts-vienna.js b/examples/mobile-wmts-vienna.js
index 05a97e3a66..ab593e04ce 100644
--- a/examples/mobile-wmts-vienna.js
+++ b/examples/mobile-wmts-vienna.js
@@ -99,6 +99,7 @@ var map;
maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
maxResolution: 156543.0339,
numZoomLevels: 20,
+ tileManager: new OpenLayers.TileManager(),
controls: [
new OpenLayers.Control.Navigation({
mouseWheelOptions: {
diff --git a/examples/vector-formats.html b/examples/vector-formats.html
index 97b51c7d2f..2b45b543f4 100644
--- a/examples/vector-formats.html
+++ b/examples/vector-formats.html
@@ -87,8 +87,9 @@
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
kml: new OpenLayers.Format.KML(kmlOptionsIn),
atom: new OpenLayers.Format.Atom(in_options),
- gpx: new OpenLayers.Format.GPX(in_options)
- },
+ gpx: new OpenLayers.Format.GPX(in_options),
+ encoded_polyline: new OpenLayers.Format.EncodedPolyline(in_options)
+ },
'out': {
wkt: new OpenLayers.Format.WKT(out_options),
geojson: new OpenLayers.Format.GeoJSON(out_options),
@@ -97,8 +98,9 @@
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
kml: new OpenLayers.Format.KML(out_options),
atom: new OpenLayers.Format.Atom(out_options),
- gpx: new OpenLayers.Format.GPX(out_options)
- }
+ gpx: new OpenLayers.Format.GPX(out_options),
+ encoded_polyline: new OpenLayers.Format.EncodedPolyline(out_options)
+ }
};
}
function init(){
@@ -202,6 +204,7 @@
+
diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js
index 4df00ddf62..05dc3fa7fb 100644
--- a/lib/OpenLayers.js
+++ b/lib/OpenLayers.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -306,6 +306,7 @@
"OpenLayers/Format/GML/v2.js",
"OpenLayers/Format/GML/v3.js",
"OpenLayers/Format/Atom.js",
+ "OpenLayers/Format/EncodedPolyline.js",
"OpenLayers/Format/KML.js",
"OpenLayers/Format/GeoRSS.js",
"OpenLayers/Format/WFS.js",
@@ -313,6 +314,10 @@
"OpenLayers/Format/OWSCommon/v1.js",
"OpenLayers/Format/OWSCommon/v1_0_0.js",
"OpenLayers/Format/OWSCommon/v1_1_0.js",
+ "OpenLayers/Format/WCSCapabilities.js",
+ "OpenLayers/Format/WCSCapabilities/v1.js",
+ "OpenLayers/Format/WCSCapabilities/v1_0_0.js",
+ "OpenLayers/Format/WCSCapabilities/v1_1_0.js",
"OpenLayers/Format/WFSCapabilities.js",
"OpenLayers/Format/WFSCapabilities/v1.js",
"OpenLayers/Format/WFSCapabilities/v1_0_0.js",
@@ -395,6 +400,7 @@
"OpenLayers/Lang.js",
"OpenLayers/Lang/en.js",
"OpenLayers/Spherical.js",
+ "OpenLayers/TileManager.js",
"OpenLayers/WPSClient.js",
"OpenLayers/WPSProcess.js"
]; // etc.
diff --git a/lib/OpenLayers/Animation.js b/lib/OpenLayers/Animation.js
index a19a03909f..7123d6549b 100644
--- a/lib/OpenLayers/Animation.js
+++ b/lib/OpenLayers/Animation.js
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+ * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license.
diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js
index b0c96956a7..4755a2388e 100644
--- a/lib/OpenLayers/BaseTypes.js
+++ b/lib/OpenLayers/BaseTypes.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -295,7 +295,25 @@ OpenLayers.Number = {
str = integer + dsep + rem;
}
return str;
- }
+ },
+
+ /**
+ * Method: zeroPad
+ * Create a zero padded string optionally with a radix for casting numbers.
+ *
+ * Parameters:
+ * num - {Number} The number to be zero padded.
+ * len - {Number} The length of the string to be returned.
+ * radix - {Number} An integer between 2 and 36 specifying the base to use
+ * for representing numeric values.
+ */
+ zeroPad: function(num, len, radix) {
+ var str = num.toString(radix || 10);
+ while (str.length < len) {
+ str = "0" + str;
+ }
+ return str;
+ }
};
/**
diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js
index d7aeeacc32..cb83a3922d 100644
--- a/lib/OpenLayers/BaseTypes/Bounds.js
+++ b/lib/OpenLayers/BaseTypes/Bounds.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/BaseTypes/Class.js b/lib/OpenLayers/BaseTypes/Class.js
index b703464fb4..1bbceeaef8 100644
--- a/lib/OpenLayers/BaseTypes/Class.js
+++ b/lib/OpenLayers/BaseTypes/Class.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/BaseTypes/Date.js b/lib/OpenLayers/BaseTypes/Date.js
index 937b12d108..2646f2472f 100644
--- a/lib/OpenLayers/BaseTypes/Date.js
+++ b/lib/OpenLayers/BaseTypes/Date.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -49,13 +49,6 @@ OpenLayers.Date = {
return date.toISOString();
};
} else {
- function pad(num, len) {
- var str = num + "";
- while (str.length < len) {
- str = "0" + str;
- }
- return str;
- }
return function(date) {
var str;
if (isNaN(date.getTime())) {
@@ -65,12 +58,12 @@ OpenLayers.Date = {
} else {
str =
date.getUTCFullYear() + "-" +
- pad(date.getUTCMonth() + 1, 2) + "-" +
- pad(date.getUTCDate(), 2) + "T" +
- pad(date.getUTCHours(), 2) + ":" +
- pad(date.getUTCMinutes(), 2) + ":" +
- pad(date.getUTCSeconds(), 2) + "." +
- pad(date.getUTCMilliseconds(), 3) + "Z";
+ OpenLayers.Number.zeroPad(date.getUTCMonth() + 1, 2) + "-" +
+ OpenLayers.Number.zeroPad(date.getUTCDate(), 2) + "T" +
+ OpenLayers.Number.zeroPad(date.getUTCHours(), 2) + ":" +
+ OpenLayers.Number.zeroPad(date.getUTCMinutes(), 2) + ":" +
+ OpenLayers.Number.zeroPad(date.getUTCSeconds(), 2) + "." +
+ OpenLayers.Number.zeroPad(date.getUTCMilliseconds(), 3) + "Z";
}
return str;
};
diff --git a/lib/OpenLayers/BaseTypes/Element.js b/lib/OpenLayers/BaseTypes/Element.js
index 9a54b4dd79..ccb9976a27 100644
--- a/lib/OpenLayers/BaseTypes/Element.js
+++ b/lib/OpenLayers/BaseTypes/Element.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/BaseTypes/LonLat.js b/lib/OpenLayers/BaseTypes/LonLat.js
index 892961fd92..f06a88f8b5 100644
--- a/lib/OpenLayers/BaseTypes/LonLat.js
+++ b/lib/OpenLayers/BaseTypes/LonLat.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/BaseTypes/Pixel.js b/lib/OpenLayers/BaseTypes/Pixel.js
index 55d07f4a96..08753090f4 100644
--- a/lib/OpenLayers/BaseTypes/Pixel.js
+++ b/lib/OpenLayers/BaseTypes/Pixel.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/BaseTypes/Size.js b/lib/OpenLayers/BaseTypes/Size.js
index ef4d12ad5c..ef5ae2740e 100644
--- a/lib/OpenLayers/BaseTypes/Size.js
+++ b/lib/OpenLayers/BaseTypes/Size.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Console.js b/lib/OpenLayers/Console.js
index 823ba1c9f1..c0be882b16 100644
--- a/lib/OpenLayers/Console.js
+++ b/lib/OpenLayers/Console.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js
index a91d8f2e73..9fd154ad59 100644
--- a/lib/OpenLayers/Control.js
+++ b/lib/OpenLayers/Control.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ArgParser.js b/lib/OpenLayers/Control/ArgParser.js
index abfd6b366a..3008532089 100644
--- a/lib/OpenLayers/Control/ArgParser.js
+++ b/lib/OpenLayers/Control/ArgParser.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Attribution.js b/lib/OpenLayers/Control/Attribution.js
index 27ca03c768..713e00680b 100644
--- a/lib/OpenLayers/Control/Attribution.js
+++ b/lib/OpenLayers/Control/Attribution.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Button.js b/lib/OpenLayers/Control/Button.js
index 84699ee246..3d1536388c 100644
--- a/lib/OpenLayers/Control/Button.js
+++ b/lib/OpenLayers/Control/Button.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/CacheRead.js b/lib/OpenLayers/Control/CacheRead.js
index b08928c6e7..6b639f81f8 100644
--- a/lib/OpenLayers/Control/CacheRead.js
+++ b/lib/OpenLayers/Control/CacheRead.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/CacheWrite.js b/lib/OpenLayers/Control/CacheWrite.js
index fdd8afce68..c937520baf 100644
--- a/lib/OpenLayers/Control/CacheWrite.js
+++ b/lib/OpenLayers/Control/CacheWrite.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/DragFeature.js b/lib/OpenLayers/Control/DragFeature.js
index af81062e76..c634cde82e 100644
--- a/lib/OpenLayers/Control/DragFeature.js
+++ b/lib/OpenLayers/Control/DragFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/DragPan.js b/lib/OpenLayers/Control/DragPan.js
index 1dc3eb5c74..62d6059e3c 100644
--- a/lib/OpenLayers/Control/DragPan.js
+++ b/lib/OpenLayers/Control/DragPan.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/DrawFeature.js b/lib/OpenLayers/Control/DrawFeature.js
index 4130f76a69..5afe2f8e13 100644
--- a/lib/OpenLayers/Control/DrawFeature.js
+++ b/lib/OpenLayers/Control/DrawFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/EditingToolbar.js b/lib/OpenLayers/Control/EditingToolbar.js
index 4cd4f8555c..89575e3fb7 100644
--- a/lib/OpenLayers/Control/EditingToolbar.js
+++ b/lib/OpenLayers/Control/EditingToolbar.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Geolocate.js b/lib/OpenLayers/Control/Geolocate.js
index 0a1e18e3e8..f2fcb91910 100644
--- a/lib/OpenLayers/Control/Geolocate.js
+++ b/lib/OpenLayers/Control/Geolocate.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js
index 14ee1cb774..eea7a65512 100644
--- a/lib/OpenLayers/Control/GetFeature.js
+++ b/lib/OpenLayers/Control/GetFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Graticule.js b/lib/OpenLayers/Control/Graticule.js
index e393c4b16b..a5a908a803 100644
--- a/lib/OpenLayers/Control/Graticule.js
+++ b/lib/OpenLayers/Control/Graticule.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/KeyboardDefaults.js b/lib/OpenLayers/Control/KeyboardDefaults.js
index e5c6786977..aab664e9e9 100644
--- a/lib/OpenLayers/Control/KeyboardDefaults.js
+++ b/lib/OpenLayers/Control/KeyboardDefaults.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js
index b8524efe6a..6f5ab78ed6 100644
--- a/lib/OpenLayers/Control/LayerSwitcher.js
+++ b/lib/OpenLayers/Control/LayerSwitcher.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Measure.js b/lib/OpenLayers/Control/Measure.js
index ee9e49cd7b..f37683c0be 100644
--- a/lib/OpenLayers/Control/Measure.js
+++ b/lib/OpenLayers/Control/Measure.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js
index a5fd6b79a6..ecda73a088 100644
--- a/lib/OpenLayers/Control/ModifyFeature.js
+++ b/lib/OpenLayers/Control/ModifyFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/MousePosition.js b/lib/OpenLayers/Control/MousePosition.js
index 46bff8c13c..0c88fcf868 100644
--- a/lib/OpenLayers/Control/MousePosition.js
+++ b/lib/OpenLayers/Control/MousePosition.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/NavToolbar.js b/lib/OpenLayers/Control/NavToolbar.js
index 241682fb01..626b616476 100644
--- a/lib/OpenLayers/Control/NavToolbar.js
+++ b/lib/OpenLayers/Control/NavToolbar.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Navigation.js b/lib/OpenLayers/Control/Navigation.js
index 17d2bf0aaa..8c838dddb9 100644
--- a/lib/OpenLayers/Control/Navigation.js
+++ b/lib/OpenLayers/Control/Navigation.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/NavigationHistory.js b/lib/OpenLayers/Control/NavigationHistory.js
index 759e953984..22aa72168d 100644
--- a/lib/OpenLayers/Control/NavigationHistory.js
+++ b/lib/OpenLayers/Control/NavigationHistory.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/OverviewMap.js b/lib/OpenLayers/Control/OverviewMap.js
index c075a45577..142cfaaae1 100644
--- a/lib/OpenLayers/Control/OverviewMap.js
+++ b/lib/OpenLayers/Control/OverviewMap.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -453,7 +453,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
*/
isSuitableOverview: function() {
var mapExtent = this.map.getExtent();
- var maxExtent = this.map.maxExtent;
+ var maxExtent = this.map.getMaxExtent();
var testExtent = new OpenLayers.Bounds(
Math.max(mapExtent.left, maxExtent.left),
Math.max(mapExtent.bottom, maxExtent.bottom),
diff --git a/lib/OpenLayers/Control/Pan.js b/lib/OpenLayers/Control/Pan.js
index 4dfaefea79..bc3d5759ed 100644
--- a/lib/OpenLayers/Control/Pan.js
+++ b/lib/OpenLayers/Control/Pan.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/PanPanel.js b/lib/OpenLayers/Control/PanPanel.js
index a8369b5683..b79f472c64 100644
--- a/lib/OpenLayers/Control/PanPanel.js
+++ b/lib/OpenLayers/Control/PanPanel.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js
index 9941007e9a..4635384b56 100644
--- a/lib/OpenLayers/Control/PanZoom.js
+++ b/lib/OpenLayers/Control/PanZoom.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js
index e463898b69..86ed201bf0 100644
--- a/lib/OpenLayers/Control/PanZoomBar.js
+++ b/lib/OpenLayers/Control/PanZoomBar.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js
index 4db0fb4316..51b47b3905 100644
--- a/lib/OpenLayers/Control/Panel.js
+++ b/lib/OpenLayers/Control/Panel.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js
index bf168b04c4..7ef003a81e 100644
--- a/lib/OpenLayers/Control/Permalink.js
+++ b/lib/OpenLayers/Control/Permalink.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/PinchZoom.js b/lib/OpenLayers/Control/PinchZoom.js
index b3691d813b..c510834527 100644
--- a/lib/OpenLayers/Control/PinchZoom.js
+++ b/lib/OpenLayers/Control/PinchZoom.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -40,6 +40,17 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
* true.
*/
autoActivate: true,
+
+ /**
+ * APIProperty: preserveCenter
+ * {Boolean} Set this to true if you don't want the map center to change
+ * while pinching. For example you may want to set preserveCenter to
+ * true when the user location is being watched and you want to preserve
+ * the user location at the center of the map even if he zooms in or
+ * out using pinch. This property's value can be changed any time on an
+ * existing instance. Default is false.
+ */
+ preserveCenter: false,
/**
* APIProperty: handlerOptions
@@ -73,8 +84,10 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
* of the pinch gesture. This give us the current scale of the pinch.
*/
pinchStart: function(evt, pinchData) {
- this.pinchOrigin = evt.xy;
- this.currentCenter = evt.xy;
+ var xy = (this.preserveCenter) ?
+ this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;
+ this.pinchOrigin = xy;
+ this.currentCenter = xy;
},
/**
@@ -89,7 +102,8 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
var scale = pinchData.scale;
var containerOrigin = this.map.layerContainerOriginPx;
var pinchOrigin = this.pinchOrigin;
- var current = evt.xy;
+ var current = (this.preserveCenter) ?
+ this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;
var dx = Math.round((current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x));
var dy = Math.round((current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y));
diff --git a/lib/OpenLayers/Control/SLDSelect.js b/lib/OpenLayers/Control/SLDSelect.js
index a894eeb854..56f5d3892a 100644
--- a/lib/OpenLayers/Control/SLDSelect.js
+++ b/lib/OpenLayers/Control/SLDSelect.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js
index 3e36ad01df..7e83075c93 100644
--- a/lib/OpenLayers/Control/Scale.js
+++ b/lib/OpenLayers/Control/Scale.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ScaleLine.js b/lib/OpenLayers/Control/ScaleLine.js
index 2a501c28c5..984be3ec9f 100644
--- a/lib/OpenLayers/Control/ScaleLine.js
+++ b/lib/OpenLayers/Control/ScaleLine.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/SelectFeature.js b/lib/OpenLayers/Control/SelectFeature.js
index 198cef9b1b..b2d8f60594 100644
--- a/lib/OpenLayers/Control/SelectFeature.js
+++ b/lib/OpenLayers/Control/SelectFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -305,12 +305,17 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
for(l=0; l numExcept) {
- feature = layer.selectedFeatures[numExcept];
- if(!options || options.except != feature) {
- this.unselect(feature);
- } else {
- ++numExcept;
+ //layer.selectedFeatures is null when layer is destroyed and
+ //one of it's preremovelayer listener calls setLayer
+ //with another layer on this control
+ if(layer.selectedFeatures != null) {
+ while(layer.selectedFeatures.length > numExcept) {
+ feature = layer.selectedFeatures[numExcept];
+ if(!options || options.except != feature) {
+ this.unselect(feature);
+ } else {
+ ++numExcept;
+ }
}
}
}
diff --git a/lib/OpenLayers/Control/Snapping.js b/lib/OpenLayers/Control/Snapping.js
index 9e87043532..2abec96ef3 100644
--- a/lib/OpenLayers/Control/Snapping.js
+++ b/lib/OpenLayers/Control/Snapping.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Split.js b/lib/OpenLayers/Control/Split.js
index 3cc790d182..e32b144db0 100644
--- a/lib/OpenLayers/Control/Split.js
+++ b/lib/OpenLayers/Control/Split.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/TouchNavigation.js b/lib/OpenLayers/Control/TouchNavigation.js
index 7ff476eaf2..c436694b1e 100644
--- a/lib/OpenLayers/Control/TouchNavigation.js
+++ b/lib/OpenLayers/Control/TouchNavigation.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/TransformFeature.js b/lib/OpenLayers/Control/TransformFeature.js
index 85f593e8d1..52d18be8fa 100644
--- a/lib/OpenLayers/Control/TransformFeature.js
+++ b/lib/OpenLayers/Control/TransformFeature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/UTFGrid.js b/lib/OpenLayers/Control/UTFGrid.js
index 4b439ac0fb..b5ec004d5a 100644
--- a/lib/OpenLayers/Control/UTFGrid.js
+++ b/lib/OpenLayers/Control/UTFGrid.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/WMSGetFeatureInfo.js b/lib/OpenLayers/Control/WMSGetFeatureInfo.js
index ee0b85ed75..acdce6a459 100644
--- a/lib/OpenLayers/Control/WMSGetFeatureInfo.js
+++ b/lib/OpenLayers/Control/WMSGetFeatureInfo.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/WMTSGetFeatureInfo.js b/lib/OpenLayers/Control/WMTSGetFeatureInfo.js
index 21f753fe8e..cd73342319 100644
--- a/lib/OpenLayers/Control/WMTSGetFeatureInfo.js
+++ b/lib/OpenLayers/Control/WMTSGetFeatureInfo.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/Zoom.js b/lib/OpenLayers/Control/Zoom.js
index 753a0c0928..9680f0a398 100644
--- a/lib/OpenLayers/Control/Zoom.js
+++ b/lib/OpenLayers/Control/Zoom.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ZoomBox.js b/lib/OpenLayers/Control/ZoomBox.js
index 58da952c9d..ff4db5c5ad 100644
--- a/lib/OpenLayers/Control/ZoomBox.js
+++ b/lib/OpenLayers/Control/ZoomBox.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ZoomIn.js b/lib/OpenLayers/Control/ZoomIn.js
index afab45004f..735367d61f 100644
--- a/lib/OpenLayers/Control/ZoomIn.js
+++ b/lib/OpenLayers/Control/ZoomIn.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ZoomOut.js b/lib/OpenLayers/Control/ZoomOut.js
index 6d6d818e2b..d0a570a90a 100644
--- a/lib/OpenLayers/Control/ZoomOut.js
+++ b/lib/OpenLayers/Control/ZoomOut.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ZoomPanel.js b/lib/OpenLayers/Control/ZoomPanel.js
index d08c27b517..22f7756ea2 100644
--- a/lib/OpenLayers/Control/ZoomPanel.js
+++ b/lib/OpenLayers/Control/ZoomPanel.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Control/ZoomToMaxExtent.js b/lib/OpenLayers/Control/ZoomToMaxExtent.js
index b8ac7a9b70..5553060969 100644
--- a/lib/OpenLayers/Control/ZoomToMaxExtent.js
+++ b/lib/OpenLayers/Control/ZoomToMaxExtent.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js
index 0b93a888da..74692a8775 100644
--- a/lib/OpenLayers/Events.js
+++ b/lib/OpenLayers/Events.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Events/buttonclick.js b/lib/OpenLayers/Events/buttonclick.js
index e0b2a87514..aff5ceafea 100644
--- a/lib/OpenLayers/Events/buttonclick.js
+++ b/lib/OpenLayers/Events/buttonclick.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js
index 7e391d30a6..d2f60f229d 100644
--- a/lib/OpenLayers/Feature.js
+++ b/lib/OpenLayers/Feature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Feature/Vector.js b/lib/OpenLayers/Feature/Vector.js
index 51fefe70fd..30a496a45f 100644
--- a/lib/OpenLayers/Feature/Vector.js
+++ b/lib/OpenLayers/Feature/Vector.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter.js b/lib/OpenLayers/Filter.js
index b9d8c9e31b..bbd8535ab9 100644
--- a/lib/OpenLayers/Filter.js
+++ b/lib/OpenLayers/Filter.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter/Comparison.js b/lib/OpenLayers/Filter/Comparison.js
index c38d60f3a5..368bce6934 100644
--- a/lib/OpenLayers/Filter/Comparison.js
+++ b/lib/OpenLayers/Filter/Comparison.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter/FeatureId.js b/lib/OpenLayers/Filter/FeatureId.js
index c9b14ab2af..283bc42001 100644
--- a/lib/OpenLayers/Filter/FeatureId.js
+++ b/lib/OpenLayers/Filter/FeatureId.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter/Function.js b/lib/OpenLayers/Filter/Function.js
index c7d604714d..ecd2685e18 100644
--- a/lib/OpenLayers/Filter/Function.js
+++ b/lib/OpenLayers/Filter/Function.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter/Logical.js b/lib/OpenLayers/Filter/Logical.js
index b8e5c4d17a..cf4b4125e6 100644
--- a/lib/OpenLayers/Filter/Logical.js
+++ b/lib/OpenLayers/Filter/Logical.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Filter/Spatial.js b/lib/OpenLayers/Filter/Spatial.js
index 0aba0cfd62..a6d772f739 100644
--- a/lib/OpenLayers/Filter/Spatial.js
+++ b/lib/OpenLayers/Filter/Spatial.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format.js b/lib/OpenLayers/Format.js
index 16c5d5b016..a805a599e7 100644
--- a/lib/OpenLayers/Format.js
+++ b/lib/OpenLayers/Format.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/ArcXML.js b/lib/OpenLayers/Format/ArcXML.js
index 038ed87c18..e655f8f310 100644
--- a/lib/OpenLayers/Format/ArcXML.js
+++ b/lib/OpenLayers/Format/ArcXML.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/ArcXML/Features.js b/lib/OpenLayers/Format/ArcXML/Features.js
index 6c8945dbe2..62d8b23ff5 100644
--- a/lib/OpenLayers/Format/ArcXML/Features.js
+++ b/lib/OpenLayers/Format/ArcXML/Features.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Atom.js b/lib/OpenLayers/Format/Atom.js
index a36a2b4b0e..a999989b3c 100644
--- a/lib/OpenLayers/Format/Atom.js
+++ b/lib/OpenLayers/Format/Atom.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/CQL.js b/lib/OpenLayers/Format/CQL.js
index 09729ec24b..33a92b0235 100644
--- a/lib/OpenLayers/Format/CQL.js
+++ b/lib/OpenLayers/Format/CQL.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/CSWGetDomain.js b/lib/OpenLayers/Format/CSWGetDomain.js
index dd469496e1..73327e803f 100644
--- a/lib/OpenLayers/Format/CSWGetDomain.js
+++ b/lib/OpenLayers/Format/CSWGetDomain.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/CSWGetDomain/v2_0_2.js b/lib/OpenLayers/Format/CSWGetDomain/v2_0_2.js
index 831a16e5cb..2cdaead723 100644
--- a/lib/OpenLayers/Format/CSWGetDomain/v2_0_2.js
+++ b/lib/OpenLayers/Format/CSWGetDomain/v2_0_2.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/CSWGetRecords.js b/lib/OpenLayers/Format/CSWGetRecords.js
index 74146a72a6..dc8902c143 100644
--- a/lib/OpenLayers/Format/CSWGetRecords.js
+++ b/lib/OpenLayers/Format/CSWGetRecords.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js b/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
index 9b2274da4c..d786d209cb 100644
--- a/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
+++ b/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Context.js b/lib/OpenLayers/Format/Context.js
index 7fc2e5268f..1b8c5909fe 100644
--- a/lib/OpenLayers/Format/Context.js
+++ b/lib/OpenLayers/Format/Context.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/EncodedPolyline.js b/lib/OpenLayers/Format/EncodedPolyline.js
new file mode 100644
index 0000000000..b6e81f48e3
--- /dev/null
+++ b/lib/OpenLayers/Format/EncodedPolyline.js
@@ -0,0 +1,254 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format.js
+ * @requires OpenLayers/Feature/Vector.js
+ */
+
+/**
+ * Class: OpenLayers.Format.EncodedPolyline
+ * Class for reading and writing encoded polylines. Create a new instance
+ * with the constructor.
+ *
+ * Inherits from:
+ * -
+ */
+OpenLayers.Format.EncodedPolyline = OpenLayers.Class(OpenLayers.Format, {
+
+ /**
+ * APIProperty: geometryType
+ * {String} Geometry type to output. One of: linestring (default),
+ * linearring, point, multipoint or polygon. If the geometryType is
+ * point, only the first point of the string is returned.
+ */
+ geometryType: "linestring",
+
+ /**
+ * Constructor: OpenLayers.Format.EncodedPolyline
+ * Create a new parser for encoded polylines
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance
+ *
+ * Returns:
+ * {} A new encoded polylines parser.
+ */
+ initialize: function(options) {
+ OpenLayers.Format.prototype.initialize.apply(this, [options]);
+ },
+
+ /**
+ * APIMethod: read
+ * Deserialize an encoded polyline string and return a vector feature.
+ *
+ * Parameters:
+ * encoded - {String} An encoded polyline string
+ *
+ * Returns:
+ * {} A vector feature with a linestring.
+ */
+ read: function(encoded) {
+ var geomType;
+ if (this.geometryType == "linestring")
+ geomType = OpenLayers.Geometry.LineString;
+ else if (this.geometryType == "linearring")
+ geomType = OpenLayers.Geometry.LinearRing;
+ else if (this.geometryType == "multipoint")
+ geomType = OpenLayers.Geometry.MultiPoint;
+ else if (this.geometryType != "point" && this.geometryType != "polygon")
+ return null;
+
+ var points = this.decode(encoded, 2);
+ var pointGeometries = new Array();
+ for (var i in points) {
+ var point = points[i];
+ pointGeometries.push(
+ new OpenLayers.Geometry.Point(point[1] * 1e-5, point[0] * 1e-5)
+ );
+ }
+
+ if (this.geometryType == "point")
+ return new OpenLayers.Feature.Vector(
+ pointGeometries[0]
+ );
+
+ if (this.geometryType == "polygon")
+ return new OpenLayers.Feature.Vector(
+ new OpenLayers.Geometry.Polygon([
+ new OpenLayers.Geometry.LinearRing(pointGeometries)
+ ])
+ );
+
+ return new OpenLayers.Feature.Vector(
+ new geomType(pointGeometries)
+ );
+ },
+
+ /**
+ * APIMethod: decode
+ * Deserialize an encoded string and return an array of n-dimensional
+ * points.
+ *
+ * Parameters:
+ * encoded - {String} An encoded string
+ * dims - {int} The dimension of the points that are returned
+ *
+ * Returns:
+ * {Array(Array(int))} An array containing n-dimensional arrays of
+ * coordinates.
+ */
+ decode: function(encoded, dims) {
+ var points = new Array();
+ var point = new Array(dims);
+
+ // Reset the point array
+ for (var i = 0; i < point.length; ++i)
+ point[i] = 0;
+
+ for (var i = 0; i < encoded.length;) {
+ for (var dim = 0; dim < dims; ++dim) {
+ var result = 0;
+ var shift = 0;
+
+ var b;
+ do {
+ b = encoded.charCodeAt(i++) - 63;
+ result |= (b & 0x1f) << shift;
+ shift += 5;
+ } while (b >= 0x20);
+
+ point[dim] += ((result & 1) ? ~(result >> 1) : (result >> 1));
+ }
+
+ points.push(point.slice(0));
+ }
+
+ return points;
+ },
+
+ /**
+ * APIMethod: write
+ * Serialize a feature or array of features into a WKT string.
+ *
+ * Parameters:
+ * features - {|Array} A feature or array of
+ * features
+ *
+ * Returns:
+ * {String} The WKT string representation of the input geometries
+ */
+ write: function(features) {
+ var feature;
+ if (features.constructor == Array)
+ feature = features[0];
+ else
+ feature = features;
+
+ var geometry = feature.geometry;
+ var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
+
+ var pointGeometries;
+ if (type == "point")
+ pointGeometries = new Array(geometry);
+ else if (type == "linestring" ||
+ type == "linearring" ||
+ type == "multipoint")
+ pointGeometries = geometry.components;
+ else if (type == "polygon")
+ pointGeometries = geometry.components[0].components;
+ else
+ return null;
+
+ var points = new Array();
+ for (var i in pointGeometries) {
+ var pointGeometry = pointGeometries[i];
+ var point = [Math.round(pointGeometry.y * 1e5),
+ Math.round(pointGeometry.x * 1e5)];
+ points.push(point);
+ }
+
+ var result = this.encode(points, 2);
+ return result;
+ },
+
+ /**
+ * APIMethod: encode
+ * Serialize an array of n-dimensional points and return an encoded string
+ *
+ * Parameters:
+ * points - {Array(Array(int))} An array containing n-dimensional
+ * arrays of coordinates
+ * dims - {int} The dimension of the points that should be read
+ *
+ * Returns:
+ * {String} An encoded string
+ */
+ encode: function (points, dims) {
+ var encoded_points = "";
+
+ var lastPoint = new Array(dims);
+ for (var i = 0; i < lastPoint.length; ++i)
+ lastPoint[i] = 0;
+
+ for (var i = 0; i < points.length; i++) {
+ var point = points[i];
+
+ for (var dim = 0; dim < lastPoint.length; ++dim) {
+ var delta = point[dim] - lastPoint[dim];
+ encoded_points += this.encodeSignedNumber(delta);
+ }
+
+ lastPoint = point;
+ }
+ return encoded_points;
+ },
+
+ /**
+ * Method: encodeSignedNumber
+ * Encode one single signed integer and return an encoded string
+ *
+ * Parameters:
+ * num - {int} A signed integer that should be encoded
+ *
+ * Returns:
+ * {String} An encoded string
+ */
+ encodeSignedNumber: function (num) {
+ var sgn_num = num << 1;
+ if (num < 0)
+ sgn_num = ~(sgn_num);
+
+ return this.encodeNumber(sgn_num);
+ },
+
+ /**
+ * Method: encodeNumber
+ * Encode one single unsigned integer and return an encoded string
+ *
+ * encodeSignedNumber should be used instead of using this method directly!
+ *
+ * Parameters:
+ * num - {int} An unsigned integer that should be encoded
+ *
+ * Returns:
+ * {String} An encoded string
+ */
+ encodeNumber: function (num) {
+ var encodeString = "";
+ var value;
+ while (num >= 0x20) {
+ value = (0x20 | (num & 0x1f)) + 63;
+ encodeString += (String.fromCharCode(value));
+ num >>= 5;
+ }
+ value = num + 63;
+ encodeString += (String.fromCharCode(value));
+ return encodeString;
+ },
+
+ CLASS_NAME: "OpenLayers.Format.EncodedPolyline"
+});
diff --git a/lib/OpenLayers/Format/Filter.js b/lib/OpenLayers/Format/Filter.js
index c8dd36151d..f3fc0b343b 100644
--- a/lib/OpenLayers/Format/Filter.js
+++ b/lib/OpenLayers/Format/Filter.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Filter/v1.js b/lib/OpenLayers/Format/Filter/v1.js
index 49435e911c..9cb89c847e 100644
--- a/lib/OpenLayers/Format/Filter/v1.js
+++ b/lib/OpenLayers/Format/Filter/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Filter/v1_0_0.js b/lib/OpenLayers/Format/Filter/v1_0_0.js
index 1a4a066f1c..5cf105e964 100644
--- a/lib/OpenLayers/Format/Filter/v1_0_0.js
+++ b/lib/OpenLayers/Format/Filter/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Filter/v1_1_0.js b/lib/OpenLayers/Format/Filter/v1_1_0.js
index dea957b3f2..64a902b959 100644
--- a/lib/OpenLayers/Format/Filter/v1_1_0.js
+++ b/lib/OpenLayers/Format/Filter/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GML.js b/lib/OpenLayers/Format/GML.js
index 073eae0a1c..e26e01e44a 100644
--- a/lib/OpenLayers/Format/GML.js
+++ b/lib/OpenLayers/Format/GML.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GML/Base.js b/lib/OpenLayers/Format/GML/Base.js
index 79dfc66458..1e6d5316b9 100644
--- a/lib/OpenLayers/Format/GML/Base.js
+++ b/lib/OpenLayers/Format/GML/Base.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GML/v2.js b/lib/OpenLayers/Format/GML/v2.js
index ad0d7a6eae..8a489a045a 100644
--- a/lib/OpenLayers/Format/GML/v2.js
+++ b/lib/OpenLayers/Format/GML/v2.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GML/v3.js b/lib/OpenLayers/Format/GML/v3.js
index 2f40032e0e..16b141cece 100644
--- a/lib/OpenLayers/Format/GML/v3.js
+++ b/lib/OpenLayers/Format/GML/v3.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GPX.js b/lib/OpenLayers/Format/GPX.js
index c8d447899d..d6c3ffb058 100644
--- a/lib/OpenLayers/Format/GPX.js
+++ b/lib/OpenLayers/Format/GPX.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GeoJSON.js b/lib/OpenLayers/Format/GeoJSON.js
index 30faeb917a..962b3991d6 100644
--- a/lib/OpenLayers/Format/GeoJSON.js
+++ b/lib/OpenLayers/Format/GeoJSON.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/GeoRSS.js b/lib/OpenLayers/Format/GeoRSS.js
index c41c6cc93b..1bc782f614 100644
--- a/lib/OpenLayers/Format/GeoRSS.js
+++ b/lib/OpenLayers/Format/GeoRSS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/JSON.js b/lib/OpenLayers/Format/JSON.js
index a99478fbca..f4ebff5b5e 100644
--- a/lib/OpenLayers/Format/JSON.js
+++ b/lib/OpenLayers/Format/JSON.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js
index 86dfbb726c..fa15c5806d 100644
--- a/lib/OpenLayers/Format/KML.js
+++ b/lib/OpenLayers/Format/KML.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OGCExceptionReport.js b/lib/OpenLayers/Format/OGCExceptionReport.js
index a229af1f59..9fa293accd 100644
--- a/lib/OpenLayers/Format/OGCExceptionReport.js
+++ b/lib/OpenLayers/Format/OGCExceptionReport.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OSM.js b/lib/OpenLayers/Format/OSM.js
index 3cc1392918..75a4f89418 100644
--- a/lib/OpenLayers/Format/OSM.js
+++ b/lib/OpenLayers/Format/OSM.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js
index cef08621e9..7decbf0f2b 100644
--- a/lib/OpenLayers/Format/OWSCommon.js
+++ b/lib/OpenLayers/Format/OWSCommon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js
index cc6897e891..db317e6a00 100644
--- a/lib/OpenLayers/Format/OWSCommon/v1.js
+++ b/lib/OpenLayers/Format/OWSCommon/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js
index 7555d90005..0ba511a5a5 100644
--- a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js
+++ b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
index 0a3e47e95b..aca42e8fcb 100644
--- a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
+++ b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSContext.js b/lib/OpenLayers/Format/OWSContext.js
index 199c00bdc9..459ed14d45 100644
--- a/lib/OpenLayers/Format/OWSContext.js
+++ b/lib/OpenLayers/Format/OWSContext.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/OWSContext/v0_3_1.js b/lib/OpenLayers/Format/OWSContext/v0_3_1.js
index ef3361061c..d7a38c39b5 100644
--- a/lib/OpenLayers/Format/OWSContext/v0_3_1.js
+++ b/lib/OpenLayers/Format/OWSContext/v0_3_1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/QueryStringFilter.js b/lib/OpenLayers/Format/QueryStringFilter.js
index 6822aee281..dbef01930a 100644
--- a/lib/OpenLayers/Format/QueryStringFilter.js
+++ b/lib/OpenLayers/Format/QueryStringFilter.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SLD.js b/lib/OpenLayers/Format/SLD.js
index 1bbce4766d..8bb1dc8c70 100644
--- a/lib/OpenLayers/Format/SLD.js
+++ b/lib/OpenLayers/Format/SLD.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js
index 79c921063e..7e765abd1e 100644
--- a/lib/OpenLayers/Format/SLD/v1.js
+++ b/lib/OpenLayers/Format/SLD/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SLD/v1_0_0.js b/lib/OpenLayers/Format/SLD/v1_0_0.js
index 78685fd7fe..f0ad738784 100644
--- a/lib/OpenLayers/Format/SLD/v1_0_0.js
+++ b/lib/OpenLayers/Format/SLD/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js b/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js
index 53f7f6d22f..a579784eb8 100644
--- a/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js
+++ b/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SOSCapabilities.js b/lib/OpenLayers/Format/SOSCapabilities.js
index 93614166d0..f4a2d7318e 100644
--- a/lib/OpenLayers/Format/SOSCapabilities.js
+++ b/lib/OpenLayers/Format/SOSCapabilities.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js
index fdf56935fd..18d138d01c 100644
--- a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js
+++ b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js b/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js
index 2e476f96da..be8d162b00 100644
--- a/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js
+++ b/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/SOSGetObservation.js b/lib/OpenLayers/Format/SOSGetObservation.js
index 3a927c84e9..9748b5a087 100644
--- a/lib/OpenLayers/Format/SOSGetObservation.js
+++ b/lib/OpenLayers/Format/SOSGetObservation.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/Text.js b/lib/OpenLayers/Format/Text.js
index 52f7150396..e4ec0f4225 100644
--- a/lib/OpenLayers/Format/Text.js
+++ b/lib/OpenLayers/Format/Text.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WCSCapabilities.js b/lib/OpenLayers/Format/WCSCapabilities.js
new file mode 100644
index 0000000000..f73ee1b7d5
--- /dev/null
+++ b/lib/OpenLayers/Format/WCSCapabilities.js
@@ -0,0 +1,47 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/XML/VersionedOGC.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WCSCapabilities
+ * Read WCS Capabilities.
+ *
+ * Inherits from:
+ * -
+ */
+OpenLayers.Format.WCSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
+
+ /**
+ * APIProperty: defaultVersion
+ * {String} Version number to assume if none found. Default is "1.1.0".
+ */
+ defaultVersion: "1.1.0",
+
+ /**
+ * Constructor: OpenLayers.Format.WCSCapabilities
+ * Create a new parser for WCS capabilities.
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance.
+ */
+
+ /**
+ * APIMethod: read
+ * Read capabilities data from a string, and return a list of coverages.
+ *
+ * Parameters:
+ * data - {String} or {DOMElement} data to read/parse.
+ *
+ * Returns:
+ * {Array} List of named coverages.
+ */
+
+ CLASS_NAME: "OpenLayers.Format.WCSCapabilities"
+
+});
diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1.js b/lib/OpenLayers/Format/WCSCapabilities/v1.js
new file mode 100644
index 0000000000..b4e433dc1f
--- /dev/null
+++ b/lib/OpenLayers/Format/WCSCapabilities/v1.js
@@ -0,0 +1,55 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WCSCapabilities.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WCSCapabilities.v1
+ * Abstract class not to be instantiated directly.
+ *
+ * Inherits from:
+ * -
+ */
+OpenLayers.Format.WCSCapabilities.v1 = OpenLayers.Class(
+ OpenLayers.Format.XML, {
+
+ regExes: {
+ trimSpace: (/^\s*|\s*$/g),
+ splitSpace: (/\s+/)
+ },
+
+ /**
+ * Property: defaultPrefix
+ */
+ defaultPrefix: "wcs",
+
+ /**
+ * APIMethod: read
+ * Read capabilities data from a string, and return a list of coverages.
+ *
+ * Parameters:
+ * data - {String} or {DOMElement} data to read/parse.
+ *
+ * Returns:
+ * {Array} List of named coverages.
+ */
+ read: function(data) {
+ if(typeof data == "string") {
+ data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
+ }
+ var raw = data;
+ if(data && data.nodeType == 9) {
+ data = data.documentElement;
+ }
+ var capabilities = {};
+ this.readNode(data, capabilities);
+ return capabilities;
+ },
+
+ CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1"
+
+});
\ No newline at end of file
diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js
new file mode 100644
index 0000000000..571e3fc1b9
--- /dev/null
+++ b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js
@@ -0,0 +1,170 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WCSCapabilities/v1.js
+ * @requires OpenLayers/Format/GML/v3.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WCSCapabilities/v1_0_0
+ * Read WCS Capabilities version 1.0.0.
+ *
+ * Inherits from:
+ * -
+ */
+OpenLayers.Format.WCSCapabilities.v1_0_0 = OpenLayers.Class(
+ OpenLayers.Format.WCSCapabilities.v1, {
+
+ /**
+ * Constructor: OpenLayers.Format.WCSCapabilities.v1_0_0
+ * Create a new parser for WCS capabilities version 1.0.0.
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance.
+ */
+
+ /**
+ * Property: namespaces
+ * {Object} Mapping of namespace aliases to namespace URIs.
+ */
+ namespaces: {
+ wcs: "http://www.opengis.net/wcs",
+ xlink: "http://www.w3.org/1999/xlink",
+ xsi: "http://www.w3.org/2001/XMLSchema-instance",
+ ows: "http://www.opengis.net/ows"
+ },
+
+ /**
+ * Property: errorProperty
+ * {String} Which property of the returned object to check for in order to
+ * determine whether or not parsing has failed. In the case that the
+ * errorProperty is undefined on the returned object, the document will be
+ * run through an OGCExceptionReport parser.
+ */
+ errorProperty: "service",
+
+ /**
+ * Property: readers
+ * Contains public functions, grouped by namespace prefix, that will
+ * be applied when a namespaced node is found matching the function
+ * name. The function will be applied in the scope of this parser
+ * with two arguments: the node being read and a context object passed
+ * from the parent.
+ */
+ readers: {
+ "wcs": {
+ "WCS_Capabilities": function(node, obj) {
+ this.readChildNodes(node, obj);
+ },
+ "Service": function(node, obj) {
+ obj.service = {};
+ this.readChildNodes(node, obj.service);
+ },
+ "name": function(node, service) {
+ service.name = this.getChildValue(node);
+ },
+ "label": function(node, service) {
+ service.label = this.getChildValue(node);
+ },
+ "keywords": function(node, service) {
+ service.keywords = [];
+ this.readChildNodes(node, service.keywords);
+ },
+ "keyword": function(node, keywords) {
+ // Append the keyword to the keywords list
+ keywords.push(this.getChildValue(node));
+ },
+ "responsibleParty": function(node, service) {
+ service.responsibleParty = {};
+ this.readChildNodes(node, service.responsibleParty);
+ },
+ "individualName": function(node, responsibleParty) {
+ responsibleParty.individualName = this.getChildValue(node);
+ },
+ "organisationName": function(node, responsibleParty) {
+ responsibleParty.organisationName = this.getChildValue(node);
+ },
+ "positionName": function(node, responsibleParty) {
+ responsibleParty.positionName = this.getChildValue(node);
+ },
+ "contactInfo": function(node, responsibleParty) {
+ responsibleParty.contactInfo = {};
+ this.readChildNodes(node, responsibleParty.contactInfo);
+ },
+ "phone": function(node, contactInfo) {
+ contactInfo.phone = {};
+ this.readChildNodes(node, contactInfo.phone);
+ },
+ "voice": function(node, phone) {
+ phone.voice = this.getChildValue(node);
+ },
+ "facsimile": function(node, phone) {
+ phone.facsimile = this.getChildValue(node);
+ },
+ "address": function(node, contactInfo) {
+ contactInfo.address = {};
+ this.readChildNodes(node, contactInfo.address);
+ },
+ "deliveryPoint": function(node, address) {
+ address.deliveryPoint = this.getChildValue(node);
+ },
+ "city": function(node, address) {
+ address.city = this.getChildValue(node);
+ },
+ "postalCode": function(node, address) {
+ address.postalCode = this.getChildValue(node);
+ },
+ "country": function(node, address) {
+ address.country = this.getChildValue(node);
+ },
+ "electronicMailAddress": function(node, address) {
+ address.electronicMailAddress = this.getChildValue(node);
+ },
+ "fees": function(node, service) {
+ service.fees = this.getChildValue(node);
+ },
+ "accessConstraints": function(node, service) {
+ service.accessConstraints = this.getChildValue(node);
+ },
+ "ContentMetadata": function(node, obj) {
+ obj.contentMetadata = [];
+ this.readChildNodes(node, obj.contentMetadata);
+ },
+ "CoverageOfferingBrief": function(node, contentMetadata) {
+ var coverageOfferingBrief = {};
+ this.readChildNodes(node, coverageOfferingBrief);
+ contentMetadata.push(coverageOfferingBrief);
+ },
+ "name": function(node, coverageOfferingBrief) {
+ coverageOfferingBrief.name = this.getChildValue(node);
+ },
+ "label": function(node, coverageOfferingBrief) {
+ coverageOfferingBrief.label = this.getChildValue(node);
+ },
+ "lonLatEnvelope": function(node, coverageOfferingBrief) {
+ var nodeList = this.getElementsByTagNameNS(node, "http://www.opengis.net/gml", "pos");
+
+ // We expect two nodes here, to create the corners of a bounding box
+ if(nodeList.length == 2) {
+ var min = {};
+ var max = {};
+
+ OpenLayers.Format.GML.v3.prototype.readers["gml"].pos.apply(this, [nodeList[0], min]);
+ OpenLayers.Format.GML.v3.prototype.readers["gml"].pos.apply(this, [nodeList[1], max]);
+
+ coverageOfferingBrief.lonLatEnvelope = {};
+ coverageOfferingBrief.lonLatEnvelope.srsName = node.getAttribute("srsName");
+ coverageOfferingBrief.lonLatEnvelope.min = min.points[0];
+ coverageOfferingBrief.lonLatEnvelope.max = max.points[0];
+ }
+ }
+ }
+ },
+
+ CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_0_0"
+
+});
diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js
new file mode 100644
index 0000000000..6efe1b1294
--- /dev/null
+++ b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js
@@ -0,0 +1,109 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WCSCapabilities/v1.js
+ * @requires OpenLayers/Format/OWSCommon/v1_1_0.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WCSCapabilities/v1_1_0
+ * Read WCS Capabilities version 1.1.0.
+ *
+ * Inherits from:
+ * -
+ */
+OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class(
+ OpenLayers.Format.WCSCapabilities.v1, {
+
+ /**
+ * Property: namespaces
+ * {Object} Mapping of namespace aliases to namespace URIs.
+ */
+ namespaces: {
+ wcs: "http://www.opengis.net/wcs/1.1",
+ xlink: "http://www.w3.org/1999/xlink",
+ xsi: "http://www.w3.org/2001/XMLSchema-instance",
+ ows: "http://www.opengis.net/ows/1.1"
+ },
+
+ /**
+ * APIProperty: errorProperty
+ * {String} Which property of the returned object to check for in order to
+ * determine whether or not parsing has failed. In the case that the
+ * errorProperty is undefined on the returned object, the document will be
+ * run through an OGCExceptionReport parser.
+ */
+ errorProperty: "operationsMetadata",
+
+ /**
+ * Constructor: OpenLayers.Format.WCSCapabilities.v1_1_0
+ * Create a new parser for WCS capabilities version 1.1.0.
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance.
+ */
+
+ /**
+ * Property: readers
+ * Contains public functions, grouped by namespace prefix, that will
+ * be applied when a namespaced node is found matching the function
+ * name. The function will be applied in the scope of this parser
+ * with two arguments: the node being read and a context object passed
+ * from the parent.
+ */
+ readers: {
+ "wcs": OpenLayers.Util.applyDefaults({
+ // In 1.0.0, this was WCS_Capabilties, in 1.1.0, it's Capabilities
+ "Capabilities": function(node, obj) {
+ this.readChildNodes(node, obj);
+ },
+ "Contents": function(node, request) {
+ request.contentMetadata = [];
+ this.readChildNodes(node, request.contentMetadata);
+ },
+ "CoverageSummary": function(node, contentMetadata) {
+ var coverageSummary = {};
+ // Read the summary:
+ this.readChildNodes(node, coverageSummary);
+
+ // Add it to the contentMetadata array:
+ contentMetadata.push(coverageSummary);
+ },
+ "Identifier": function(node, coverageSummary) {
+ coverageSummary.identifier = this.getChildValue(node);
+ },
+ "Title": function(node, coverageSummary) {
+ coverageSummary.title = this.getChildValue(node);
+ },
+ "Abstract": function(node, coverageSummary) {
+ coverageSummary["abstract"] = this.getChildValue(node);
+ },
+ "SupportedCRS": function(node, coverageSummary) {
+ var crs = this.getChildValue(node);
+ if(crs) {
+ if(!coverageSummary.supportedCRS) {
+ coverageSummary.supportedCRS = [];
+ }
+ coverageSummary.supportedCRS.push(crs);
+ }
+ },
+ "SupportedFormat": function(node, coverageSummary) {
+ var format = this.getChildValue(node);
+ if(format) {
+ if(!coverageSummary.supportedFormat) {
+ coverageSummary.supportedFormat = [];
+ }
+ coverageSummary.supportedFormat.push(format);
+ }
+ }
+ }, OpenLayers.Format.WCSCapabilities.v1.prototype.readers["wcs"]),
+ "ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"]
+ },
+
+ CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_1_0"
+
+});
diff --git a/lib/OpenLayers/Format/WCSGetCoverage.js b/lib/OpenLayers/Format/WCSGetCoverage.js
index 024c1a1621..e84af0674d 100644
--- a/lib/OpenLayers/Format/WCSGetCoverage.js
+++ b/lib/OpenLayers/Format/WCSGetCoverage.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFS.js b/lib/OpenLayers/Format/WFS.js
index c450028eee..18628615ea 100644
--- a/lib/OpenLayers/Format/WFS.js
+++ b/lib/OpenLayers/Format/WFS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFSCapabilities.js b/lib/OpenLayers/Format/WFSCapabilities.js
index ec82ae984b..690de3d536 100644
--- a/lib/OpenLayers/Format/WFSCapabilities.js
+++ b/lib/OpenLayers/Format/WFSCapabilities.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -21,15 +21,6 @@ OpenLayers.Format.WFSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Versi
* {String} Version number to assume if none found. Default is "1.1.0".
*/
defaultVersion: "1.1.0",
-
- /**
- * APIProperty: errorProperty
- * {String} Which property of the returned object to check for in order to
- * determine whether or not parsing has failed. In the case that the
- * errorProperty is undefined on the returned object, the document will be
- * run through an OGCExceptionReport parser.
- */
- errorProperty: "featureTypeList",
/**
* Constructor: OpenLayers.Format.WFSCapabilities
diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1.js b/lib/OpenLayers/Format/WFSCapabilities/v1.js
index bd52c61cea..9f63c98e43 100644
--- a/lib/OpenLayers/Format/WFSCapabilities/v1.js
+++ b/lib/OpenLayers/Format/WFSCapabilities/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -28,6 +28,16 @@ OpenLayers.Format.WFSCapabilities.v1 = OpenLayers.Class(
ows: "http://www.opengis.net/ows"
},
+
+ /**
+ * APIProperty: errorProperty
+ * {String} Which property of the returned object to check for in order to
+ * determine whether or not parsing has failed. In the case that the
+ * errorProperty is undefined on the returned object, the document will be
+ * run through an OGCExceptionReport parser.
+ */
+ errorProperty: "featureTypeList",
+
/**
* Property: defaultPrefix
*/
diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js
index 8f44f6e097..36457e67de 100644
--- a/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js
+++ b/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js
index 1caf76e1f1..0f691cb90a 100644
--- a/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js
+++ b/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFSDescribeFeatureType.js b/lib/OpenLayers/Format/WFSDescribeFeatureType.js
index 9823aef232..44a5c1c936 100644
--- a/lib/OpenLayers/Format/WFSDescribeFeatureType.js
+++ b/lib/OpenLayers/Format/WFSDescribeFeatureType.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFST.js b/lib/OpenLayers/Format/WFST.js
index 1e94fd8e9a..ed101c3afc 100644
--- a/lib/OpenLayers/Format/WFST.js
+++ b/lib/OpenLayers/Format/WFST.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js
index 7aac83b397..d853ce7609 100644
--- a/lib/OpenLayers/Format/WFST/v1.js
+++ b/lib/OpenLayers/Format/WFST/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFST/v1_0_0.js b/lib/OpenLayers/Format/WFST/v1_0_0.js
index 746d5b8c83..abdbc664b5 100644
--- a/lib/OpenLayers/Format/WFST/v1_0_0.js
+++ b/lib/OpenLayers/Format/WFST/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WFST/v1_1_0.js b/lib/OpenLayers/Format/WFST/v1_1_0.js
index d64efa429f..c145700f0b 100644
--- a/lib/OpenLayers/Format/WFST/v1_1_0.js
+++ b/lib/OpenLayers/Format/WFST/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WKT.js b/lib/OpenLayers/Format/WKT.js
index 33cdd2464b..d7dfbfaa51 100644
--- a/lib/OpenLayers/Format/WKT.js
+++ b/lib/OpenLayers/Format/WKT.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -41,7 +41,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
},
/**
- * Method: read
+ * APIMethod: read
* Deserialize a WKT string and return a vector feature or an
* array of vector features. Supports WKT for POINT, MULTIPOINT,
* LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
@@ -84,7 +84,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
},
/**
- * Method: write
+ * APIMethod: write
* Serialize a feature or array of features into a WKT string.
*
* Parameters:
@@ -95,7 +95,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
* {String} The WKT string representation of the input geometries
*/
write: function(features) {
- var collection, geometry, type, data, isCollection;
+ var collection, geometry, isCollection;
if (features.constructor == Array) {
collection = features;
isCollection = true;
diff --git a/lib/OpenLayers/Format/WMC.js b/lib/OpenLayers/Format/WMC.js
index 5b6ea6ddc6..185326a5c8 100644
--- a/lib/OpenLayers/Format/WMC.js
+++ b/lib/OpenLayers/Format/WMC.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMC/v1.js b/lib/OpenLayers/Format/WMC/v1.js
index 503f9705b8..84ab222286 100644
--- a/lib/OpenLayers/Format/WMC/v1.js
+++ b/lib/OpenLayers/Format/WMC/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMC/v1_0_0.js b/lib/OpenLayers/Format/WMC/v1_0_0.js
index 003decbd42..bacf64a794 100644
--- a/lib/OpenLayers/Format/WMC/v1_0_0.js
+++ b/lib/OpenLayers/Format/WMC/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMC/v1_1_0.js b/lib/OpenLayers/Format/WMC/v1_1_0.js
index d591c7f366..ffbd01c109 100644
--- a/lib/OpenLayers/Format/WMC/v1_1_0.js
+++ b/lib/OpenLayers/Format/WMC/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities.js b/lib/OpenLayers/Format/WMSCapabilities.js
index a926fe09de..da3918464e 100644
--- a/lib/OpenLayers/Format/WMSCapabilities.js
+++ b/lib/OpenLayers/Format/WMSCapabilities.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js
index bfa5506129..c6f0db14ff 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1.js
index 3b4e4883b7..469a0f751a 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_1.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js
index 94ccd5df81..c7c9793a0c 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js
index 286ac8f8ad..8e76b1842c 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js
index eff29a115f..e824114661 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_3.js b/lib/OpenLayers/Format/WMSCapabilities/v1_3.js
index 3e10064bd5..46631de8b2 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_3.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_3.js
@@ -1,5 +1,5 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
- * full list of contributors). Published under the 2-clause BSD license.
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js b/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js
index 82da24574d..867a80377d 100644
--- a/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js
+++ b/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js
@@ -1,5 +1,5 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
- * full list of contributors). Published under the 2-clause BSD license.
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSDescribeLayer.js b/lib/OpenLayers/Format/WMSDescribeLayer.js
index e18ca83906..397c2301fa 100644
--- a/lib/OpenLayers/Format/WMSDescribeLayer.js
+++ b/lib/OpenLayers/Format/WMSDescribeLayer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js b/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js
index 44c7bfe889..adda347467 100644
--- a/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js
+++ b/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMSGetFeatureInfo.js b/lib/OpenLayers/Format/WMSGetFeatureInfo.js
index da08213088..97be9ba213 100644
--- a/lib/OpenLayers/Format/WMSGetFeatureInfo.js
+++ b/lib/OpenLayers/Format/WMSGetFeatureInfo.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WMTSCapabilities.js b/lib/OpenLayers/Format/WMTSCapabilities.js
index b23bf2bd66..985591202e 100644
--- a/lib/OpenLayers/Format/WMTSCapabilities.js
+++ b/lib/OpenLayers/Format/WMTSCapabilities.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -139,8 +139,13 @@ OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Vers
// Get first get method
if (http.get[0].constraints) {
var constraints = http.get[0].constraints;
- if (!constraints.GetEncoding.allowedValues.KVP &&
- constraints.GetEncoding.allowedValues.REST) {
+ var allowedValues = constraints.GetEncoding.allowedValues;
+
+ // The OGC documentation is not clear if we should use
+ // REST or RESTful, ArcGis use RESTful,
+ // and OpenLayers use REST.
+ if (!allowedValues.KVP &&
+ (allowedValues.REST || allowedValues.RESTful)) {
requestEncoding = "REST";
}
}
diff --git a/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js
index 620b9ea5dc..3a201448eb 100644
--- a/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js
+++ b/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WPSCapabilities.js b/lib/OpenLayers/Format/WPSCapabilities.js
index 70fae1b90e..96593d9ed4 100644
--- a/lib/OpenLayers/Format/WPSCapabilities.js
+++ b/lib/OpenLayers/Format/WPSCapabilities.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js
index db93f27708..7f6e872af9 100644
--- a/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js
+++ b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WPSDescribeProcess.js b/lib/OpenLayers/Format/WPSDescribeProcess.js
index 60cc4d68b1..e6cc47ae03 100644
--- a/lib/OpenLayers/Format/WPSDescribeProcess.js
+++ b/lib/OpenLayers/Format/WPSDescribeProcess.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/WPSExecute.js b/lib/OpenLayers/Format/WPSExecute.js
index cd56282659..f7dda5444d 100644
--- a/lib/OpenLayers/Format/WPSExecute.js
+++ b/lib/OpenLayers/Format/WPSExecute.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/XLS.js b/lib/OpenLayers/Format/XLS.js
index d0347f8596..c90dcd48d7 100644
--- a/lib/OpenLayers/Format/XLS.js
+++ b/lib/OpenLayers/Format/XLS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/XLS/v1.js b/lib/OpenLayers/Format/XLS/v1.js
index f101b65d2f..413a74e2db 100644
--- a/lib/OpenLayers/Format/XLS/v1.js
+++ b/lib/OpenLayers/Format/XLS/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/XLS/v1_1_0.js b/lib/OpenLayers/Format/XLS/v1_1_0.js
index 29550af3b1..89e9103b2f 100644
--- a/lib/OpenLayers/Format/XLS/v1_1_0.js
+++ b/lib/OpenLayers/Format/XLS/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/XML.js b/lib/OpenLayers/Format/XML.js
index 32e6666edb..76341ca11e 100644
--- a/lib/OpenLayers/Format/XML.js
+++ b/lib/OpenLayers/Format/XML.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Format/XML/VersionedOGC.js b/lib/OpenLayers/Format/XML/VersionedOGC.js
index 4aceee6988..381b9d6805 100644
--- a/lib/OpenLayers/Format/XML/VersionedOGC.js
+++ b/lib/OpenLayers/Format/XML/VersionedOGC.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -12,6 +12,17 @@
* Class: OpenLayers.Format.XML.VersionedOGC
* Base class for versioned formats, i.e. a format which supports multiple
* versions.
+ *
+ * To enable checking if parsing succeeded, you will need to define a property
+ * called errorProperty on the parser you want to check. The parser will then
+ * check the returned object to see if that property is present. If it is, it
+ * assumes the parsing was successful. If it is not present (or is null), it will
+ * pass the document through an OGCExceptionReport parser.
+ *
+ * If errorProperty is undefined for the parser, this error checking mechanism
+ * will be disabled.
+ *
+ *
*
* Inherits from:
* -
@@ -45,15 +56,6 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
*/
allowFallback: false,
- /**
- * APIProperty: errorProperty
- * {String} Which property of the returned object to check for in order to
- * determine whether or not parsing has failed. In the case that the
- * errorProperty is undefined on the returned object, the document will be
- * run through an OGCExceptionReport parser.
- */
- errorProperty: null,
-
/**
* Property: name
* {String} The name of this parser, this is the part of the CLASS_NAME
@@ -193,9 +195,11 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
}
var root = data.documentElement;
var version = this.getVersion(root);
- this.parser = this.getParser(version);
- var obj = this.parser.read(data, options);
- if (this.errorProperty !== null && obj[this.errorProperty] === undefined) {
+ this.parser = this.getParser(version); // Select the parser
+ var obj = this.parser.read(data, options); // Parse the data
+
+ var errorProperty = this.parser.errorProperty || null;
+ if (errorProperty !== null && obj[errorProperty] === undefined) {
// an error must have happened, so parse it and report back
var format = new OpenLayers.Format.OGCExceptionReport();
obj.error = format.read(data);
diff --git a/lib/OpenLayers/Geometry.js b/lib/OpenLayers/Geometry.js
index bbce8b33ae..7737c261d5 100644
--- a/lib/OpenLayers/Geometry.js
+++ b/lib/OpenLayers/Geometry.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/Collection.js b/lib/OpenLayers/Geometry/Collection.js
index f6389f3405..9d1793454d 100644
--- a/lib/OpenLayers/Geometry/Collection.js
+++ b/lib/OpenLayers/Geometry/Collection.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/Curve.js b/lib/OpenLayers/Geometry/Curve.js
index 16a3c47064..288367bf28 100644
--- a/lib/OpenLayers/Geometry/Curve.js
+++ b/lib/OpenLayers/Geometry/Curve.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/LineString.js b/lib/OpenLayers/Geometry/LineString.js
index 1d5a0fca03..e0db1e7d42 100644
--- a/lib/OpenLayers/Geometry/LineString.js
+++ b/lib/OpenLayers/Geometry/LineString.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/LinearRing.js b/lib/OpenLayers/Geometry/LinearRing.js
index 21b5375654..b502572671 100644
--- a/lib/OpenLayers/Geometry/LinearRing.js
+++ b/lib/OpenLayers/Geometry/LinearRing.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/MultiLineString.js b/lib/OpenLayers/Geometry/MultiLineString.js
index 6629977598..2917fb6ce3 100644
--- a/lib/OpenLayers/Geometry/MultiLineString.js
+++ b/lib/OpenLayers/Geometry/MultiLineString.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/MultiPoint.js b/lib/OpenLayers/Geometry/MultiPoint.js
index 390ba30758..a19f2aa766 100644
--- a/lib/OpenLayers/Geometry/MultiPoint.js
+++ b/lib/OpenLayers/Geometry/MultiPoint.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/MultiPolygon.js b/lib/OpenLayers/Geometry/MultiPolygon.js
index 4607126843..aa94f965a9 100644
--- a/lib/OpenLayers/Geometry/MultiPolygon.js
+++ b/lib/OpenLayers/Geometry/MultiPolygon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/Point.js b/lib/OpenLayers/Geometry/Point.js
index b629b8d099..c2f6f55b13 100644
--- a/lib/OpenLayers/Geometry/Point.js
+++ b/lib/OpenLayers/Geometry/Point.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Geometry/Polygon.js b/lib/OpenLayers/Geometry/Polygon.js
index adc83188da..7b9732a05a 100644
--- a/lib/OpenLayers/Geometry/Polygon.js
+++ b/lib/OpenLayers/Geometry/Polygon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler.js b/lib/OpenLayers/Handler.js
index 8efcaf866b..f929fe51c7 100644
--- a/lib/OpenLayers/Handler.js
+++ b/lib/OpenLayers/Handler.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Box.js b/lib/OpenLayers/Handler/Box.js
index 8ff47c43d8..4c6ba17942 100644
--- a/lib/OpenLayers/Handler/Box.js
+++ b/lib/OpenLayers/Handler/Box.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Click.js b/lib/OpenLayers/Handler/Click.js
index ca6b6b45f4..a214373604 100644
--- a/lib/OpenLayers/Handler/Click.js
+++ b/lib/OpenLayers/Handler/Click.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Drag.js b/lib/OpenLayers/Handler/Drag.js
index a0aab81bf9..e3218d2181 100644
--- a/lib/OpenLayers/Handler/Drag.js
+++ b/lib/OpenLayers/Handler/Drag.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Feature.js b/lib/OpenLayers/Handler/Feature.js
index 63d64b1f63..373debb27c 100644
--- a/lib/OpenLayers/Handler/Feature.js
+++ b/lib/OpenLayers/Handler/Feature.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -325,10 +325,8 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
// we enter handle. Yes, a bit hackish...
this.feature = null;
}
- } else {
- if(this.lastFeature && (previouslyIn || click)) {
- this.triggerCallback(type, 'out', [this.lastFeature]);
- }
+ } else if(this.lastFeature && (previouslyIn || click)) {
+ this.triggerCallback(type, 'out', [this.lastFeature]);
}
return handled;
},
diff --git a/lib/OpenLayers/Handler/Hover.js b/lib/OpenLayers/Handler/Hover.js
index 8f230e1495..e0988ecab1 100644
--- a/lib/OpenLayers/Handler/Hover.js
+++ b/lib/OpenLayers/Handler/Hover.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Keyboard.js b/lib/OpenLayers/Handler/Keyboard.js
index e8fabfe98c..2cbb4c1f1c 100644
--- a/lib/OpenLayers/Handler/Keyboard.js
+++ b/lib/OpenLayers/Handler/Keyboard.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/MouseWheel.js b/lib/OpenLayers/Handler/MouseWheel.js
index 135edb39a5..ce73d08ef3 100644
--- a/lib/OpenLayers/Handler/MouseWheel.js
+++ b/lib/OpenLayers/Handler/MouseWheel.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Path.js b/lib/OpenLayers/Handler/Path.js
index 351a46790a..7bf254801e 100644
--- a/lib/OpenLayers/Handler/Path.js
+++ b/lib/OpenLayers/Handler/Path.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Pinch.js b/lib/OpenLayers/Handler/Pinch.js
index 581a052c30..cd3d086f66 100644
--- a/lib/OpenLayers/Handler/Pinch.js
+++ b/lib/OpenLayers/Handler/Pinch.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Point.js b/lib/OpenLayers/Handler/Point.js
index 903987eeb2..a32e02af1f 100644
--- a/lib/OpenLayers/Handler/Point.js
+++ b/lib/OpenLayers/Handler/Point.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/Polygon.js b/lib/OpenLayers/Handler/Polygon.js
index dffaa1a19a..c9f8825ced 100644
--- a/lib/OpenLayers/Handler/Polygon.js
+++ b/lib/OpenLayers/Handler/Polygon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Handler/RegularPolygon.js b/lib/OpenLayers/Handler/RegularPolygon.js
index b7232a6b54..556a57b020 100644
--- a/lib/OpenLayers/Handler/RegularPolygon.js
+++ b/lib/OpenLayers/Handler/RegularPolygon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js
index 2e7f487a57..65e93c99bb 100644
--- a/lib/OpenLayers/Icon.js
+++ b/lib/OpenLayers/Icon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Kinetic.js b/lib/OpenLayers/Kinetic.js
index 14f293b2b2..46b54d7cf1 100644
--- a/lib/OpenLayers/Kinetic.js
+++ b/lib/OpenLayers/Kinetic.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Lang.js b/lib/OpenLayers/Lang.js
index 789ce4f739..bc2d9f9c0f 100644
--- a/lib/OpenLayers/Lang.js
+++ b/lib/OpenLayers/Lang.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js
index b3229f461c..94b7706307 100644
--- a/lib/OpenLayers/Layer.js
+++ b/lib/OpenLayers/Layer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/ArcGIS93Rest.js b/lib/OpenLayers/Layer/ArcGIS93Rest.js
index 57987c04d7..7ae60164d6 100644
--- a/lib/OpenLayers/Layer/ArcGIS93Rest.js
+++ b/lib/OpenLayers/Layer/ArcGIS93Rest.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/ArcGISCache.js b/lib/OpenLayers/Layer/ArcGISCache.js
index e52ea645e6..228e90dbfb 100644
--- a/lib/OpenLayers/Layer/ArcGISCache.js
+++ b/lib/OpenLayers/Layer/ArcGISCache.js
@@ -457,9 +457,9 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
url = url + '/tile/${z}/${y}/${x}';
} else {
// The tile images are stored using hex values on disk.
- x = 'C' + this.zeroPad(x, 8, 16);
- y = 'R' + this.zeroPad(y, 8, 16);
- z = 'L' + this.zeroPad(z, 2, 16);
+ x = 'C' + OpenLayers.Number.zeroPad(x, 8, 16);
+ y = 'R' + OpenLayers.Number.zeroPad(y, 8, 16);
+ z = 'L' + OpenLayers.Number.zeroPad(z, 2, 16);
url = url + '/${z}/${y}/${x}.' + this.type;
}
@@ -471,23 +471,5 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
);
},
- /**
- * Method: zeroPad
- * Create a zero padded string optionally with a radix for casting numbers.
- *
- * Parameters:
- * num - {Number} The number to be zero padded.
- * len - {Number} The length of the string to be returned.
- * radix - {Number} An integer between 2 and 36 specifying the base to use
- * for representing numeric values.
- */
- zeroPad: function(num, len, radix) {
- var str = num.toString(radix || 10);
- while (str.length < len) {
- str = "0" + str;
- }
- return str;
- },
-
CLASS_NAME: 'OpenLayers.Layer.ArcGISCache'
});
diff --git a/lib/OpenLayers/Layer/ArcIMS.js b/lib/OpenLayers/Layer/ArcIMS.js
index 90d9221a67..eb59f04306 100644
--- a/lib/OpenLayers/Layer/ArcIMS.js
+++ b/lib/OpenLayers/Layer/ArcIMS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Bing.js b/lib/OpenLayers/Layer/Bing.js
index 638891dadb..28096b1914 100644
--- a/lib/OpenLayers/Layer/Bing.js
+++ b/lib/OpenLayers/Layer/Bing.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -197,20 +197,12 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
res.zoomMax + 1 - res.zoomMin, this.numZoomLevels
)
}, true);
+ if (!this.isBaseLayer) {
+ this.redraw();
+ }
this.updateAttribution();
},
-
- /**
- * Method: drawTileFromQueue
- * Draws the first tile from the tileQueue, and unqueues that tile
- */
- drawTileFromQueue: function() {
- // don't start working on the queue before we have a url from initLayer
- if (this.url) {
- OpenLayers.Layer.XYZ.prototype.drawTileFromQueue.apply(this, arguments);
- }
- },
-
+
/**
* Method: getURL
*
@@ -218,6 +210,9 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
* bounds - {}
*/
getURL: function(bounds) {
+ if (!this.url) {
+ return;
+ }
var xyz = this.getXYZ(bounds), x = xyz.x, y = xyz.y, z = xyz.z;
var quadDigits = [];
for (var i = z; i > 0; --i) {
diff --git a/lib/OpenLayers/Layer/Boxes.js b/lib/OpenLayers/Layer/Boxes.js
index 5ad229e257..c9e7495539 100644
--- a/lib/OpenLayers/Layer/Boxes.js
+++ b/lib/OpenLayers/Layer/Boxes.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/EventPane.js b/lib/OpenLayers/Layer/EventPane.js
index 6df7312116..9e05071a16 100644
--- a/lib/OpenLayers/Layer/EventPane.js
+++ b/lib/OpenLayers/Layer/EventPane.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/FixedZoomLevels.js b/lib/OpenLayers/Layer/FixedZoomLevels.js
index 80ab0f8bc8..5b5e52e559 100644
--- a/lib/OpenLayers/Layer/FixedZoomLevels.js
+++ b/lib/OpenLayers/Layer/FixedZoomLevels.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/GeoRSS.js b/lib/OpenLayers/Layer/GeoRSS.js
index bcf5521ca9..eb409bf9db 100644
--- a/lib/OpenLayers/Layer/GeoRSS.js
+++ b/lib/OpenLayers/Layer/GeoRSS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js
index c744b11271..8f9bd7ca75 100644
--- a/lib/OpenLayers/Layer/Google.js
+++ b/lib/OpenLayers/Layer/Google.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Google/v3.js b/lib/OpenLayers/Layer/Google/v3.js
index 69cc4b108d..6147d965d4 100644
--- a/lib/OpenLayers/Layer/Google/v3.js
+++ b/lib/OpenLayers/Layer/Google/v3.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js
index 815eb0d0ae..96a5f8f394 100644
--- a/lib/OpenLayers/Layer/Grid.js
+++ b/lib/OpenLayers/Layer/Grid.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -113,14 +113,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
*/
numLoadingTiles: 0,
- /**
- * APIProperty: tileLoadingDelay
- * {Integer} Number of milliseconds before we shift and load
- * tiles when panning. Ignored if is
- * true. Default is 85.
- */
- tileLoadingDelay: 85,
-
/**
* Property: serverResolutions
* {Array(Number}} This property is documented in subclasses as
@@ -128,32 +120,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
*/
serverResolutions: null,
- /**
- * Property: moveTimerId
- * {Number} The id of the timer.
- */
- moveTimerId: null,
-
- /**
- * Property: deferMoveGriddedTiles
- * {Function} A function that defers execution of by
- * . If is true, this
- * is null and unused.
- */
- deferMoveGriddedTiles: null,
-
- /**
- * Property: tileQueueId
- * {Number} The id of the animation.
- */
- tileQueueId: null,
-
- /**
- * Property: tileQueue
- * {Array()} Tiles queued for drawing.
- */
- tileQueue: null,
-
/**
* Property: loading
* {Boolean} Indicates if tiles are being loaded.
@@ -240,7 +206,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* should not be zero.
*/
className: null,
-
+
/**
* Register a listener for a particular event with the following syntax:
* (code)
@@ -255,6 +221,9 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* element - {DOMElement} A reference to layer.events.element.
*
* Supported event types:
+ * addtile - Triggered when a tile is added to this layer. Listeners receive
+ * an object as first argument, which has a tile property that
+ * references the tile that has been added.
* tileloadstart - Triggered when a tile starts loading. Listeners receive
* an object as first argument, which has a tile property that
* references the tile that starts loading.
@@ -269,6 +238,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* still hidden) if a tile failed to load. Listeners receive an object
* as first argument, which has a tile property that references the
* tile that could not be loaded.
+ * retile - Triggered when the layer recreates its tile grid.
*/
/**
@@ -285,6 +255,15 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
*/
rowSign: null,
+ /**
+ * Property: transitionendEvents
+ * {Array} Event names for transitionend
+ */
+ transitionendEvents: [
+ 'transitionend', 'webkitTransitionEnd', 'otransitionend',
+ 'oTransitionEnd'
+ ],
+
/**
* Constructor: OpenLayers.Layer.Grid
* Create a new grid layer
@@ -299,25 +278,27 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,
arguments);
this.grid = [];
- this.tileQueue = [];
+ this._removeBackBuffer = OpenLayers.Function.bind(this.removeBackBuffer, this);
- if (this.removeBackBufferDelay === null) {
+ this.initProperties();
+
+ this.rowSign = this.tileOriginCorner.substr(0, 1) === "t" ? 1 : -1;
+ },
+
+ /**
+ * Method: initProperties
+ * Set any properties that depend on the value of singleTile.
+ * Currently sets removeBackBufferDelay and className
+ */
+ initProperties: function() {
+ if (this.options.removeBackBufferDelay === undefined) {
this.removeBackBufferDelay = this.singleTile ? 0 : 2500;
}
-
- if (this.className === null) {
+
+ if (this.options.className === undefined) {
this.className = this.singleTile ? 'olLayerGridSingleTile' :
'olLayerGrid';
}
-
- if (!OpenLayers.Animation.isNative) {
- this.deferMoveGriddedTiles = OpenLayers.Function.bind(function() {
- this.moveGriddedTiles(true);
- this.moveTimerId = null;
- }, this);
- }
-
- this.rowSign = this.tileOriginCorner.substr(0, 1) === "t" ? 1 : -1;
},
/**
@@ -339,15 +320,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* map - {} The map.
*/
removeMap: function(map) {
- if (this.moveTimerId !== null) {
- window.clearTimeout(this.moveTimerId);
- this.moveTimerId = null;
- }
- this.clearTileQueue();
- if(this.backBufferTimerId !== null) {
- window.clearTimeout(this.backBufferTimerId);
- this.backBufferTimerId = null;
- }
+ this.removeBackBuffer();
},
/**
@@ -363,13 +336,27 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments);
},
+ /**
+ * APIMethod: mergeNewParams
+ * Refetches tiles with new params merged, keeping a backbuffer. Each
+ * loading new tile will have a css class of '.olTileReplacing'. If a
+ * stylesheet applies a 'display: none' style to that class, any fade-in
+ * transition will not apply, and backbuffers for each tile will be removed
+ * as soon as the tile is loaded.
+ *
+ * Parameters:
+ * newParams - {Object}
+ *
+ * Returns:
+ * redrawn: {Boolean} whether the layer was actually redrawn.
+ */
+
/**
* Method: clearGrid
* Go through and remove all tiles from the grid, calling
* destroy() on each of them to kill circular references
*/
clearGrid:function() {
- this.clearTileQueue();
if (this.grid) {
for(var iRow=0, len=this.grid.length; iRow=0; --i) {
+ OpenLayers.Event.stopObserving(this._transitionElement,
+ this.transitionendEvents[i], this._removeBackBuffer);
+ }
+ delete this._transitionElement;
+ }
if(this.backBuffer) {
this.div.removeChild(this.backBuffer);
this.backBuffer = null;
@@ -832,7 +805,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* bounds - {}
*/
initSingleTile: function(bounds) {
- this.clearTileQueue();
+ this.events.triggerEvent("retile");
//determine new tile bounds
var center = bounds.getCenterLonLat();
@@ -965,7 +938,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* bounds - {}
*/
initGriddedTiles:function(bounds) {
- this.clearTileQueue();
+ this.events.triggerEvent("retile");
// work out mininum number of rows and columns; this is the number of
// tiles required to cover the viewport plus at least one for panning
@@ -1044,8 +1017,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
//shave off exceess rows and colums
this.removeExcessTiles(rowidx, colidx);
- var resolution = this.getServerResolution(),
- immediately = resolution === this.gridResolution;
+ var resolution = this.getServerResolution();
// store the resolution of the grid
this.gridResolution = resolution;
@@ -1054,7 +1026,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
return a.distance - b.distance;
});
for (var i=0, ii=tileData.length; i=0; --i) {
+ OpenLayers.Event.observe(this._transitionElement,
+ this.transitionendEvents[i],
+ this._removeBackBuffer);
+ }
+ // the removal of the back buffer is delayed to prevent
+ // flash effects due to the animation of tile displaying
this.backBufferTimerId = window.setTimeout(
- OpenLayers.Function.bind(this.removeBackBuffer, this),
- this.removeBackBufferDelay
+ this._removeBackBuffer, this.removeBackBufferDelay
);
}
}
@@ -1164,21 +1156,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
/**
* Method: moveGriddedTiles
- *
- * Parameter:
- * deferred - {Boolean} true if this is a deferred call that should not
- * be delayed.
*/
- moveGriddedTiles: function(deferred) {
- if (!deferred && !OpenLayers.Animation.isNative) {
- if (this.moveTimerId != null) {
- window.clearTimeout(this.moveTimerId);
- }
- this.moveTimerId = window.setTimeout(
- this.deferMoveGriddedTiles, this.tileLoadingDelay
- );
- return;
- }
+ moveGriddedTiles: function() {
var buffer = this.buffer + 1;
while(true) {
var tlTile = this.grid[0][0];
diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js
index 9483e4997f..e41e19c6c1 100644
--- a/lib/OpenLayers/Layer/HTTPRequest.js
+++ b/lib/OpenLayers/Layer/HTTPRequest.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Image.js b/lib/OpenLayers/Layer/Image.js
index d46a517b40..ffe8ebe5f6 100644
--- a/lib/OpenLayers/Layer/Image.js
+++ b/lib/OpenLayers/Layer/Image.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js
index 931e5dc031..4041a94200 100644
--- a/lib/OpenLayers/Layer/KaMap.js
+++ b/lib/OpenLayers/Layer/KaMap.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/KaMapCache.js b/lib/OpenLayers/Layer/KaMapCache.js
index 5656a0f7d5..f343d2bc69 100644
--- a/lib/OpenLayers/Layer/KaMapCache.js
+++ b/lib/OpenLayers/Layer/KaMapCache.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/MapGuide.js b/lib/OpenLayers/Layer/MapGuide.js
index 6824b8ad51..9cde653357 100644
--- a/lib/OpenLayers/Layer/MapGuide.js
+++ b/lib/OpenLayers/Layer/MapGuide.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js
index 8f86c8f2fb..69dcfaf889 100644
--- a/lib/OpenLayers/Layer/MapServer.js
+++ b/lib/OpenLayers/Layer/MapServer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js
index 78ca09dd18..b8e0824396 100644
--- a/lib/OpenLayers/Layer/Markers.js
+++ b/lib/OpenLayers/Layer/Markers.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/OSM.js b/lib/OpenLayers/Layer/OSM.js
index 6fd5c78b41..d5b29468c5 100644
--- a/lib/OpenLayers/Layer/OSM.js
+++ b/lib/OpenLayers/Layer/OSM.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/PointGrid.js b/lib/OpenLayers/Layer/PointGrid.js
index 8e7ce29cc0..72a3d03929 100644
--- a/lib/OpenLayers/Layer/PointGrid.js
+++ b/lib/OpenLayers/Layer/PointGrid.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/PointTrack.js b/lib/OpenLayers/Layer/PointTrack.js
index c89da78a43..ad9f892059 100644
--- a/lib/OpenLayers/Layer/PointTrack.js
+++ b/lib/OpenLayers/Layer/PointTrack.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/SphericalMercator.js b/lib/OpenLayers/Layer/SphericalMercator.js
index 25defc52d3..2bcb5545d5 100644
--- a/lib/OpenLayers/Layer/SphericalMercator.js
+++ b/lib/OpenLayers/Layer/SphericalMercator.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js
index da879b1de4..2f816e9e86 100644
--- a/lib/OpenLayers/Layer/TMS.js
+++ b/lib/OpenLayers/Layer/TMS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js
index 2e0818062c..99e559f82f 100644
--- a/lib/OpenLayers/Layer/Text.js
+++ b/lib/OpenLayers/Layer/Text.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Layer/TileCache.js b/lib/OpenLayers/Layer/TileCache.js
index e4e92e9766..07fddf8954 100644
--- a/lib/OpenLayers/Layer/TileCache.js
+++ b/lib/OpenLayers/Layer/TileCache.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -116,31 +116,16 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
var tileZ = this.serverResolutions != null ?
OpenLayers.Util.indexOf(this.serverResolutions, res) :
this.map.getZoom();
- /**
- * Zero-pad a positive integer.
- * number - {Int}
- * length - {Int}
- *
- * Returns:
- * {String} A zero-padded string
- */
- function zeroPad(number, length) {
- number = String(number);
- var zeros = [];
- for(var i=0; i|Array} If provided as an array, the array
* should consist of four values (left, bottom, right, top).
- * The maximum extent for the map. Defaults to the
- * whole world in decimal degrees (-180, -90, 180, 90). Specify a
- * different extent in the map options if you are not using a geographic
- * projection and displaying the whole world. To restrict user panning
- * and zooming of the map, use instead. The value
- * for will change calculations for tile URLs.
+ * The maximum extent for the map.
+ * Default depends on projection; if this is one of those defined in OpenLayers.Projection.defaults
+ * (EPSG:4326 or web mercator), maxExtent will be set to the value defined there;
+ * else, defaults to null.
+ * To restrict user panning and zooming of the map, use instead.
+ * The value for will change calculations for tile URLs.
*/
maxExtent: null,
@@ -368,14 +370,23 @@ OpenLayers.Map = OpenLayers.Class({
* property at the time the control is added to the map.
*/
displayProjection: null,
+
+ /**
+ * APIProperty: tileManager
+ * {} If configured at construction time, the map
+ * will use the TileManager to queue image requests and to cache tile image
+ * elements. Note: make sure that OpenLayers/TileManager.js is included in
+ * your build profile.
+ */
+ tileManager: null,
/**
* APIProperty: fallThrough
* {Boolean} Should OpenLayers allow events on the map to fall through to
* other elements on the page, or should it swallow them? (#457)
- * Default is to fall through.
+ * Default is to swallow.
*/
- fallThrough: true,
+ fallThrough: false,
/**
* APIProperty: autoUpdateSize
@@ -577,6 +588,10 @@ OpenLayers.Map = OpenLayers.Class({
this, this.viewPortDiv, null, this.fallThrough,
{includeXY: true}
);
+
+ if (this.tileManager) {
+ this.tileManager.addMap(this);
+ }
// the layerContainerDiv is the one that holds all the layers
id = this.id + "_OpenLayers_Container";
@@ -776,6 +791,11 @@ OpenLayers.Map = OpenLayers.Class({
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
}
this.viewPortDiv = null;
+
+ if (this.tileManager) {
+ this.tileManager.removeMap(this);
+ this.tileManager = null;
+ }
if(this.eventListeners) {
this.events.un(this.eventListeners);
@@ -1908,7 +1928,9 @@ OpenLayers.Map = OpenLayers.Class({
// if neither center nor zoom will change, no need to do anything
if (zoomChanged || centerChanged || dragging) {
- dragging || this.events.triggerEvent("movestart");
+ dragging || this.events.triggerEvent("movestart", {
+ zoomChanged: zoomChanged
+ });
if (centerChanged) {
if (!zoomChanged && this.center) {
diff --git a/lib/OpenLayers/Marker.js b/lib/OpenLayers/Marker.js
index 984383fa84..2d22b583ab 100644
--- a/lib/OpenLayers/Marker.js
+++ b/lib/OpenLayers/Marker.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js
index 435f221b51..5b100a8400 100644
--- a/lib/OpenLayers/Marker/Box.js
+++ b/lib/OpenLayers/Marker/Box.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js
index cc6cdea37d..41cec8ccbb 100644
--- a/lib/OpenLayers/Popup.js
+++ b/lib/OpenLayers/Popup.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js
index 6909908ca8..e630e7e6a6 100644
--- a/lib/OpenLayers/Popup/Anchored.js
+++ b/lib/OpenLayers/Popup/Anchored.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Popup/AnchoredBubble.js b/lib/OpenLayers/Popup/AnchoredBubble.js
index 9d857eada9..38377ea076 100644
--- a/lib/OpenLayers/Popup/AnchoredBubble.js
+++ b/lib/OpenLayers/Popup/AnchoredBubble.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Popup/Framed.js b/lib/OpenLayers/Popup/Framed.js
index 4d76490988..514b5da834 100644
--- a/lib/OpenLayers/Popup/Framed.js
+++ b/lib/OpenLayers/Popup/Framed.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Popup/FramedCloud.js b/lib/OpenLayers/Popup/FramedCloud.js
index ce1c322f80..7be869b6e1 100644
--- a/lib/OpenLayers/Popup/FramedCloud.js
+++ b/lib/OpenLayers/Popup/FramedCloud.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Projection.js b/lib/OpenLayers/Projection.js
index a85f6c585b..a556073df1 100644
--- a/lib/OpenLayers/Projection.js
+++ b/lib/OpenLayers/Projection.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol.js b/lib/OpenLayers/Protocol.js
index e094c06a20..0ea6737827 100644
--- a/lib/OpenLayers/Protocol.js
+++ b/lib/OpenLayers/Protocol.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/CSW.js b/lib/OpenLayers/Protocol/CSW.js
index aa912bf317..53554b41ef 100644
--- a/lib/OpenLayers/Protocol/CSW.js
+++ b/lib/OpenLayers/Protocol/CSW.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/CSW/v2_0_2.js b/lib/OpenLayers/Protocol/CSW/v2_0_2.js
index 9813b9d27d..5efe33ab46 100644
--- a/lib/OpenLayers/Protocol/CSW/v2_0_2.js
+++ b/lib/OpenLayers/Protocol/CSW/v2_0_2.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/HTTP.js b/lib/OpenLayers/Protocol/HTTP.js
index 75aeda3fd4..7b0e1fdc8c 100644
--- a/lib/OpenLayers/Protocol/HTTP.js
+++ b/lib/OpenLayers/Protocol/HTTP.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/SOS.js b/lib/OpenLayers/Protocol/SOS.js
index 1211b60a13..3c7b64dcea 100644
--- a/lib/OpenLayers/Protocol/SOS.js
+++ b/lib/OpenLayers/Protocol/SOS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/SOS/v1_0_0.js b/lib/OpenLayers/Protocol/SOS/v1_0_0.js
index 367065b035..968b0aaaf0 100644
--- a/lib/OpenLayers/Protocol/SOS/v1_0_0.js
+++ b/lib/OpenLayers/Protocol/SOS/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/Script.js b/lib/OpenLayers/Protocol/Script.js
index 925a36f370..259b21dcb8 100644
--- a/lib/OpenLayers/Protocol/Script.js
+++ b/lib/OpenLayers/Protocol/Script.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/WFS.js b/lib/OpenLayers/Protocol/WFS.js
index 194fd8a32c..3e0be8893f 100644
--- a/lib/OpenLayers/Protocol/WFS.js
+++ b/lib/OpenLayers/Protocol/WFS.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/WFS/v1.js b/lib/OpenLayers/Protocol/WFS/v1.js
index 54553a53fe..f22f57b777 100644
--- a/lib/OpenLayers/Protocol/WFS/v1.js
+++ b/lib/OpenLayers/Protocol/WFS/v1.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/WFS/v1_0_0.js b/lib/OpenLayers/Protocol/WFS/v1_0_0.js
index 2de88ed39f..19924c06c1 100644
--- a/lib/OpenLayers/Protocol/WFS/v1_0_0.js
+++ b/lib/OpenLayers/Protocol/WFS/v1_0_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Protocol/WFS/v1_1_0.js b/lib/OpenLayers/Protocol/WFS/v1_1_0.js
index 52eaeb0044..187e9c7743 100644
--- a/lib/OpenLayers/Protocol/WFS/v1_1_0.js
+++ b/lib/OpenLayers/Protocol/WFS/v1_1_0.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Renderer.js b/lib/OpenLayers/Renderer.js
index 111a13d116..0255b7cbb4 100644
--- a/lib/OpenLayers/Renderer.js
+++ b/lib/OpenLayers/Renderer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Renderer/Canvas.js b/lib/OpenLayers/Renderer/Canvas.js
index 6453c46709..fb5ff82498 100644
--- a/lib/OpenLayers/Renderer/Canvas.js
+++ b/lib/OpenLayers/Renderer/Canvas.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Renderer/Elements.js b/lib/OpenLayers/Renderer/Elements.js
index 8f11d92058..7f62db315f 100644
--- a/lib/OpenLayers/Renderer/Elements.js
+++ b/lib/OpenLayers/Renderer/Elements.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Renderer/SVG.js b/lib/OpenLayers/Renderer/SVG.js
index 20669e5bfc..fed9289399 100644
--- a/lib/OpenLayers/Renderer/SVG.js
+++ b/lib/OpenLayers/Renderer/SVG.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Renderer/VML.js b/lib/OpenLayers/Renderer/VML.js
index befb6d10b3..bd91bf46e5 100644
--- a/lib/OpenLayers/Renderer/VML.js
+++ b/lib/OpenLayers/Renderer/VML.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Request.js b/lib/OpenLayers/Request.js
index c61ce6a556..03a9ac886f 100644
--- a/lib/OpenLayers/Request.js
+++ b/lib/OpenLayers/Request.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Rule.js b/lib/OpenLayers/Rule.js
index e9631cd2b4..7995044dde 100644
--- a/lib/OpenLayers/Rule.js
+++ b/lib/OpenLayers/Rule.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/SingleFile.js b/lib/OpenLayers/SingleFile.js
index 2de1dc8940..7a76504bc3 100644
--- a/lib/OpenLayers/SingleFile.js
+++ b/lib/OpenLayers/SingleFile.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Spherical.js b/lib/OpenLayers/Spherical.js
index 566014d3ec..74e14a8c75 100644
--- a/lib/OpenLayers/Spherical.js
+++ b/lib/OpenLayers/Spherical.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy.js b/lib/OpenLayers/Strategy.js
index eeba84b120..4a2b35c547 100644
--- a/lib/OpenLayers/Strategy.js
+++ b/lib/OpenLayers/Strategy.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/BBOX.js b/lib/OpenLayers/Strategy/BBOX.js
index 4aeef1e206..3c9a591152 100644
--- a/lib/OpenLayers/Strategy/BBOX.js
+++ b/lib/OpenLayers/Strategy/BBOX.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Cluster.js b/lib/OpenLayers/Strategy/Cluster.js
index 026a0c63af..3be70ac340 100644
--- a/lib/OpenLayers/Strategy/Cluster.js
+++ b/lib/OpenLayers/Strategy/Cluster.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Filter.js b/lib/OpenLayers/Strategy/Filter.js
index 987325e052..d785cfb9a5 100644
--- a/lib/OpenLayers/Strategy/Filter.js
+++ b/lib/OpenLayers/Strategy/Filter.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Fixed.js b/lib/OpenLayers/Strategy/Fixed.js
index 3a4549275a..5f1ee11663 100644
--- a/lib/OpenLayers/Strategy/Fixed.js
+++ b/lib/OpenLayers/Strategy/Fixed.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Paging.js b/lib/OpenLayers/Strategy/Paging.js
index 649c14c6e5..e1cc4445b2 100644
--- a/lib/OpenLayers/Strategy/Paging.js
+++ b/lib/OpenLayers/Strategy/Paging.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Refresh.js b/lib/OpenLayers/Strategy/Refresh.js
index b513a2cc88..9dc095164b 100644
--- a/lib/OpenLayers/Strategy/Refresh.js
+++ b/lib/OpenLayers/Strategy/Refresh.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Strategy/Save.js b/lib/OpenLayers/Strategy/Save.js
index 8a82573079..2216808b26 100644
--- a/lib/OpenLayers/Strategy/Save.js
+++ b/lib/OpenLayers/Strategy/Save.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Style.js b/lib/OpenLayers/Style.js
index 3a8206645a..ff5a6ed803 100644
--- a/lib/OpenLayers/Style.js
+++ b/lib/OpenLayers/Style.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Style2.js b/lib/OpenLayers/Style2.js
index cf45526166..ea2cc969e1 100644
--- a/lib/OpenLayers/Style2.js
+++ b/lib/OpenLayers/Style2.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/StyleMap.js b/lib/OpenLayers/StyleMap.js
index 1218983e21..232c291085 100644
--- a/lib/OpenLayers/StyleMap.js
+++ b/lib/OpenLayers/StyleMap.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer.js b/lib/OpenLayers/Symbolizer.js
index 87b2484999..6ac5c3ba34 100644
--- a/lib/OpenLayers/Symbolizer.js
+++ b/lib/OpenLayers/Symbolizer.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer/Line.js b/lib/OpenLayers/Symbolizer/Line.js
index 453d3d0fcc..34fb824e4a 100644
--- a/lib/OpenLayers/Symbolizer/Line.js
+++ b/lib/OpenLayers/Symbolizer/Line.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer/Point.js b/lib/OpenLayers/Symbolizer/Point.js
index e7d3cee9d2..41ebbd5d24 100644
--- a/lib/OpenLayers/Symbolizer/Point.js
+++ b/lib/OpenLayers/Symbolizer/Point.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer/Polygon.js b/lib/OpenLayers/Symbolizer/Polygon.js
index 47075776e4..6ea68ae7cf 100644
--- a/lib/OpenLayers/Symbolizer/Polygon.js
+++ b/lib/OpenLayers/Symbolizer/Polygon.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer/Raster.js b/lib/OpenLayers/Symbolizer/Raster.js
index b8228be800..cfeca16443 100644
--- a/lib/OpenLayers/Symbolizer/Raster.js
+++ b/lib/OpenLayers/Symbolizer/Raster.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Symbolizer/Text.js b/lib/OpenLayers/Symbolizer/Text.js
index 25374079b0..22119e2e82 100644
--- a/lib/OpenLayers/Symbolizer/Text.js
+++ b/lib/OpenLayers/Symbolizer/Text.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js
index 50a3ae709b..f943b2c1e3 100644
--- a/lib/OpenLayers/Tile.js
+++ b/lib/OpenLayers/Tile.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -193,22 +193,23 @@ OpenLayers.Tile = OpenLayers.Class({
* is to call and return the result from .
*
* Parameters:
- * immediately - {Boolean} When e.g. drawing was aborted by returning false
- * from a *beforedraw* listener, the queue manager needs to pass true,
- * so the tile will not be cleared and immediately be drawn. Otherwise,
- * the tile will be cleared and a *beforedraw* event will be fired.
+ * force - {Boolean} If true, the tile will not be cleared and no beforedraw
+ * event will be fired. This is used for drawing tiles asynchronously
+ * after drawing has been cancelled by returning false from a beforedraw
+ * listener.
*
* Returns:
- * {Boolean} Whether or not the tile should actually be drawn.
+ * {Boolean} Whether or not the tile should actually be drawn. Returns null
+ * if a beforedraw listener returned false.
*/
- draw: function(immediately) {
- if (!immediately) {
+ draw: function(force) {
+ if (!force) {
//clear tile's contents and mark as not drawn
this.clear();
}
var draw = this.shouldDraw();
- if (draw && !immediately) {
- draw = this.events.triggerEvent("beforedraw") !== false;
+ if (draw && !force && this.events.triggerEvent("beforedraw") === false) {
+ draw = null;
}
return draw;
},
diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js
index 76107d09e8..153997c4ee 100644
--- a/lib/OpenLayers/Tile/Image.js
+++ b/lib/OpenLayers/Tile/Image.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -20,6 +20,23 @@
*/
OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
+ /**
+ * APIProperty: events
+ * {} An events object that handles all
+ * events on the tile.
+ *
+ * Register a listener for a particular event with the following syntax:
+ * (code)
+ * tile.events.register(type, obj, listener);
+ * (end)
+ *
+ * Supported event types (in addition to the events):
+ * beforeload - Triggered before an image is prepared for loading, when the
+ * url for the image is known already. Listeners may call on
+ * the tile instance. If they do so, that image will be used and no new
+ * one will be created.
+ */
+
/**
* APIProperty: url
* {String} The URL of the image being requested. No default. Filled in by
@@ -146,11 +163,12 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
* Check that a tile should be drawn, and draw it.
*
* Returns:
- * {Boolean} Was a tile drawn?
+ * {Boolean} Was a tile drawn? Or null if a beforedraw listener returned
+ * false.
*/
draw: function() {
- var drawn = OpenLayers.Tile.prototype.draw.apply(this, arguments);
- if (drawn) {
+ var shouldDraw = OpenLayers.Tile.prototype.draw.apply(this, arguments);
+ if (shouldDraw) {
// The layer's reproject option is deprecated.
if (this.layer != this.layer.map.baseLayer && this.layer.reproject) {
// getBoundsFromBaseLayer is defined in deprecated.js.
@@ -158,17 +176,17 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
}
if (this.isLoading) {
//if we're already loading, send 'reload' instead of 'loadstart'.
- this._loadEvent = "reload";
+ this._loadEvent = "reload";
} else {
this.isLoading = true;
this._loadEvent = "loadstart";
}
- this.positionTile();
this.renderTile();
- } else {
+ this.positionTile();
+ } else if (shouldDraw === false) {
this.unload();
}
- return drawn;
+ return shouldDraw;
},
/**
@@ -177,7 +195,6 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
* position it correctly, and set its url.
*/
renderTile: function() {
- this.layer.div.appendChild(this.getTile());
if (this.layer.async) {
// Asynchronous image requests call the asynchronous getURL method
// on the layer to fetch an image that covers 'this.bounds'.
@@ -278,18 +295,34 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
return this.imgDiv;
},
+
+ /**
+ * APIMethod: setImage
+ * Sets the image element for this tile. This method should only be called
+ * from beforeload listeners.
+ *
+ * Parameters
+ * img - {HTMLImageElement} The image to use for this tile.
+ */
+ setImage: function(img) {
+ this.imgDiv = img;
+ },
/**
* Method: initImage
* Creates the content for the frame on the tile.
*/
initImage: function() {
+ this.events.triggerEvent('beforeload');
+ this.layer.div.appendChild(this.getTile());
this.events.triggerEvent(this._loadEvent);
var img = this.getImage();
if (this.url && img.getAttribute("src") == this.url) {
- this.onImageLoad();
+ this._loadTimeout = window.setTimeout(
+ OpenLayers.Function.bind(this.onImageLoad, this), 0
+ );
} else {
- OpenLayers.Event.stopObservingElement(img);
+ this.stopLoading();
if (this.crossOriginKeyword) {
img.removeAttribute("crossorigin");
}
@@ -328,7 +361,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
} else {
// Remove reference to the image, and leave it to the browser's
// caching and garbage collection.
- OpenLayers.Event.stopObservingElement(this.imgDiv);
+ this.stopLoading();
this.imgDiv = null;
if (img.parentNode) {
img.parentNode.removeChild(img);
@@ -378,7 +411,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
*/
onImageLoad: function() {
var img = this.imgDiv;
- OpenLayers.Event.stopObservingElement(img);
+ this.stopLoading();
img.style.visibility = 'inherit';
img.style.opacity = this.layer.opacity;
this.isLoading = false;
@@ -409,6 +442,16 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
}
}
},
+
+ /**
+ * Method: stopLoading
+ * Stops a loading sequence so won't be executed.
+ */
+ stopLoading: function() {
+ OpenLayers.Event.stopObservingElement(this.imgDiv);
+ window.clearTimeout(this._loadTimeout);
+ delete this._loadTimeout;
+ },
/**
* APIMethod: getCanvasContext
diff --git a/lib/OpenLayers/Tile/Image/IFrame.js b/lib/OpenLayers/Tile/Image/IFrame.js
index 84dca466ce..d15b4086a0 100644
--- a/lib/OpenLayers/Tile/Image/IFrame.js
+++ b/lib/OpenLayers/Tile/Image/IFrame.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/Tile/UTFGrid.js b/lib/OpenLayers/Tile/UTFGrid.js
index 98b021b97b..d819227549 100644
--- a/lib/OpenLayers/Tile/UTFGrid.js
+++ b/lib/OpenLayers/Tile/UTFGrid.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
diff --git a/lib/OpenLayers/TileManager.js b/lib/OpenLayers/TileManager.js
new file mode 100644
index 0000000000..1eee6a1e20
--- /dev/null
+++ b/lib/OpenLayers/TileManager.js
@@ -0,0 +1,419 @@
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+ * full list of contributors). Published under the 2-clause BSD license.
+ * See license.txt in the OpenLayers distribution or repository for the
+ * full text of the license. */
+
+
+/**
+ * @requires OpenLayers/Layer/Grid.js
+ * @requires OpenLayers/Util.js
+ * @requires OpenLayers/BaseTypes.js
+ * @requires OpenLayers/BaseTypes/Element.js
+ */
+
+/**
+ * Class: OpenLayers.TileManager
+ * Provides queueing of image requests and caching of image elements.
+ *
+ * Queueing avoids unnecessary image requests while changing zoom levels
+ * quickly, and helps improve dragging performance on mobile devices that show
+ * a lag in dragging when loading of new images starts. and
+ * are the configuration options to control this behavior.
+ *
+ * Caching avoids setting the src on image elements for images that have already
+ * been used. Several maps can share a TileManager instance, in which case each
+ * map gets its own tile queue, but all maps share the same tile cache.
+ */
+OpenLayers.TileManager = OpenLayers.Class({
+
+ /**
+ * APIProperty: cacheSize
+ * {Number} Number of image elements to keep referenced in this instance's
+ * cache for fast reuse. Default is 256.
+ */
+ cacheSize: 256,
+
+ /**
+ * APIProperty: moveDelay
+ * {Number} Delay in milliseconds after a map's move event before loading
+ * tiles. Default is 100.
+ */
+ moveDelay: 100,
+
+ /**
+ * APIProperty: zoomDelay
+ * {Number} Delay in milliseconds after a map's zoomend event before loading
+ * tiles. Default is 200.
+ */
+ zoomDelay: 200,
+
+ /**
+ * Property: maps
+ * {Array()} The maps to manage tiles on.
+ */
+ maps: null,
+
+ /**
+ * Property: tileQueueId
+ * {Object} The ids of the loop, keyed by map id.
+ */
+ tileQueueId: null,
+
+ /**
+ * Property: tileQueue
+ * {Object(Array())} Tiles queued for drawing, keyed by
+ * map id.
+ */
+ tileQueue: null,
+
+ /**
+ * Property: tileCache
+ * {Object} Cached image elements, keyed by URL.
+ */
+ tileCache: null,
+
+ /**
+ * Property: tileCacheIndex
+ * {Array(String)} URLs of cached tiles. First entry is the least recently
+ * used.
+ */
+ tileCacheIndex: null,
+
+ /**
+ * Constructor: OpenLayers.TileManager
+ * Constructor for a new instance.
+ *
+ * Parameters:
+ * options - {Object} Configuration for this instance.
+ */
+ initialize: function(options) {
+ OpenLayers.Util.extend(this, options);
+ this.maps = [];
+ this.tileQueueId = {};
+ this.tileQueue = {};
+ this.tileCache = {};
+ this.tileCacheIndex = [];
+ },
+
+ /**
+ * Method: addMap
+ * Binds this instance to a map
+ *
+ * Parameters:
+ * map - {}
+ */
+ addMap: function(map) {
+ if (this._destroyed) {
+ return;
+ }
+ this.maps.push(map);
+ this.tileQueue[map.id] = [];
+ for (var i=0, ii=map.layers.length; i}
+ */
+ removeMap: function(map) {
+ if (this._destroyed) {
+ return;
+ }
+ window.clearTimeout(this.tileQueueId[map.id]);
+ if (map.layers) {
+ for (var i=0, ii=map.layers.length; i=0; --i) {
+ for (j=layer.grid[i].length-1; j>=0; --j) {
+ tile = layer.grid[i][j];
+ this.addTile({tile: tile});
+ if (tile.url) {
+ this.manageTileCache({object: tile});
+ }
+ }
+ }
+ }
+ },
+
+ /**
+ * Method: removeLayer
+ * Handles the map's preremovelayer event
+ *
+ * Parameters:
+ * evt - {Object} The listener argument
+ */
+ removeLayer: function(evt) {
+ var layer = evt.layer;
+ if (layer instanceof OpenLayers.Layer.Grid) {
+ this.clearTileQueue({object: layer});
+ if (layer.events) {
+ layer.events.un({
+ addtile: this.addTile,
+ retile: this.clearTileQueue,
+ scope: this
+ });
+ }
+ if (layer.grid) {
+ var i, j, tile;
+ for (i=layer.grid.length-1; i>=0; --i) {
+ for (j=layer.grid[i].length-1; j>=0; --j) {
+ tile = layer.grid[i][j];
+ this.unloadTile({object: tile});
+ if (tile.url) {
+ this.manageTileCache({object: tile});
+ }
+ }
+ }
+ }
+ }
+ },
+
+ /**
+ * Method: updateTimeout
+ * Applies the or to the loop.
+ *
+ * Parameters:
+ * map - {} The map to update the timeout for
+ * delay - {Number} The delay to apply
+ */
+ updateTimeout: function(map, delay) {
+ window.clearTimeout(this.tileQueueId[map.id]);
+ if (this.tileQueue[map.id].length) {
+ this.tileQueueId[map.id] = window.setTimeout(
+ OpenLayers.Function.bind(function() {
+ this.drawTilesFromQueue(map);
+ }, this), delay
+ );
+ }
+ },
+
+ /**
+ * Method: addTile
+ * Listener for the layer's addtile event
+ *
+ * Parameters:
+ * evt - {Object} The listener argument
+ */
+ addTile: function(evt) {
+ evt.tile.events.on({
+ beforedraw: this.queueTileDraw,
+ beforeload: this.manageTileCache,
+ loadend: this.addToCache,
+ unload: this.unloadTile,
+ scope: this
+ });
+ },
+
+ /**
+ * Method: unloadTile
+ * Listener for the tile's unload event
+ *
+ * Parameters:
+ * evt - {Object} The listener argument
+ */
+ unloadTile: function(evt) {
+ var tile = evt.object;
+ tile.events.un({
+ beforedraw: this.queueTileDraw,
+ beforeload: this.manageTileCache,
+ loadend: this.addToCache,
+ unload: this.unloadTile,
+ scope: this
+ });
+ OpenLayers.Util.removeItem(this.tileQueue[tile.layer.map.id], tile);
+ },
+
+ /**
+ * Method: queueTileDraw
+ * Adds a tile to the queue that will draw it.
+ *
+ * Parameters:
+ * evt - {Object} Listener argument of the tile's beforedraw event
+ */
+ queueTileDraw: function(evt) {
+ var tile = evt.object;
+ var queued = false;
+ var layer = tile.layer;
+ // queue only if image with same url not cached already
+ if (layer.url && (layer.async ||
+ !this.tileCache[layer.getURL(tile.bounds)])) {
+ // add to queue only if not in queue already
+ var tileQueue = this.tileQueue[layer.map.id];
+ if (!~OpenLayers.Util.indexOf(tileQueue, tile)) {
+ tileQueue.push(tile);
+ }
+ queued = true;
+ }
+ return !queued;
+ },
+
+ /**
+ * Method: drawTilesFromQueue
+ * Draws tiles from the tileQueue, and unqueues the tiles
+ */
+ drawTilesFromQueue: function(map) {
+ var tileQueue = this.tileQueue[map.id];
+ while (tileQueue.length) {
+ tileQueue.shift().draw(true);
+ }
+ },
+
+ /**
+ * Method: manageTileCache
+ * Adds, updates, removes and fetches cache entries.
+ *
+ * Parameters:
+ * evt - {Object} Listener argument of the tile's beforeload event
+ */
+ manageTileCache: function(evt) {
+ var tile = evt.object;
+ var img = this.tileCache[tile.url];
+ // only use image from cache if it is not on a layer already
+ if (img && (!img.parentNode ||
+ OpenLayers.Element.hasClass(img.parentNode, 'olBackBuffer'))) {
+ if (tile.layer.backBuffer) {
+ img.style.opacity = 0;
+ img.style.visibility = 'hidden';
+ }
+ tile.setImage(img);
+ // LRU - move tile to the end of the array to mark it as the most
+ // recently used
+ OpenLayers.Util.removeItem(this.tileCacheIndex, tile.url);
+ this.tileCacheIndex.push(tile.url);
+ }
+ },
+
+ /**
+ * Method: addToCache
+ *
+ * Parameters:
+ * evt - {Object} Listener argument for the tile's loadend event
+ */
+ addToCache: function(evt) {
+ var tile = evt.object;
+ if (!this.tileCache[tile.url]) {
+ if (!OpenLayers.Element.hasClass(tile.imgDiv, 'olImageLoadError')) {
+ if (this.tileCacheIndex.length >= this.cacheSize) {
+ delete this.tileCache[this.tileCacheIndex[0]];
+ this.tileCacheIndex.shift();
+ }
+ this.tileCache[tile.url] = tile.imgDiv;
+ this.tileCacheIndex.push(tile.url);
+ }
+ }
+ },
+
+ /**
+ * Method: clearTileQueue
+ * Clears the tile queue from tiles of a specific layer
+ *
+ * Parameters:
+ * evt - {Object} Listener argument of the layer's retile event
+ */
+ clearTileQueue: function(evt) {
+ var layer = evt.object;
+ var tileQueue = this.tileQueue[layer.map.id];
+ for (var i=tileQueue.length-1; i>=0; --i) {
+ if (tileQueue[i].layer === layer) {
+ tileQueue.splice(i, 1);
+ }
+ }
+ },
+
+ /**
+ * Method: destroy
+ */
+ destroy: function() {
+ for (var i=this.maps.length-1; i>=0; --i) {
+ this.removeMap(this.maps[i]);
+ }
+ this.maps = null;
+ this.tileQueue = null;
+ this.tileQueueId = null;
+ this.tileCache = null;
+ this.tileCacheIndex = null;
+ this._destroyed = true;
+ }
+
+});
\ No newline at end of file
diff --git a/lib/OpenLayers/Tween.js b/lib/OpenLayers/Tween.js
index 4e504381a5..d722a9933c 100644
--- a/lib/OpenLayers/Tween.js
+++ b/lib/OpenLayers/Tween.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -52,6 +52,22 @@ OpenLayers.Tween = OpenLayers.Class({
*/
time: null,
+ /**
+ * APIProperty: minFrameRate
+ * {Number} The minimum framerate for animations in frames per second. After
+ * each step, the time spent in the animation is compared to the calculated
+ * time at this frame rate. If the animation runs longer than the calculated
+ * time, the next step is skipped. Default is 30.
+ */
+ minFrameRate: null,
+
+ /**
+ * Property: startTime
+ * {Number} The timestamp of the first execution step. Used for skipping
+ * frames
+ */
+ startTime: null,
+
/**
* Property: animationId
* {int} Loop id returned by OpenLayers.Animation.start
@@ -83,7 +99,8 @@ OpenLayers.Tween = OpenLayers.Class({
* begin - {Object} values to start the animation with
* finish - {Object} values to finish the animation with
* duration - {int} duration of the tween (number of steps)
- * options - {Object} hash of options (for example callbacks (start, eachStep, done))
+ * options - {Object} hash of options (callbacks (start, eachStep, done),
+ * minFrameRate)
*/
start: function(begin, finish, duration, options) {
this.playing = true;
@@ -91,7 +108,9 @@ OpenLayers.Tween = OpenLayers.Class({
this.finish = finish;
this.duration = duration;
this.callbacks = options.callbacks;
+ this.minFrameRate = options.minFrameRate || 30;
this.time = 0;
+ this.startTime = new Date().getTime();
OpenLayers.Animation.stop(this.animationId);
this.animationId = null;
if (this.callbacks && this.callbacks.start) {
@@ -139,7 +158,10 @@ OpenLayers.Tween = OpenLayers.Class({
this.time++;
if (this.callbacks && this.callbacks.eachStep) {
- this.callbacks.eachStep.call(this, value);
+ // skip frames if frame rate drops below threshold
+ if ((new Date().getTime() - this.startTime) / this.time <= 1000 / this.minFrameRate) {
+ this.callbacks.eachStep.call(this, value);
+ }
}
if (this.time > this.duration) {
diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js
index f4948edc37..f08ab257fc 100644
--- a/lib/OpenLayers/Util.js
+++ b/lib/OpenLayers/Util.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -962,8 +962,8 @@ OpenLayers.INCHES_PER_UNIT = {
'inches': 1.0,
'ft': 12.0,
'mi': 63360.0,
- 'm': 39.3701,
- 'km': 39370.1,
+ 'm': 39.37,
+ 'km': 39370,
'dd': 4374754,
'yd': 36
};
diff --git a/lib/OpenLayers/Util/vendorPrefix.js b/lib/OpenLayers/Util/vendorPrefix.js
index c6bf3fe72b..658719fc0e 100644
--- a/lib/OpenLayers/Util/vendorPrefix.js
+++ b/lib/OpenLayers/Util/vendorPrefix.js
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+ * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license.
diff --git a/lib/OpenLayers/WPSClient.js b/lib/OpenLayers/WPSClient.js
index dd36c3c2c1..1b783b4edf 100644
--- a/lib/OpenLayers/WPSClient.js
+++ b/lib/OpenLayers/WPSClient.js
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+ * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license.
diff --git a/lib/OpenLayers/WPSProcess.js b/lib/OpenLayers/WPSProcess.js
index 619972565f..88743575cf 100644
--- a/lib/OpenLayers/WPSProcess.js
+++ b/lib/OpenLayers/WPSProcess.js
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
+ * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license.
diff --git a/license.txt b/license.txt
index 20a789c3eb..cb829cc47d 100644
--- a/license.txt
+++ b/license.txt
@@ -1,4 +1,4 @@
-Copyright 2005-2012 OpenLayers Contributors. All rights reserved. See
+Copyright 2005-2013 OpenLayers Contributors. All rights reserved. See
authors.txt for full list.
Redistribution and use in source and binary forms, with or without modification,
diff --git a/notes/2.13.md b/notes/2.13.md
index 9de5f7626e..dd3ca649a1 100644
--- a/notes/2.13.md
+++ b/notes/2.13.md
@@ -37,6 +37,20 @@ Corresponding issues/pull requests:
# Behavior Changes from Past Releases
+## Layer.Grid: Tile queue and tileLoadingDelay changes
+
+With the introduction of OpenLayers.TileManager, tile queueing has become optional. The default behavior is back to how it was in OpenLayers 2.11. To use a tile queue in 2.13, the map needs to be configured with a tileManager, e.g.:
+
+ var map = new OpenLayers.Map('map', {
+ tileManager: new OpenLayers.TileManager()
+ });
+
+The tile queue also works differently than before: it no longer loads one tile at a time. Instead, it waits after a zoom or pan, and loads all tiles after a delay. This has the same effect as previously (less burden on the server), but makes use of the browser's request management. The delay can be configured separately for zooming and moving the map, using the `zoomDelay` (default: 200 ms) and `moveDelay` (default: 100 ms) config options of the TileManager.
+
+The `moveDelay` is the replacement for the `tileLoadingDelay` layer config option, which has been removed. There is no magic any more to only use the delay when requestAnimationFrame is not natively available.
+
+In general, when targeting mobile devices or when using slow servers or connections for tiled layers, it is recommended to configure the map with a TileManager.
+
## window.$ is no longer an alias for OpenLayers.Util.getElement
We do no longer create a global variable '$' when such a symbol isn't already
@@ -54,6 +68,14 @@ Corresponding issue/pull requests:
* https://github.com/openlayers/openlayers/pull/423
+## Map property fallThrough defaults to false
+
+The behaviour controlled by map property fallThrough wasn't consistent (some events were swallowed even with fallThrough set to true) and changes have been made to fix that. Defaulting fallThrough to false after this change is sensible in most situations and will probably be what most applications expect, but if you previously relied on pointer or keyboard events being passed through you will probably want to set fallThrough to true.
+
+Behavioural change was made in this commit:
+
+* https://github.com/openlayers/openlayers/commit/a6119f6a7528e013b922fd0d997a07df13f6bd6e
+
# New Options for Build Script
* add the contents of a file as a comment at the front of the build, for example, the output of 'git describe --tags' could be saved as a file and then included
diff --git a/readme.md b/readme.md
index f41fcc8bb8..e8e5dcb82e 100644
--- a/readme.md
+++ b/readme.md
@@ -1,6 +1,6 @@
# OpenLayers
-Copyright (c) 2005-2012 OpenLayers Contributors. See authors.txt for
+Copyright (c) 2005-2013 OpenLayers Contributors. See authors.txt for
more details.
OpenLayers is a JavaScript library for building map applications
diff --git a/tests/BaseTypes.html b/tests/BaseTypes.html
index cc391003da..045ac65491 100644
--- a/tests/BaseTypes.html
+++ b/tests/BaseTypes.html
@@ -278,6 +278,17 @@
OpenLayers.Number.decimalSeparator = ",";
t.eq(format(num, 3), "12.345,679", "changing thousands/decimal separator globally works");
}
+
+ function test_Number_zeroPad(t) {
+ t.plan(6);
+ var pad = OpenLayers.Number.zeroPad;
+ t.eq(pad(15, 4), "0015", "left padding works");
+ t.eq(pad(15, 2), "15", "no left padding when equal to number of digits");
+ t.eq(pad(15, 1), "15", "no left padding when less than number of digits");
+ t.eq(pad(10, 5, 2), "01010", "radix modified and padding works");
+ t.eq(pad(10, 5, 8), "00012", "radix modified and padding works");
+ t.eq(pad(10, 5, 36), "0000a", "radix modified and padding works");
+ }
function test_Function_bind(t) {
t.plan(12);
diff --git a/tests/Control/PinchZoom.html b/tests/Control/PinchZoom.html
index 788642d3da..1aa68f9c04 100644
--- a/tests/Control/PinchZoom.html
+++ b/tests/Control/PinchZoom.html
@@ -79,6 +79,53 @@
}
+ function test_pinchMove_preservecenter(t) {
+
+ var control = new OpenLayers.Control.PinchZoom({
+ preserveCenter: true
+ });
+
+ var map = new OpenLayers.Map({
+ div: "map",
+ controls: [control],
+ layers: [new OpenLayers.Layer('fake', {isBaseLayer: true})]
+ });
+ map.zoomToMaxExtent();
+
+ var centerPx = map.getPixelFromLonLat(map.getCenter());
+
+ control.pinchStart = function(evt, pinchData) {
+ t.eq(control.pinchOrigin, centerPx, "center preserved");
+ t.eq(control.currentCenter, centerPx, "center preserved");
+ }
+
+ control.pinchStart(null);
+
+ var log = [];
+ control.applyTransform = function(transform) {
+ log.push(transform);
+ }
+ control.pinchOrigin = map.getPixelFromLonLat(map.getCenter());
+
+ var cases = [
+ {scale: 1, transform: "translate(0px, 0px) scale(1)"},
+ {scale: 2, transform: "translate(-128px, -128px) scale(2)"},
+ {scale: 2.5, transform: "translate(-192px, -192px) scale(2.5)"},
+ {scale: 0.25, transform: "translate(96px, 96px) scale(0.25)"}
+ ];
+
+ var len = cases.length;
+ t.plan(2 + len*2);
+
+ var c;
+ for (var i=0; i
diff --git a/tests/Control/SelectFeature.html b/tests/Control/SelectFeature.html
index 150ab07c5c..6e522e77f9 100644
--- a/tests/Control/SelectFeature.html
+++ b/tests/Control/SelectFeature.html
@@ -545,6 +545,31 @@
t.eq((control.layers === null), true, "When using setLayer with a single layer, the layers property is removed if present before");
map.destroy();
}
+
+ function test_setLayerWithRemoving(t) {
+ t.plan(2);
+ var map = new OpenLayers.Map("map");
+ var layer1 = new OpenLayers.Layer.Vector();
+ var layer2 = new OpenLayers.Layer.Vector();
+ map.addLayer(layer1, layer2);
+ // initialize it with a single layer
+ var control = new OpenLayers.Control.SelectFeature(layer1);
+ map.addControl(control);
+ control.activate();
+ var noError = null;
+ map.events.register("preremovelayer", this, function(e) {
+ try {
+ control.setLayer(layer2);
+ } catch (e) {
+ noError = e;
+ }
+ });
+ layer1.destroy();
+ t.eq(layer2.id, control.layer.id, "Layer is set correctly without error");
+ t.eq(noError, null,"No error occured during setLayer. Error is: '"+noError+"'");
+ control.destroy();
+ map.destroy();
+ }
function test_destroy(t) {
t.plan(1);
diff --git a/tests/Format/EncodedPolyline.html b/tests/Format/EncodedPolyline.html
new file mode 100644
index 0000000000..1a93a41afa
--- /dev/null
+++ b/tests/Format/EncodedPolyline.html
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
diff --git a/tests/Format/WCSCapabilities.html b/tests/Format/WCSCapabilities.html
new file mode 100644
index 0000000000..b3e90b6bf3
--- /dev/null
+++ b/tests/Format/WCSCapabilities.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
diff --git a/tests/Format/WCSCapabilities/v1.html b/tests/Format/WCSCapabilities/v1.html
new file mode 100644
index 0000000000..180edc7d9f
--- /dev/null
+++ b/tests/Format/WCSCapabilities/v1.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
diff --git a/tests/Format/WFSCapabilities.html b/tests/Format/WFSCapabilities.html
index 4e6545e160..fc2ff2d0eb 100644
--- a/tests/Format/WFSCapabilities.html
+++ b/tests/Format/WFSCapabilities.html
@@ -40,4 +40,4 @@
-