Skip to content

Commit

Permalink
reverse axis order for wms 1.3 & EPSG4326, close Leaflet#1897
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Nov 4, 2013
1 parent 5b40fad commit bd3409f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/layer/tile/TileLayer.WMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ L.TileLayer.WMS = L.TileLayer.extend({

this._crs = this.options.crs || map.options.crs;

var projectionKey = parseFloat(this.wmsParams.version) >= 1.3 ? 'crs' : 'srs';
this._wmsVersion = parseFloat(this.wmsParams.version);

var projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs';
this.wmsParams[projectionKey] = this._crs.code;

L.TileLayer.prototype.onAdd.call(this, map);
Expand All @@ -59,7 +61,9 @@ L.TileLayer.WMS = L.TileLayer.extend({

nw = this._crs.project(map.unproject(nwPoint, tilePoint.z)),
se = this._crs.project(map.unproject(sePoint, tilePoint.z)),
bbox = [nw.x, se.y, se.x, nw.y].join(','),
bbox = this._wmsVersion >= 1.3 && this._crs === L.CRS.EPSG4326 ?
[se.y, nw.x, nw.y, se.x].join(',') :
[nw.x, se.y, se.x, nw.y].join(','),

url = L.Util.template(this._url, {s: this._getSubdomain(tilePoint)});

Expand Down

0 comments on commit bd3409f

Please sign in to comment.