From 720a81547951a834ee06a42bf2aa821d90ba1b1d Mon Sep 17 00:00:00 2001
From: Peter Robins
Date: Tue, 27 Mar 2012 12:13:23 +0100
Subject: [PATCH 01/16] Improvements for projection docs
---
lib/OpenLayers/Layer.js | 26 ++++++++++++++++++++------
lib/OpenLayers/Map.js | 13 ++++++++-----
lib/OpenLayers/Projection.js | 2 +-
3 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js
index ac1d896b07..b3026b5670 100644
--- a/lib/OpenLayers/Layer.js
+++ b/lib/OpenLayers/Layer.js
@@ -191,18 +191,32 @@ OpenLayers.Layer = OpenLayers.Class({
/**
* APIProperty: projection
- * {} or {} Set in the layer options to
- * override the default projection string this layer - also set maxExtent,
- * maxResolution, and units if appropriate. Can be either a string or
- * an object when created -- will be converted
- * to an object when setMap is called if a string is passed.
+ * {} or {} Specifies the projection of the layer.
+ * Can be set in the layer options. If not specified in the layer options,
+ * it is set to the default projection specified in the map,
+ * when the layer is added to the map.
+ * Projection along with default maxExtent and resolutions
+ * are set automatically with commercial baselayers in EPSG:3857,
+ * such as Google, Bing and OpenStreetMap, and do not need to be specified.
+ * Otherwise, if specifying projection, also set maxExtent,
+ * maxResolution or resolutions as appropriate.
+ * When using vector layers with strategies, layer projection should be set
+ * to the projection of the source data if that is different from the map default.
+ *
+ * Can be either a string or an object;
+ * if a string is passed, will be converted to an object when
+ * the layer is added to the map.
+ *
*/
projection: null,
/**
* APIProperty: units
- * {String} The layer map units. Defaults to 'degrees'. Possible values
+ * {String} The layer map units. Defaults to null. Possible values
* are 'degrees' (or 'dd'), 'm', 'ft', 'km', 'mi', 'inches'.
+ * Normally taken from the projection.
+ * Only required if both map and layers do not define a projection,
+ * or if they define a projection which does not define units.
*/
units: null,
diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js
index e11dc71efc..11594923ae 100644
--- a/lib/OpenLayers/Map.js
+++ b/lib/OpenLayers/Map.js
@@ -256,18 +256,21 @@ OpenLayers.Map = OpenLayers.Class({
/**
* APIProperty: projection
- * {String} Set in the map options to override the default projection
- * string this map. When using a projection other than EPSG:4326
+ * {String} Set in the map options to specify the default projection
+ * for layers added to this map. When using a projection other than EPSG:4326
* (CRS:84, Geographic) or EPSG:3857 (EPSG:900913, Web Mercator),
- * also set maxExtent and maxResolution. Default is "EPSG:4326".
+ * also set maxExtent, maxResolution or resolutions. Default is "EPSG:4326".
+ * Note that the projection of the map is usually determined
+ * by that of the current baseLayer (see and ).
*/
projection: "EPSG:4326",
/**
* APIProperty: units
* {String} The map units. Possible values are 'degrees' (or 'dd'), 'm',
- * 'ft', 'km', 'mi', 'inches'. Only required if the projection default
- * should be overridden.
+ * 'ft', 'km', 'mi', 'inches'. Normally taken from the projection.
+ * Only required if both map and layers do not define a projection,
+ * or if they define a projection which does not define units
*/
units: null,
diff --git a/lib/OpenLayers/Projection.js b/lib/OpenLayers/Projection.js
index 47b1dcabaa..9f0cbbd77a 100644
--- a/lib/OpenLayers/Projection.js
+++ b/lib/OpenLayers/Projection.js
@@ -54,7 +54,7 @@ OpenLayers.Projection = OpenLayers.Class({
* projCode - {String} A string identifying the Well Known Identifier for
* the projection.
* options - {Object} An optional object to set additional properties
- * on the layer.
+ * on the projection.
*
* Returns:
* {} A projection object.
From 1a59ade32a212494d621d257ed319a34d5e1fa9e Mon Sep 17 00:00:00 2001
From: Peter Robins
Date: Tue, 27 Mar 2012 15:53:01 +0100
Subject: [PATCH 02/16] Improve proj4js examples docs
---
examples/graticule.html | 2 +-
examples/using-proj4js.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/graticule.html b/examples/graticule.html
index 514f191e7b..c5a116d9f0 100644
--- a/examples/graticule.html
+++ b/examples/graticule.html
@@ -93,7 +93,7 @@
Graticule Example
- graticule, grid
+ graticule, grid, projection, proj4js, reproject, transform
diff --git a/examples/using-proj4js.html b/examples/using-proj4js.html
index 76add913df..6883d9b901 100644
--- a/examples/using-proj4js.html
+++ b/examples/using-proj4js.html
@@ -64,7 +64,7 @@
Using Proj4JS for vector reprojection
you would not inlude Proj4JS the way it is done in this example.
In a production environment you would furthermore have a local copy
of the Proj4JS-projection definition that is hotlinked in this
- example.
+ example (see Graticule example for how to do this).
From 3eedfce46e67b0da60a9dabb4ba96ef6a8deb5e8 Mon Sep 17 00:00:00 2001
From: ahocevar
Date: Tue, 27 Mar 2012 13:09:30 -0700
Subject: [PATCH 03/16] Fixing test after
5e9104a2a291929bc47b72aa9b72e58f867df7e0.
---
tests/Layer/Grid.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html
index a04dfc997a..dd716fa438 100644
--- a/tests/Layer/Grid.html
+++ b/tests/Layer/Grid.html
@@ -1203,17 +1203,17 @@
var layer = new OpenLayers.Layer.WMS('', '', {}, {
isBaseLayer: true,
singleTile: true,
- ratio: 1
+ ratio: 1.1
});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// move
- map.setCenter(new OpenLayers.LonLat(10, 10));
+ map.setCenter(new OpenLayers.LonLat(50, 50));
t.ok(layer.backBuffer && layer.backBuffer.parentNode === layer.div,
'backbuffer inserted after map move');
- t.eq(layer.backBuffer.style.left, '121%');
- t.eq(layer.backBuffer.style.top, '211%');
+ t.eq(layer.backBuffer.style.left, '-25%');
+ t.eq(layer.backBuffer.style.top, '-28%');
// zoom
map.zoomTo(1);
t.eq(layer.backBuffer, null,
From 74a34ec14be00aee4f6605283ac846d62abfdbac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Lemoine?=
Date: Sat, 24 Mar 2012 00:13:06 +0100
Subject: [PATCH 04/16] rely on the Flickr APIs in the strategy-bbox example
---
examples/strategy-bbox.html | 84 ++++++++++++++++++++++++++-----------
1 file changed, 59 insertions(+), 25 deletions(-)
diff --git a/examples/strategy-bbox.html b/examples/strategy-bbox.html
index 3b53c778da..1674113829 100644
--- a/examples/strategy-bbox.html
+++ b/examples/strategy-bbox.html
@@ -10,20 +10,46 @@
@@ -56,7 +86,7 @@
BBOX Strategy Example
- vector, feature, stylemap, wfs, bbox, strategy, cleanup
+ vector, feature, stylemap, bbox, strategy, script, flickr
Uses a BBOX strategy to request features within a bounding box.
@@ -67,6 +97,10 @@
BBOX Strategy Example
previously requested data bounds are invalidated (by browsing to
some area not covered by those bounds), another request for data
is issued.
+
+ This particular example uses the Flickr API.
+