diff --git a/examples/wms-image-custom-proj.js b/examples/wms-image-custom-proj.js index 4548247b84..c916a16df5 100644 --- a/examples/wms-image-custom-proj.js +++ b/examples/wms-image-custom-proj.js @@ -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' })], params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'}, - serverType: 'mapserver', + serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver'), extent: extent }) }) diff --git a/examples/wms-image.js b/examples/wms-image.js index dd495aac46..1e25cb53e2 100644 --- a/examples/wms-image.js +++ b/examples/wms-image.js @@ -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] }) }) diff --git a/examples/wms-no-proj.js b/examples/wms-no-proj.js index 260961b6b6..545b16a464 100644 --- a/examples/wms-no-proj.js +++ b/examples/wms-no-proj.js @@ -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/' }) }) diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index ea3509e0cb..8dc27ba5d6 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -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.} 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 diff --git a/src/ol/source/wmssource.exports b/src/ol/source/wmssource.exports new file mode 100644 index 0000000000..b5669e8ec7 --- /dev/null +++ b/src/ol/source/wmssource.exports @@ -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 diff --git a/src/ol/source/wmssource.js b/src/ol/source/wmssource.js index 630a0026b5..6dde4c7663 100644 --- a/src/ol/source/wmssource.js +++ b/src/ol/source/wmssource.js @@ -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 {