[mapserver-users] record element in query header

Daniel Morissette dmorissette at mapgears.com
Wed Apr 7 15:46:41 EDT 2010


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/


More information about the mapserver-users mailing list