Merge pull request #1412 from fredj/vector-api-hidpi-cleanup

[vector-api] hidpi cleanup
This commit is contained in:
Éric Lemoine
2013-12-20 07:51:10 -08:00
6 changed files with 13 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ var layers = [
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg'
},
serverType: 'mapserver',
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver'),
extent: extent
})
}),
@@ -43,7 +43,7 @@ var layers = [
'National parks / geo.admin.ch</a>'
})],
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: 'mapserver',
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver'),
extent: extent
})
})

View File

@@ -15,7 +15,7 @@ var layers = [
source: new ol.source.ImageWMS({
url: 'http://demo.opengeo.org/geoserver/wms',
params: {'LAYERS': 'topp:states'},
serverType: 'geoserver',
serverType: /** @type {ol.source.wms.ServerType} */ ('geoserver'),
extent: [-13884991, 2870341, -7455066, 6338219]
})
})

View File

@@ -37,7 +37,7 @@ var layers = [
})],
crossOrigin: 'anonymous',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: 'mapserver',
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver'),
url: 'http://wms.geo.admin.ch/'
})
})

View File

@@ -543,9 +543,6 @@
* @property {ol.Extent|undefined} extent Extent.
* @property {boolean|undefined} hidpi Use the `ol.Map#devicePixelRatio` value when
* requesting the image from the remote server. Default is `true`.
* @property {ol.source.wms.ServerType|undefined} serverType The type of the remote WMS
* server: `mapserver`, `geoserver` or `qgis`. Only needed if `hidpi` is `true`.
* Default is `undefined`.
* @property {boolean|undefined} useOverlay If `true`, will use
* `GETDYNAMICMAPOVERLAYIMAGE`.
* @property {ol.proj.ProjectionLike} projection Projection.
@@ -607,6 +604,9 @@
* @property {ol.Extent|undefined} extent Extent.
* @property {boolean|undefined} hidpi Use the `ol.Map#devicePixelRatio` value when
* requesting the image from the remote server. Default is `true`.
* @property {ol.source.wms.ServerType|undefined} serverType The type of the remote WMS
* server: `mapserver`, `geoserver` or `qgis`. Only needed if `hidpi` is `true`.
* Default is `undefined`.
* @property {Object.<string,*>} params WMS request parameters. At least a
* `LAYERS` param is required. `STYLES` is `` by default. `VERSION` is
* `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX` and `CRS` (`SRS` for WMS

View File

@@ -0,0 +1,4 @@
@exportSymbol ol.source.wms.ServerType
@exportProperty ol.source.wms.ServerType.GEOSERVER
@exportProperty ol.source.wms.ServerType.MAPSERVER
@exportProperty ol.source.wms.ServerType.QGIS

View File

@@ -10,8 +10,8 @@ goog.require('goog.uri.utils');
* @enum {string}
*/
ol.source.wms.ServerType = {
MAPSERVER: 'mapserver',
GEOSERVER: 'geoserver',
MAPSERVER: 'mapserver',
QGIS: 'qgis'
};
@@ -63,7 +63,7 @@ ol.source.wms.getDpiParam = function(serverType, pixelRatio) {
if (serverType == ol.source.wms.ServerType.MAPSERVER) {
param['MAP_RESOLUTION'] = 90 * pixelRatio;
} else if (serverType == ol.source.wms.ServerType.GEOSERVER) {
param['FORMAT_OPTION'] = 'dpi:' + 90 * pixelRatio;
param['FORMAT_OPTIONS'] = 'dpi:' + 90 * pixelRatio;
} else if (serverType == ol.source.wms.ServerType.QGIS) {
param['DPI'] = 90 * pixelRatio;
} else {