Can someone help

Stéphane RIFF stephane.riff at CERENE.FR
Fri Feb 25 02:58:43 PST 2005


I don't remember exactly how it's work
but the result of your queyByPoint should return all the indexes
 highlighted on the map

Look at this code, it's not workable but hope it give you idea:

call queryByxxx() function
after call this function :

function dumpQueryResults()
{
    GLOBAL $map;

    $first = true;

    $numResultsTotal = 0;

    for($iLayer=0; $iLayer < $map->numlayers; $iLayer++)
    {
        $oLayer = $map->GetLayer($iLayer);
        $numResults = $oLayer->getNumResults();
        if ($numResults == 0)
            continue;  // No results in this layer

        $oLayer->open("");
        $selFields = explode(" ", $oLayer->getMetaData("RESULT_FIELDS"));
        //
        // One row in table for each selected record
        //
        for ($iRes=0; $iRes < $numResults; $iRes++)
        {
            $oRes = $oLayer->getResult($iRes);
            if($oRes != FALSE)
            {
                $oShape = $oLayer->getShape(-1,$oRes->shapeindex);

                for($iField=0; $iField < sizeof($selFields); $iField++)
                {
                   print($oShape->values[$selFields[$iField]]);
                }
                $oShape->free();
                $numResultsTotal++;
            }
        }
        $oLayer->close();
    }
    if ($numResultsTotal == 0)
     print("Nothing found at query location.");
}

hope this helps

Anuradha Barua wrote:

>Hi,
>I have looked at the TOLERANCE attribute for layer. I seem to be a bit
>confused here. Can I display also the attributes (like name of place)
>from the database for all points that are displayed ? At present, as I
>said earlier, my application (in Mapserver 4.0.1, PHP 4.3.4, mapscript
>4.1 in windows)connects to a database (i am using ms-access)and checks
>for the x,y coordinate and if it matches, the polygon (and point) are
>highlited. Also some info about the point is shown in a table below.
>I would want to highlight adjoining points corresponding to the point
>the user clicked and areas too and display the related info from the
>access database.
>I would really appreciate help.
> Thanks and Regards
>
>
>
>



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005



More information about the MapServer-users mailing list