Rename source.wms.ServerType ➛ source.WMSServerType
This commit is contained in:
@@ -22,6 +22,7 @@ A number of internal types have been renamed. This will not affect those who us
|
||||
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
|
||||
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
|
||||
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
|
||||
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
|
||||
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
|
||||
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
|
||||
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
|
||||
|
||||
@@ -41,7 +41,7 @@ var layers = [
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
},
|
||||
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver')
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
|
||||
})
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
@@ -52,7 +52,7 @@ var layers = [
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">National parks / geo.admin.ch</a>',
|
||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver')
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
|
||||
})
|
||||
})
|
||||
];
|
||||
|
||||
@@ -5175,7 +5175,7 @@ olx.source.RasterOptions.prototype.operationType;
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
* serverType: (ol.source.WMSServerType|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
|
||||
* params: Object.<string,*>,
|
||||
@@ -5219,7 +5219,7 @@ olx.source.ImageWMSOptions.prototype.hidpi;
|
||||
/**
|
||||
* The type of the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only
|
||||
* needed if `hidpi` is `true`. Default is `undefined`.
|
||||
* @type {ol.source.wms.ServerType|string|undefined}
|
||||
* @type {ol.source.WMSServerType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageWMSOptions.prototype.serverType;
|
||||
@@ -5686,7 +5686,7 @@ olx.source.TileJSONOptions.prototype.wrapX;
|
||||
* tileGrid: (ol.tilegrid.TileGrid|undefined),
|
||||
* projection: ol.ProjectionLike,
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
* serverType: (ol.source.WMSServerType|string|undefined),
|
||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||
* url: (string|undefined),
|
||||
* urls: (Array.<string>|undefined),
|
||||
@@ -5797,7 +5797,7 @@ olx.source.TileWMSOptions.prototype.reprojectionErrorThreshold;
|
||||
/**
|
||||
* The type of the remote WMS server. Currently only used when `hidpi` is
|
||||
* `true`. Default is `undefined`.
|
||||
* @type {ol.source.wms.ServerType|string|undefined}
|
||||
* @type {ol.source.WMSServerType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.serverType;
|
||||
|
||||
@@ -11,7 +11,7 @@ goog.require('ol.extent');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.Image');
|
||||
goog.require('ol.source.wms.ServerType');
|
||||
goog.require('ol.source.WMSServerType');
|
||||
goog.require('ol.string');
|
||||
goog.require('ol.uri');
|
||||
|
||||
@@ -72,10 +72,10 @@ ol.source.ImageWMS = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.source.wms.ServerType|undefined}
|
||||
* @type {ol.source.WMSServerType|undefined}
|
||||
*/
|
||||
this.serverType_ =
|
||||
/** @type {ol.source.wms.ServerType|undefined} */ (options.serverType);
|
||||
/** @type {ol.source.WMSServerType|undefined} */ (options.serverType);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -278,7 +278,7 @@ ol.source.ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio,
|
||||
|
||||
if (pixelRatio != 1) {
|
||||
switch (this.serverType_) {
|
||||
case ol.source.wms.ServerType.GEOSERVER:
|
||||
case ol.source.WMSServerType.GEOSERVER:
|
||||
var dpi = (90 * pixelRatio + 0.5) | 0;
|
||||
if ('FORMAT_OPTIONS' in params) {
|
||||
params['FORMAT_OPTIONS'] += ';dpi:' + dpi;
|
||||
@@ -286,11 +286,11 @@ ol.source.ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio,
|
||||
params['FORMAT_OPTIONS'] = 'dpi:' + dpi;
|
||||
}
|
||||
break;
|
||||
case ol.source.wms.ServerType.MAPSERVER:
|
||||
case ol.source.WMSServerType.MAPSERVER:
|
||||
params['MAP_RESOLUTION'] = 90 * pixelRatio;
|
||||
break;
|
||||
case ol.source.wms.ServerType.CARMENTA_SERVER:
|
||||
case ol.source.wms.ServerType.QGIS:
|
||||
case ol.source.WMSServerType.CARMENTA_SERVER:
|
||||
case ol.source.WMSServerType.QGIS:
|
||||
params['DPI'] = 90 * pixelRatio;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -12,7 +12,7 @@ goog.require('ol.math');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.size');
|
||||
goog.require('ol.source.TileImage');
|
||||
goog.require('ol.source.wms.ServerType');
|
||||
goog.require('ol.source.WMSServerType');
|
||||
goog.require('ol.tilecoord');
|
||||
goog.require('ol.string');
|
||||
goog.require('ol.uri');
|
||||
@@ -69,10 +69,10 @@ ol.source.TileWMS = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.source.wms.ServerType|undefined}
|
||||
* @type {ol.source.WMSServerType|undefined}
|
||||
*/
|
||||
this.serverType_ =
|
||||
/** @type {ol.source.wms.ServerType|undefined} */ (options.serverType);
|
||||
/** @type {ol.source.WMSServerType|undefined} */ (options.serverType);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -222,7 +222,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileE
|
||||
|
||||
if (pixelRatio != 1) {
|
||||
switch (this.serverType_) {
|
||||
case ol.source.wms.ServerType.GEOSERVER:
|
||||
case ol.source.WMSServerType.GEOSERVER:
|
||||
var dpi = (90 * pixelRatio + 0.5) | 0;
|
||||
if ('FORMAT_OPTIONS' in params) {
|
||||
params['FORMAT_OPTIONS'] += ';dpi:' + dpi;
|
||||
@@ -230,11 +230,11 @@ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileE
|
||||
params['FORMAT_OPTIONS'] = 'dpi:' + dpi;
|
||||
}
|
||||
break;
|
||||
case ol.source.wms.ServerType.MAPSERVER:
|
||||
case ol.source.WMSServerType.MAPSERVER:
|
||||
params['MAP_RESOLUTION'] = 90 * pixelRatio;
|
||||
break;
|
||||
case ol.source.wms.ServerType.CARMENTA_SERVER:
|
||||
case ol.source.wms.ServerType.QGIS:
|
||||
case ol.source.WMSServerType.CARMENTA_SERVER:
|
||||
case ol.source.WMSServerType.QGIS:
|
||||
params['DPI'] = 90 * pixelRatio;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
/**
|
||||
* @namespace ol.source.wms
|
||||
*/
|
||||
@@ -1,5 +1,4 @@
|
||||
goog.provide('ol.source.wms');
|
||||
goog.provide('ol.source.wms.ServerType');
|
||||
goog.provide('ol.source.WMSServerType');
|
||||
|
||||
|
||||
/**
|
||||
@@ -8,7 +7,7 @@ goog.provide('ol.source.wms.ServerType');
|
||||
* specification that OpenLayers can make use of.
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.source.wms.ServerType = {
|
||||
ol.source.WMSServerType = {
|
||||
CARMENTA_SERVER: 'carmentaserver',
|
||||
GEOSERVER: 'geoserver',
|
||||
MAPSERVER: 'mapserver',
|
||||
Reference in New Issue
Block a user