PHP queryByAttributes

Eduin Carrillo yecarrillo at YAHOO.COM
Tue Nov 2 10:42:56 EST 2004


If "Layername" contains at lest one class with "TEMPLATE" param, you will get
items highlighed automatically. Problem is that query is done just in the
actual extent. What I do is change temporarily the extent:

    //Store here original extent here
    $mapMinX0 = ****;
    $mapMinY0 = ****;
    $mapMaxX0 = ****;
    $mapMaxY0 = ****;

    //Keep actual extent
    $mapMinXTmp = floatval($oMap->extent->minx);
    $mapMinYTmp = floatval($oMap->extent->miny);
    $mapMaxXTmp = floatval($oMap->extent->maxx);
    $mapMaxYTmp = floatval($oMap->extent->maxy);

    $oMap->setextent($mapMinX0, $mapMinY0, $mapMaxX0, $mapMaxY0);
    $oParcelLayer =
$oMap->getLayerByName(stripslashes($_REQUEST['Layername']));

    //Do query
    $qresult =
@$oParcelLayer->queryByAttributes(stripslashes($_REQUEST['Columnname']),

stripslashes($_REQUEST['szQuerystring']),
                                           MS_MULTIPLE);

    //Restore previous extent
    $oMap->setextent($mapMinXTmp, $mapMinYTmp, $mapMaxXTmp, $mapMaxYTmp);


Eduin

 --- Hans Palmborg <hans.palmborg at ORESUNDSKRAFT.SE> escribió:
> Hello!
>
> How to zoom in and color the match/matches of the question with
> queryByAttributes?
>
> //CODE IN PHP
> if ( $http_form_vars["Querystring"] )
>  {
>  $szQuerystring = $http_form_vars["Querystring"];
>  $oParcelLayer = $oMapSession->oMap->getLayerByName("Layername");
>  $oParcelLayer->queryByAttributes("Columnname", "$szQuerystring",
>         MS_MULTIPLE );
>  }
>
> Please help!!
>
> Installed versions:
> WIN XP sp2
> IIS 5.1
> PHP4.3.9.9
> PHP_MAPSCRIPT_42
> MAPSERVER4.2.0
>
> //Hans Palmborg in Sweden!
>



=====
Eduin Yesid Carrillo Vega
yecarrillo at yahoo.com
COLOMBIA

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com



More information about the mapserver-users mailing list