[OpenLayers-Users] Control.WMSGetFeatureInfo problem

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Thu Sep 3 11:10:16 EDT 2009


Thanks Andreas,
When I create the layer, visibility is set to false. But in runtime I make 
it visible (note that I don't use the layerswitcher but the mapfish 
layertree). Then I launch the query.
As I said it return results when I don't specify the layers property and I 
make the layer visible with the layertree.


I tried removing the url property and the behavior is the same.
If I don't specify the layers property and set queryVisible to false I got 
this message:

msWMSLoadGetMapParams(): WMS server error. Invalid style 
(,,,,,,,,,,,,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,,,). 
Mapserver is expecting an empty string for the STYLES : STYLES= or 
STYLES=,,, or using keyword default STYLES=default,default, ... 

>From another thread I read that using this in the params of the layer 
might help: ,styles: ['','','','']
But I stil get the error message above.

Still can't point out where the problem is.
Regards
Steve


Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 




Andreas Hocevar <ahocevar at opengeo.org>@openlayers.org 
Envoyé par : users-bounces at openlayers.org
03/09/2009 10:49 AM

A
Steve.Toutant at inspq.qc.ca
cc
users at openlayers.org
Objet
Re: [OpenLayers-Users] Control.WMSGetFeatureInfo problem








Hi Steve,

Steve.Toutant at inspq.qc.ca wrote:
> When I define the Control.WMSGetFeatureInfo if I don't specify the
> "layers:" properties, every visible layers with a Template in the
> mapfile are queried and I get the results. That is as expected. My
> problem is when I want to specify one layer to query. The request is
> not launched (I see nothing in firebug). Here is the code
>
> test = new OpenLayers.Layer.WMS('HLM',
> 
'http://10.2.192.247/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante_chaleur.map&',
> {layers: 'HLM', transparent: "true", format:"image/gif"},{isBaseLayer:
> false, visibility: false,singleTile:true});
> map.addLayer(test);

Note: visibilty is set to false. This means that the layer will be hidden.

> infoControls =
> {
> click: new OpenLayers.Control.WMSGetFeatureInfo({
> url:
> 
'http://10.2.192.247/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante_chaleur.map',
>
> title: 'Identify features by clicking',
> layers: [test],
> queryVisible: true,
> infoFormat:'text/html'
> })
> }

Note: queryVisible is set to true. This means that hidden layers won't
be queried.

So the behavior that the control does not issue any request is correct.
Set queryVisible to false, and you will be fine. If it still does not
work, remove the url property from the control config. This will be
taken from the layer and may prevent the control from issuing queries if
different from the layer url.

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090903/bfb52730/attachment.html


More information about the Users mailing list