Renaming of getGetFeatureInfoUrl and getGetLegendGraphicUrl

This commit is contained in:
Simon Seyock
2019-09-18 10:38:34 +02:00
parent 10326d0e81
commit b2885e86fb
9 changed files with 30 additions and 26 deletions

View File

@@ -243,11 +243,11 @@ describe('ol.source.ImageWMS', function() {
});
describe('#getGetFeatureInfoUrl', function() {
describe('#getFeatureInfoUrl', function() {
it('returns the expected GetFeatureInfo URL', function() {
const source = new ImageWMS(options);
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[20, 30], resolution, projection,
{INFO_FORMAT: 'text/plain'});
const uri = new URL(url);
@@ -275,7 +275,7 @@ describe('ol.source.ImageWMS', function() {
it('returns the expected GetFeatureInfo URL when source\'s projection is different from the parameter', function() {
const source = new ImageWMS(optionsReproj);
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[20, 30], resolution, projection,
{INFO_FORMAT: 'text/plain'});
const uri = new URL(url);
@@ -303,7 +303,7 @@ describe('ol.source.ImageWMS', function() {
it('sets the QUERY_LAYERS param as expected', function() {
const source = new ImageWMS(options);
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[20, 30], resolution, projection,
{INFO_FORMAT: 'text/plain', QUERY_LAYERS: 'foo,bar'});
const uri = new URL(url);
@@ -330,11 +330,11 @@ describe('ol.source.ImageWMS', function() {
});
});
describe('#getGetLegendGraphicUrl', function() {
describe('#getLegendUrl', function() {
it('returns the getLegendGraphic url as expected', function() {
it('returns the GetLegendGraphic url as expected', function() {
const source = new ImageWMS(options);
const url = source.getGetLegendGraphicUrl(resolution);
const url = source.getLegendUrl(resolution);
const uri = new URL(url);
expect(uri.protocol).to.be('http:');
expect(uri.hostname).to.be('example.com');
@@ -350,7 +350,7 @@ describe('ol.source.ImageWMS', function() {
it('does not include SCALE if no resolution was provided', function() {
const source = new ImageWMS(options);
const url = source.getGetLegendGraphicUrl();
const url = source.getLegendUrl();
const uri = new URL(url);
const queryData = uri.searchParams;
expect(queryData.get('SCALE')).to.be(null);
@@ -358,7 +358,7 @@ describe('ol.source.ImageWMS', function() {
it('adds additional params as expected', function() {
const source = new ImageWMS(options);
const url = source.getGetLegendGraphicUrl(resolution, {
const url = source.getLegendUrl(resolution, {
STYLE: 'STYLE_VALUE',
FEATURETYPE: 'FEATURETYPE_VALUE',
RULE: 'RULE_VALUE',

View File

@@ -198,12 +198,12 @@ describe('ol.source.TileWMS', function() {
});
describe('#getGetFeatureInfoUrl', function() {
describe('#getFeatureInfoUrl', function() {
it('returns the expected GetFeatureInfo URL', function() {
const source = new TileWMS(options);
source.pixelRatio_ = 1;
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[-7000000, -12000000],
19567.87924100512, getProjection('EPSG:3857'),
{INFO_FORMAT: 'text/plain'});
@@ -237,7 +237,7 @@ describe('ol.source.TileWMS', function() {
it('returns the expected GetFeatureInfo URL when source\'s projection is different from the parameter', function() {
const source = new TileWMS(optionsReproj);
source.pixelRatio_ = 1;
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[-7000000, -12000000],
19567.87924100512, getProjection('EPSG:3857'),
{INFO_FORMAT: 'text/plain'});
@@ -267,7 +267,7 @@ describe('ol.source.TileWMS', function() {
it('sets the QUERY_LAYERS param as expected', function() {
const source = new TileWMS(options);
source.pixelRatio_ = 1;
const url = source.getGetFeatureInfoUrl(
const url = source.getFeatureInfoUrl(
[-7000000, -12000000],
19567.87924100512, getProjection('EPSG:3857'),
{INFO_FORMAT: 'text/plain', QUERY_LAYERS: 'foo,bar'});
@@ -299,11 +299,11 @@ describe('ol.source.TileWMS', function() {
});
});
describe('#getGetLegendGraphicUrl', function() {
describe('#getLegendGraphicUrl', function() {
it('returns the getLegenGraphic url as expected', function() {
const source = new TileWMS(options);
const url = source.getGetLegendGraphicUrl(0.1);
const url = source.getLegendUrl(0.1);
const uri = new URL(url);
expect(uri.protocol).to.be('http:');
expect(uri.hostname).to.be('example.com');
@@ -319,7 +319,7 @@ describe('ol.source.TileWMS', function() {
it('does not include SCALE if no resolution was provided', function() {
const source = new TileWMS(options);
const url = source.getGetLegendGraphicUrl();
const url = source.getLegendUrl();
const uri = new URL(url);
const queryData = uri.searchParams;
expect(queryData.get('SCALE')).to.be(null);
@@ -327,7 +327,7 @@ describe('ol.source.TileWMS', function() {
it('adds additional params as expected', function() {
const source = new TileWMS(options);
const url = source.getGetLegendGraphicUrl(0.1, {
const url = source.getLegendUrl(0.1, {
STYLE: 'STYLE_VALUE',
FEATURETYPE: 'FEATURETYPE_VALUE',
RULE: 'RULE_VALUE',