New OpenLayers.Projection.defaults property.
This allows us to simplify the map and layer configuration, because now the projection also defines defaults for maxExtent, maxResolution and units. This change also adds transforms for SRS aliases for EPSG:4326 and centralizes axis order information in OpenLayers.Projection.defaults.
This commit is contained in:
@@ -56,9 +56,11 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* Property: yx
|
||||
* {Object} Keys in this object are EPSG codes for which the axis order
|
||||
* is to be reversed (yx instead of xy, LatLon instead of LonLat), with
|
||||
* true as value. This is only relevant for WMS versions >= 1.3.0.
|
||||
* true as value. This is only relevant for WMS versions >= 1.3.0, and
|
||||
* only if yx is not set in <OpenLayers.Projection.defaults> for the
|
||||
* used projection.
|
||||
*/
|
||||
yx: {'EPSG:4326': true},
|
||||
yx: {},
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS
|
||||
@@ -173,8 +175,9 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* {Boolean} true if the axis order is reversed, false otherwise.
|
||||
*/
|
||||
reverseAxisOrder: function() {
|
||||
return (parseFloat(this.params.VERSION) >= 1.3 &&
|
||||
!!this.yx[this.map.getProjectionObject().getCode()]);
|
||||
var projCode = this.map.getProjectionObject().getCode();
|
||||
return parseFloat(this.params.VERSION) >= 1.3 &&
|
||||
!!(this.yx[projCode] || OpenLayers.Projection.defaults[projCode].yx);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user