Rename _ol_source_TileWMS_ to TileWMS
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import TileLayer from '../../../../src/ol/layer/Tile.js';
|
||||
import _ol_source_TileWMS_ from '../../../../src/ol/source/TileWMS.js';
|
||||
import TileWMS from '../../../../src/ol/source/TileWMS.js';
|
||||
|
||||
describe('ol.rendering.source.TileWMS', function() {
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
||||
});
|
||||
|
||||
function createSource(gutter) {
|
||||
return new _ol_source_TileWMS_({
|
||||
return new TileWMS({
|
||||
params: {
|
||||
'LAYERS': 'layer'
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import TileLayer from '../../../../../src/ol/layer/Tile.js';
|
||||
import {get as getProjection} from '../../../../../src/ol/proj.js';
|
||||
import _ol_renderer_Map_ from '../../../../../src/ol/renderer/Map.js';
|
||||
import CanvasTileLayerRenderer from '../../../../../src/ol/renderer/canvas/TileLayer.js';
|
||||
import _ol_source_TileWMS_ from '../../../../../src/ol/source/TileWMS.js';
|
||||
import TileWMS from '../../../../../src/ol/source/TileWMS.js';
|
||||
import XYZ from '../../../../../src/ol/source/XYZ.js';
|
||||
import _ol_transform_ from '../../../../../src/ol/transform.js';
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('ol.renderer.canvas.TileLayer', function() {
|
||||
target.style.width = '100px';
|
||||
target.style.height = '100px';
|
||||
document.body.appendChild(target);
|
||||
source = new _ol_source_TileWMS_({
|
||||
source = new TileWMS({
|
||||
url: 'spec/ol/data/osm-0-0-0.png',
|
||||
params: {LAYERS: 'foo', TIME: '0'}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ImageTile from '../../../../src/ol/ImageTile.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_source_TileWMS_ from '../../../../src/ol/source/TileWMS.js';
|
||||
import TileWMS from '../../../../src/ol/source/TileWMS.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
|
||||
|
||||
@@ -26,18 +26,18 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
it('can be constructed without url or urls params', function() {
|
||||
var source = new _ol_source_TileWMS_({
|
||||
var source = new TileWMS({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: _ol_tilegrid_.createXYZ({maxZoom: 6})
|
||||
});
|
||||
expect(source).to.be.an(_ol_source_TileWMS_);
|
||||
expect(source).to.be.an(TileWMS);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getTile', function() {
|
||||
|
||||
it('returns a tile with the expected URL', function() {
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.an(ImageTile);
|
||||
var uri = new URL(tile.src_);
|
||||
@@ -66,7 +66,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('returns a larger tile when a gutter is specified', function() {
|
||||
options.gutter = 16;
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.an(ImageTile);
|
||||
var uri = new URL(tile.src_);
|
||||
@@ -83,7 +83,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('sets the SRS query value instead of CRS if version < 1.3', function() {
|
||||
options.params.VERSION = '1.2';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -94,7 +94,7 @@ describe('ol.source.TileWMS', function() {
|
||||
it('allows various parameters to be overridden', function() {
|
||||
options.params.FORMAT = 'image/jpeg';
|
||||
options.params.TRANSPARENT = false;
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -104,7 +104,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('does not add a STYLES= option if one is specified', function() {
|
||||
options.params.STYLES = 'foo';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -112,7 +112,7 @@ describe('ol.source.TileWMS', function() {
|
||||
});
|
||||
|
||||
it('changes the BBOX order for EN axis orientations', function() {
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -121,7 +121,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('uses EN BBOX order if version < 1.3', function() {
|
||||
options.params.VERSION = '1.1.0';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('CRS:84'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -130,7 +130,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('sets FORMAT_OPTIONS when the server is GeoServer', function() {
|
||||
options.serverType = 'geoserver';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 2, getProjection('CRS:84'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -139,7 +139,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('extends FORMAT_OPTIONS if it is already present', function() {
|
||||
options.serverType = 'geoserver';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
options.params.FORMAT_OPTIONS = 'param1:value1';
|
||||
var tile = source.getTile(3, 2, -3, 2, getProjection('CRS:84'));
|
||||
var uri = new URL(tile.src_);
|
||||
@@ -150,7 +150,7 @@ describe('ol.source.TileWMS', function() {
|
||||
it('rounds FORMAT_OPTIONS to an integer when the server is GeoServer',
|
||||
function() {
|
||||
options.serverType = 'geoserver';
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tile = source.getTile(3, 2, -3, 1.325, getProjection('CRS:84'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
@@ -163,7 +163,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('returns a tile if it is contained within layers extent', function() {
|
||||
options.extent = [-80, -40, -50, -10];
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tileCoord = [3, 2, -3];
|
||||
var url = source.tileUrlFunction(tileCoord, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(url);
|
||||
@@ -173,7 +173,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
it('returns a tile if it intersects layers extent', function() {
|
||||
options.extent = [-80, -40, -40, -10];
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tileCoord = [3, 3, -3];
|
||||
var url = source.tileUrlFunction(tileCoord, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(url);
|
||||
@@ -187,7 +187,7 @@ describe('ol.source.TileWMS', function() {
|
||||
resolutions: [1.40625, 0.703125, 0.3515625, 0.17578125],
|
||||
origin: [-180, -90]
|
||||
});
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var tileCoord = [3, 3, -3];
|
||||
var url = source.tileUrlFunction(tileCoord, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(url);
|
||||
@@ -201,7 +201,7 @@ describe('ol.source.TileWMS', function() {
|
||||
describe('#getGetFeatureInfoUrl', function() {
|
||||
|
||||
it('returns the expected GetFeatureInfo URL', function() {
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
source.pixelRatio_ = 1;
|
||||
var url = source.getGetFeatureInfoUrl(
|
||||
[-7000000, -12000000],
|
||||
@@ -235,7 +235,7 @@ describe('ol.source.TileWMS', function() {
|
||||
});
|
||||
|
||||
it('returns the expected GetFeatureInfo URL when source\'s projection is different from the parameter', function() {
|
||||
var source = new _ol_source_TileWMS_(optionsReproj);
|
||||
var source = new TileWMS(optionsReproj);
|
||||
source.pixelRatio_ = 1;
|
||||
var url = source.getGetFeatureInfoUrl(
|
||||
[-7000000, -12000000],
|
||||
@@ -265,7 +265,7 @@ describe('ol.source.TileWMS', function() {
|
||||
});
|
||||
|
||||
it('sets the QUERY_LAYERS param as expected', function() {
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
source.pixelRatio_ = 1;
|
||||
var url = source.getGetFeatureInfoUrl(
|
||||
[-7000000, -12000000],
|
||||
@@ -301,7 +301,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
describe('#setUrl()', function() {
|
||||
it('sets the correct url', function() {
|
||||
var source = new _ol_source_TileWMS_(options);
|
||||
var source = new TileWMS(options);
|
||||
var url = 'http://foo/';
|
||||
source.setUrl(url);
|
||||
var tileUrl = source.tileUrlFunction([0, 0, 0], 1, getProjection('EPSG:4326'));
|
||||
@@ -311,7 +311,7 @@ describe('ol.source.TileWMS', function() {
|
||||
|
||||
describe('#setUrls()', function() {
|
||||
it ('updates the source key', function() {
|
||||
var source = new _ol_source_TileWMS_({
|
||||
var source = new TileWMS({
|
||||
urls: ['u1', 'u2']
|
||||
});
|
||||
var originalKey = source.getKey();
|
||||
|
||||
Reference in New Issue
Block a user