Hello,

I'm trying to add a search function for a layer, using the <searchitem> node. 
I've already got some layers with that search implemented and it works fine.

Here's the searchitem i've added :
        <searchitem name="Boats" description="Boats">
            <layer type="postgis" name="Boats">
                <field type="n" name="boat_id" description="Boat id"  
wildcard="0" />
                <field type="s" name="boat_name" description="Boat name  
wildcard="0"/>
            </layer>
        </searchitem>

Here's the data used for this layer (using Mapscript) :
$layer->set("data", "geom FROM (SELECT * FROM boat_position AS p WHERE p.date = 
(SELECT max(c.date)  FROM coord_boats AS c WHERE c.date <= '$date' AND 
c.boat_id = p.boat_id)) as foo using unique boat_id using srid=27582");


boat_position is a view where I join data from 'boats' table (id, name...) with 
their coordinates from 'coord_boats' table (geom, date, angle...)
The result is the position of the boats which is the closest to the date 
specified with the $date variable. The date is set with a slider that I've put 
in the south Layout.

This layer is drawn fine by pmapper, and the request works fine when I test it 
on phpPgAdmin. But the search won't work. I've done many tests and it seems 
that the searchitem can't work with postgis data using a SELECT embedded in a 
WHERE...
Strangely, the toolbar works fine (you can identify the boats with the identify 
button of the toolbar). Only the searchitem doesn't work. The search works if I 
replace the select embedded in the where statement by a random date.

Anyone has an idea on how to solve this problem ?

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx
------------------------------------------------------------------------------
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to