Port ol.source.WMS to new extents
This commit is contained in:
@@ -34,8 +34,8 @@ ol.source.wms.getUrl =
|
|||||||
|
|
||||||
var axisOrientation = projection.getAxisOrientation();
|
var axisOrientation = projection.getAxisOrientation();
|
||||||
var bboxValues = (wms13 && axisOrientation.substr(0, 2) == 'ne') ?
|
var bboxValues = (wms13 && axisOrientation.substr(0, 2) == 'ne') ?
|
||||||
[extent.minY, extent.minX, extent.maxY, extent.maxX] :
|
[extent[2], extent[0], extent[3], extent[1]] :
|
||||||
[extent.minX, extent.minY, extent.maxX, extent.maxY];
|
[extent[0], extent[2], extent[1], extent[3]];
|
||||||
baseParams['BBOX'] = bboxValues.join(',');
|
baseParams['BBOX'] = bboxValues.join(',');
|
||||||
|
|
||||||
return goog.uri.utils.appendParamsFromMap(baseUrl, baseParams);
|
return goog.uri.utils.appendParamsFromMap(baseUrl, baseParams);
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ describe('ol.source.wms', function() {
|
|||||||
describe('ol.source.wms.getUrl', function() {
|
describe('ol.source.wms.getUrl', function() {
|
||||||
it('creates expected URL', function() {
|
it('creates expected URL', function() {
|
||||||
var epsg3857 = ol.projection.get('EPSG:3857');
|
var epsg3857 = ol.projection.get('EPSG:3857');
|
||||||
var extent = new ol.Extent(
|
var extent = [-20037508.342789244, 0, -20037508.342789244, 0];
|
||||||
-20037508.342789244, -20037508.342789244, 0, 0);
|
|
||||||
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
|
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
|
||||||
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
|
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
|
||||||
'foo=bar&STYLES=&CRS=EPSG%3A3857&BBOX=' +
|
'foo=bar&STYLES=&CRS=EPSG%3A3857&BBOX=' +
|
||||||
@@ -17,7 +16,7 @@ describe('ol.source.wms', function() {
|
|||||||
});
|
});
|
||||||
it('creates expected URL respecting axis orientation', function() {
|
it('creates expected URL respecting axis orientation', function() {
|
||||||
var epsg4326 = ol.projection.get('EPSG:4326');
|
var epsg4326 = ol.projection.get('EPSG:4326');
|
||||||
var extent = new ol.Extent(-180, -90, 0, 90);
|
var extent = [-180, 0, -90, 90];
|
||||||
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
|
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
|
||||||
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
|
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
|
||||||
'foo=bar&STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';
|
'foo=bar&STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';
|
||||||
@@ -30,7 +29,6 @@ describe('ol.source.wms', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Size');
|
goog.require('ol.Size');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.projection');
|
||||||
goog.require('ol.source.wms');
|
goog.require('ol.source.wms');
|
||||||
|
|||||||
Reference in New Issue
Block a user