[OpenLayers-Users] Feature Info - multiple records at the same time

Richard Greenwood richard.greenwood at gmail.com
Fri Sep 5 19:06:40 EDT 2008

On Fri, Sep 5, 2008 at 4:15 PM, Karsten <karsten at terragis.net> wrote:
> Hi I am using OL as a front end for MapServer wms layers. I got the Feature
> Info example
> http://openlayers.org/dev/examples/getfeatureinfo.html?zoom=0&lat=0&lon=0&layers=B
> working for my map but was wondering how I would have to change it to be
> able to retrieve multiple results displayed (e.g. I identify a point feature
> (addresses) that has multiple people living at the address joined to it). So
> when I click on a point I want to retrieve and display the results on the
> webpage… I got it working with one joined record – but how can the get the
> remaining ones (if there are multiple joined people).
> The data in MapServer uses a select statement with a one to many join to the
> inhabitant table.

I think you are really close. The one-to-many join needs to happen on
the server, and MapServer does support one-to-many joins. You set it
up in the map file and create a template for the 'many' side which
gets populated once for each inhabitant. MapServer then hands this
back to OL as a single HTML document. I'm sorry that I don't have an
example handy, but take a look at the MapServer documentation and/or
search the MapServer mailing list archives.

Another approach, if you don't want to do the join in MapServer but
rather in a relational database is to present the 'one' side of the
relationship, and a link to the 'many' side which would open another


Richard Greenwood
richard.greenwood at gmail.com

More information about the Users mailing list