[OpenLayers-Users] Control.WMSGetFeatureInfo styles are
"undefined"
Andreas Hocevar
ahocevar at opengeo.org
Wed Jun 24 15:52:34 EDT 2009
Hi,
On Wed, Jun 24, 2009 at 3:48 PM, Frank Broniewski<brfr at metrico.lu> wrote:
> I have a problem with my Mapserver WMS server and the
> OpenLayers.Control.WMSGetFeatureInfo. When the query url is constructed by
> Control.WMSGetFeatureInfo, the styles parameter is a list of "undefined"
> styles: styles=undefined,undefined,undefinded,undefined. And my mapserver
> chokes on the "undefined". Looking at the example
> http://www.openlayers.org/dev/examples/getfeatureinfo-control.html the styles
> parameter is empty. How can I achieve that?
You have found a bug. Please follow the instructions on
http://trac.openlayers.org/wiki/FilingTickets to create a bug report.
But in the meantime, I have a workaround for you:
> // the WMS layer
> var strasse = new OpenLayers.Layer.WMS (
> strasse_layername, routes_url,
> { layers: ['autorouten','radwege','wanderwege','pois'], format:
> 'image/png', transparent: true },
change the above to
{ layers:
['autorouten','radwege','wanderwege','pois'], styles: ['','','',''],
format:
'image/png', transparent: true },
> { isBaseLayer: false, singleTile: true } );
>
> // the WMSGetFeatureInfo control
> var infoControls = { click: new OpenLayers.Control.WMSGetFeatureInfo(
> { url: routes_url,
> title: 'Identify features by clicking',
> layers: [strasse],
> queryVisible: true,
> infoFormat: 'application/vnd.ogc.gml' } ) };
> infoControls['click'].events.register("getfeatureinfo", this, showInfo);
> map.addControl(infoControls['click']);
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list