Files
openlayers/src/ol/imageurlfunction.js
ahocevar 4bb521db65 WMS GetMap request parameters shall be params
To avoid surprises, we configure everything that is a WMS GetMap
request parameter in the params object, and not as direct
configuration option. This affects the VERSION and TRANSPARENT
params.
2013-03-05 10:54:33 +01:00

38 lines
890 B
JavaScript

goog.provide('ol.ImageUrlFunction');
goog.provide('ol.ImageUrlFunctionType');
goog.require('ol.Extent');
goog.require('ol.Size');
goog.require('ol.source.wms');
/**
* @typedef {function(ol.Extent, ol.Size, ol.Projection): (string|undefined)}
*/
ol.ImageUrlFunctionType;
/**
* @param {string} baseUrl Base URL (may have query data).
* @param {Object.<string, string|number>} params WMS parameters.
* @return {ol.ImageUrlFunctionType} Image URL function.
*/
ol.ImageUrlFunction.createWMSParams =
function(baseUrl, params) {
return function(extent, size, projection) {
return ol.source.wms.getUrl(
baseUrl, params, extent, size, projection);
};
};
/**
* @param {ol.Extent} extent Extent.
* @param {ol.Size} size Size.
* @return {string|undefined} Image URL.
*/
ol.ImageUrlFunction.nullImageUrlFunction =
function(extent, size) {
return undefined;
};