Named exports from ol/uri

This commit is contained in:
Frederic Junod
2018-01-15 16:54:53 +01:00
parent 14eeaf88dc
commit 40f97eed85
8 changed files with 25 additions and 27 deletions

View File

@@ -9,7 +9,7 @@ import EventType from '../events/EventType.js';
import {containsExtent, getHeight, getWidth} from '../extent.js';
import _ol_obj_ from '../obj.js';
import ImageSource from '../source/Image.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -218,7 +218,7 @@ ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, pr
if (modifiedUrl == url) {
assert(false, 50); // `options.featureTypes` should be an Array
}
return _ol_uri_.appendParams(modifiedUrl, params);
return appendParams(modifiedUrl, params);
};

View File

@@ -8,7 +8,7 @@ import EventType from '../events/EventType.js';
import {containsExtent, getCenter, getHeight, getWidth, scaleFromCenter} from '../extent.js';
import _ol_obj_ from '../obj.js';
import ImageSource from '../source/Image.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -224,7 +224,7 @@ ImageMapGuide.prototype.getUrl = function(baseUrl, params, extent, size, project
'SETVIEWCENTERY': center[1]
};
_ol_obj_.assign(baseParams, params);
return _ol_uri_.appendParams(baseUrl, baseParams);
return appendParams(baseUrl, baseParams);
};

View File

@@ -15,7 +15,7 @@ import _ol_reproj_ from '../reproj.js';
import ImageSource from '../source/Image.js';
import WMSServerType from '../source/WMSServerType.js';
import _ol_string_ from '../string.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -308,7 +308,7 @@ ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projectio
}
params['BBOX'] = bbox.join(',');
return _ol_uri_.appendParams(/** @type {string} */ (this.url_), params);
return appendParams(/** @type {string} */ (this.url_), params);
};

View File

@@ -8,7 +8,7 @@ import _ol_obj_ from '../obj.js';
import _ol_size_ from '../size.js';
import TileImage from '../source/TileImage.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -125,7 +125,7 @@ TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExte
const modifiedUrl = url
.replace(/MapServer\/?$/, 'MapServer/export')
.replace(/ImageServer\/?$/, 'ImageServer/exportImage');
return _ol_uri_.appendParams(modifiedUrl, params);
return appendParams(modifiedUrl, params);
};

View File

@@ -15,7 +15,7 @@ import TileImage from '../source/TileImage.js';
import WMSServerType from '../source/WMSServerType.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_string_ from '../string.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -250,7 +250,7 @@ TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent,
const index = modulo(_ol_tilecoord_.hash(tileCoord), urls.length);
url = urls[index];
}
return _ol_uri_.appendParams(url, params);
return appendParams(url, params);
};

View File

@@ -10,7 +10,7 @@ import {get as getProjection, equivalent, transformExtent} from '../proj.js';
import TileImage from '../source/TileImage.js';
import WMTSRequestEncoding from '../source/WMTSRequestEncoding.js';
import {createFromCapabilitiesMatrixSet} from '../tilegrid/WMTS.js';
import _ol_uri_ from '../uri.js';
import {appendParams} from '../uri.js';
/**
* @classdesc
@@ -114,7 +114,7 @@ const WMTS = function(options) {
// special template params
template = (requestEncoding == WMTSRequestEncoding.KVP) ?
_ol_uri_.appendParams(template, context) :
appendParams(template, context) :
template.replace(/\{(\w+?)\}/g, function(m, p) {
return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m;
});
@@ -138,7 +138,7 @@ const WMTS = function(options) {
_ol_obj_.assign(localContext, dimensions);
let url = template;
if (requestEncoding == WMTSRequestEncoding.KVP) {
url = _ol_uri_.appendParams(url, localContext);
url = appendParams(url, localContext);
} else {
url = url.replace(/\{(\w+?)\}/g, function(m, p) {
return localContext[p];