Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable vendor-specific parameter(s) for WMS source #959

Closed
SesticM opened this issue Dec 7, 2018 · 6 comments
Closed

Enable vendor-specific parameter(s) for WMS source #959

SesticM opened this issue Dec 7, 2018 · 6 comments
Labels

Comments

@SesticM
Copy link

SesticM commented Dec 7, 2018

Many map servers provide their own, vendor-specific URL parameters when handling WMS calls. Such parameters are out of standard Web Map Service specification, but contribute large amount during actual implementation. It would be of much help if WMSSource supported such capability via vendorSpecific property containing an array of name/value pairs (if any) being added to resulting GetMap URL call. Default value for vendorSpecific property would be, naturally, empty array. So, instead of writing a custom, JavaScript-based vendor-specific WMS source, an additional property to existing class would do the job.

Good example for this is GeoServer's WMS service and related vendor-specific parameters. GeoServer comes bundled with GeoWebCache, providing WMTS capability and caching out of the box. To be able to utilize GWC's GridSet functionality via "classic" WMS GetMap call, additional parameters (TILED, TILESORIGIN) are required. There are many other vendor-specific parameters available for GeoServer's WMS service.

@zarov zarov added feature 🍏 Adds a new feature good first issue labels Dec 10, 2018
@zarov
Copy link
Contributor

zarov commented Dec 10, 2018

Good remark ! This seems simple to patch in the current WMSSource, if you want to do a PR about it. Meanwhile you can also write your own WMSVendorSource inheriting from WMSSource if you want to add only specific parameters.

I quickly read the geoserver documentation, I didn't see any dynamic parameter, can you confirm that ?

@SesticM
Copy link
Author

SesticM commented Dec 11, 2018

Please find below possible use-cases of utilizing GeoServer-specific WMS vendor parameters:

  1. Single vendor-specific parameter:
var layer1 = new itowns.ColorLayer('dof_2012_02500_rs', {
	source: {
        	protocol: 'wms',
               	url: 'http://igeo.geoinova.com/geoserver/inova/wms',
               	name: 'inova:dof_2012_02500_rs',
                projection: 'EPSG:4326',
		transparent: true,
		format: 'image/png,
		vendorSpecific: [{'buffer':2}]
      	}
});
view.addLayer(layer1);

Produces:

http://igeo.geoinova.com/geoserver/inova/wms?SERVICE=WMS&REQUEST=GetMap&LAYERS=inova:dof_2012_02500_rs&VERSION=1.3.0&STYLES=&FORMAT=image/png&TRANSPARENT=true&BBOX=45.000000000,-135.000000000,90.000000000,-
90.000000000&CRS=EPSG:4326&WIDTH=256&HEIGHT=256&buffer=2
  1. Multiple vendor-specific parameters:
var layer2 = new itowns.ColorLayer('dof_2012_02500_rs', {
	source: {
        	protocol: 'wms',
               	url: 'http://igeo.geoinova.com/geoserver/inova/wms',
               	name: 'inova:dof_2012_02500_rs',
                projection: 'EPSG:4326',
		transparent: true,
		format: 'image/png,
		vendorSpecific: [{'tiled':true},{'tilesorigin'='0,0'}]
      	}
});
view.addLayer(layer2);

Produces:

http://igeo.geoinova.com/geoserver/inova/wms?SERVICE=WMS&REQUEST=GetMap&LAYERS=inova:dof_2012_02500_rs&VERSION=1.3.0&STYLES=&FORMAT=image/png&TRANSPARENT=true&BBOX=45.000000000,-135.000000000,90.000000000,-
90.000000000&CRS=EPSG:4326&WIDTH=256&HEIGHT=256&tiled=true&tilesorigin=0,0

@SesticM SesticM closed this as completed Dec 11, 2018
@SesticM SesticM reopened this Dec 11, 2018
@SesticM
Copy link
Author

SesticM commented Dec 11, 2018

Yes, I fully agree, in first I also intended to code down WMSGeoServerSource as WMSSource descendant, but then figured out that such implementation (and other related, potential implementations) might bloat Sources code-base. Frankly, it seems like a purely architectural descision...

zarov added a commit to zarov/itowns that referenced this issue Dec 17, 2018
Many map servers provide their own, vendor-specific URL parameters when
handling WMS calls. Such parameters are out of standard Web Map Service
specification, but contribute large amount during actual implementation.
A good example of such parameters is in the GeoServer documentation:
https://docs.geoserver.org/latest/en/user/services/wms/vendor.html

Solves iTowns#959
@SesticM
Copy link
Author

SesticM commented Dec 17, 2018

Besides WMS, WFS source may also benefit from vendor-specific parameters: GeoServer WFS documentation

@zarov
Copy link
Contributor

zarov commented Dec 18, 2018

Ok, extending it to WFS. You know even if you can't validate a PR, you can still comment on it, no problem !

zarov added a commit to zarov/itowns that referenced this issue Dec 18, 2018
Many map servers provide their own, vendor-specific URL parameters when
handling WMS calls. Such parameters are out of standard Web Map Service
specification, but contribute large amount during actual implementation.
A good example of such parameters is in the GeoServer documentation:
https://docs.geoserver.org/latest/en/user/services/wms/vendor.html

Solves iTowns#959
gchoqueux pushed a commit that referenced this issue Jan 8, 2019
Many map servers provide their own, vendor-specific URL parameters when
handling WMS calls. Such parameters are out of standard Web Map Service
specification, but contribute large amount during actual implementation.
A good example of such parameters is in the GeoServer documentation:
https://docs.geoserver.org/latest/en/user/services/wms/vendor.html

Solves #959
@zarov
Copy link
Contributor

zarov commented Jan 8, 2019

Solved in #973

@zarov zarov closed this as completed Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants