[OpenLayers-Users] Problems w/ sqlview and passing commas
Tito, Joseph
Joseph.Tito at cobham.com
Tue Sep 13 11:06:16 EDT 2011
Figured out a work around for this, so I figured I'd share it with
everyone.
Seems like if you pass parameters this way, it fails:
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'
}
);
But if you use the mergeNewParams function of the WMS layer, it works
just fine.
var events = new OpenLayers.Layer.WMS("Events",
"http://geoserver.joetito.com:80/geoserver/wfs",
{
layers: 'events',
transparent: true,
format: 'image/gif'
},
{
isBaseLayer: false
}
);
events.mergeNewParams({ viewparams: 'event_types:1\\,2' });
Thanks for all the help everyone!
Joe
From: Charles Galpin [mailto:cgalpin at lhsw.com]
Sent: Tuesday, September 13, 2011 9:35 AM
To: Tito, Joseph
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] Problems w/ sqlview and passing commas
On Sep 13, 2011, at 9:19 AM, Tito, Joseph wrote:
Charles,
Were you passing the viewparams like I am through javascript? Would you
be able to show me your javascript code and the sqlview you created?
Maybe I'm missing something small?
My javascript boils down to
var viewparams = 'ids:1\\,2\\,3';
store.load({
...
params: {
...
viewparams: viewparams
}
});
Where my store is a GeoExt.data.FeatureStore with a
OpenLayers.Layer.Vector layer
hth
charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110913/0e448387/attachment-0001.html
More information about the Users
mailing list