[mapserver-users] record element in query header

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Apr 7 16:03:10 EDT 2010


But the problem with what you ask is that when the header is processed, 
there is no active data record yet. The header is global to the layer
OK, I got to find another solution

The client I use is openlayers
I configured this control OpenLayers.Control.WMSGetFeatureInfo
So when I click on a province, this query is launched

/cgi-bin/mapserv.exe?map=PORTAL&&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=RSSavertissements&QUERY_LAYERS=RSSavertissements&STYLES=&BBOX=-8882077.807097%2C5589075.535908%2C-6925289.883347%2C7545863.459658&FEATURE_COUNT=10&HEIGHT=400&WIDTH=400&FORMAT=image%2Fgif&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A900913&X=333&Y=277

The text returned is defined by the template that is why I though the 
solution would be on mapServer side.
thanks
steve





Daniel Morissette <dmorissette at mapgears.com>@lists.osgeo.org 
Envoyé par : mapserver-users-bounces at lists.osgeo.org
07/04/2010 03:46 PM

A
mapserver-users at lists.osgeo.org
cc

Objet
Re: [mapserver-users] record element in query header








Steve.Toutant at inspq.qc.ca wrote:
> 
> Thanks!
> Here is more details on what I need to do
> Suppose I have one layer which contains the province in canada and their 

> cities.
> When the user hover or click on a province, I want this information in a 

> popup or a div (the client is openlayers and I use 
> OpenLayers.Control.WMSGetFeatureInfo)
> 
> If the user click on the province of Quebec....
> There are 2000 cities in Quebec
> 1: city name 1
> 2: city name 2
> ...
> 2000: city name 2000
> 
> So In this case I think a field name should be supported in a header 
> template
> 


But the problem with what you ask is that when the header is processed, 
there is no active data record yet. The header is global to the layer, 
not specific to any data record. If for instance, your query selected 
cities from three provinces, which data field value should show up in 
the header for [provincename]? Only the value corresponding to the first 
record?

You'd get something like:

There are 2000 cities in Quebec
1: city name 1 (Quebec)
2: city name 2 (Ontario)
3: city name 3 (Ontario)
4: city name 4 (Ontario)
2: city name 5 (New-Brunswick)
...
2000: city name 2000

How do you ensure that your queries return results only from a single 
province at a time? The answer to this question may point us to the way 
to solve your problem.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100407/6f04daa7/attachment-0001.html


More information about the mapserver-users mailing list