Strategies that request data (fixed and bbox currently) should transform geometries when the layer projection is different than the map projection. This adds reprojection support to the Fixed and BBOX strategies. Given more strategies that request data, we will likely want to extract out the common parts. r=elemoine (closes #1841)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8804 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-02-03 00:12:27 +00:00
parent 0a5204533d
commit 3edb925487
4 changed files with 203 additions and 57 deletions
+11
View File
@@ -88,6 +88,17 @@ OpenLayers.Strategy.Fixed = OpenLayers.Class(OpenLayers.Strategy, {
merge: function(resp) {
var features = resp.features;
if (features && features.length > 0) {
var remote = this.layer.projection;
var local = this.layer.map.getProjectionObject();
if(!local.equals(remote)) {
var geom;
for(var i=0, len=features.length; i<len; ++i) {
geom = features[i].geometry;
if(geom) {
geom.transform(remote, local);
}
}
}
this.layer.addFeatures(features);
}
},