On Tue, Sep 13, 2011 at 3:12 PM, Tito, Joseph <[email protected]>wrote:
> I’ve created the following sqlview and I’m trying to pass a comma separated
> list of “1,2,23,123” to %event_types% from javascript****
>
> ** **
>
> SELECT `fid`, `title`, `description`, `lonlat`,
> `event_type` FROM `events` WHERE `event_type` IN (%event_types%)****
>
> ** **
>
> Here is the javascript I’m using to create my WMS layer:****
>
> ** **
>
> var events = new OpenLayers.Layer.WMS("Events",****
>
> "
> http://geoserver.joetito.com:80/geoserver/wfs", ****
>
> {****
>
> layers: 'events', ****
>
> transparent: true, ****
>
> format: 'image/gif',****
>
> *viewparams:
> 'event_type:1,2' *
>
> }****
>
> );****
>
> ** **
>
> If I pass the string “event_type:1,2” or “event_type:1\,2”, GeoServer
> complains:****
>
> ** **
>
> 1 layers requested, but found 2 view params specified
>
Escaping with "\" is the way to go, but you should remember to properly
url-encode the "\",
don't know if OL does that automatically or not
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users