Christian
Christian
Hei everybody! Just found this thread. :-) I have the same problem. I have several layers which result in SQL queries to geoserver. The only difference is a 'viewparams' parameter....
Hei and thank you for your reply. When adding viewparams to a WMS layer definition they are added to the query, but when clicking on a feature and then requesting...
That works well when only having ONE layer and adding some parameters to it. But when you have 2 layers which have different viewparams it doesn't. If you specify vendorparams...
@bartvde, that's the problem. ;-) I haven't figured out how to associate one set of viewParams/vendorParms with layer ONE and another set of params with layer TWO where the layers...
Hi again, found the solution. Just to round up... ;-) view parameters (geoserver) have to be separated by commas (,) when applying different parameters to several layers (http://docs.geoserver.org/stable/en/user/data/database/sqlview.html?highlight=viewparams). Number of...
In your case the generated viewparams in the getfeatureinfo URL should look like: &VIEWPARAMS=periodname:M200405,periodname:M200505 In my case the generated query to geoserver looks like this http://some.host.com/geoserver/marenor/wms?LAYERS=marenor%3AVesselAccident,marenor%3AVesselAccident&QUERY_LAYERS=marenor%3AVesselAccident,marenor%3AVesselAccident&STYLES=,&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=125573.169586%2C-2128225.949283%2C1227600.259337%2C-1731099.070094&FEATURE_COUNT=5&HEIGHT=360&WIDTH=999&FORMAT=image%2Fpng&INFO_FORMAT=application%2Fvnd.ogc.gml&SRS=EPSG%3A3575&X=442&Y=234&BUFFER=20&VIEWPARAMS=fartoeystype%3A9%25%2Cfartoeystype%3A7%25 or, a bit more...
Sorry @emoen for late reply. Saw it first now. :-( Geoserver doesn't generate any AND or OR in an SQL query. It just replaces the text between two percentage signs...