Skip to content

Commit 8d48d24

Browse files
committed
SFD-260
Fixed issue with projection variable not being declared.
1 parent 7a834cb commit 8d48d24

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

oscar/src/main/javascript/oscar/lib/oscar/Layer/GetCoveragePreview.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@ oscar.Layer.GetCoveragePreview = new oscar.BaseClass(OpenLayers.Layer.WMS, {
3434
OpenLayers.Layer.WMS.prototype.initialize.apply(this, [ name, url, params, options ]);
3535
},
3636
getFullRequestString : function(newparams, altUrl) {
37-
37+
38+
var projection = this.map.getProjection();
39+
40+
if (projection == "EPSG:900913") {
41+
projection = "EPSG:3857";
42+
}
43+
3844
var resolution = this.map.getResolution();
45+
3946
newparams.GRIDOFFSETS = resolution + "," + (resolution * -1);
4047
newparams.IDENTIFIER = this.params.IDENTIFIER;
4148
newparams.SERVICEENDPOINT = this.params.SERVICEENDPOINT;
4249
newparams.RANGESUBSET = this.params.RANGESUBSET;
43-
44-
if(projection == "EPSG:900913") {
45-
projection = "EPSG:3857";
46-
}
47-
4850
newparams.GRIDBASECRS = oscar.Util.EpsgConversion.epsgToUrn(projection);
4951
var qString = OpenLayers.Layer.WMS.prototype.getFullRequestString.apply(this, [ newparams, altUrl ]);
50-
52+
5153
return qString;
5254
},
5355
CLASS_NAME : "oscar.Layer.GetCoveragePreview"

0 commit comments

Comments
 (0)