[Chameleon] CHAMELEON Query - parameters - map_query.php
wbronsema at dmsolutions.ca
Tue Dec 14 10:12:53 EST 2004
If I understand you correctly (based on the additional info you sent to
me) you want to be able to query your map and filter the results
according to an expression, correct?
This can get very complex depending on how flexible you need the
expressions to be. However, the ExpressionBuilder widget is set up to
do exactly what you want and more. If you use it in conjunction with
the ROI widgets (circle, square, & polygon) you should be able to query
the way you would like and set any kind of expression.
Unfortunately is fairly complicated to get the results of the
expressionbuilder into tabular form (the visual hi-lighting on the map
is the main purpose of the expressionbuilder and is done by default).
To do this you will need to add a "expressionbuilderresults" shared
resource to your template and pass the results of it to the table widget.
It has been a long time since I have used the tabular form of the
results so maybe there is someone on the list who can talk you through
the exact steps involved?
The advantage in using the expressionbuilder widget as opposed to
customizing chameleon code is that you can still get the latest versions
and upgrades to chameleon without worrying about re-applying your
changes. Make sense?
Hope this helps.
Rodriguez Sandra wrote:
> Hi friends,
> Please, I need help!
> I have developed my application over the software: W2000 (Internet
> Information Server), chameleon 1.99b2, php4.3.7, phpmapscript 4.2,
> mapserver 4.
> My application needs to show the attributes of the layer and that
> it displays the map and resulting data of the consultation like:
> attribute > value .
> I personalized the file map_query.php (line 480), so that it
> spreads to the data additionally a map with a consultation
> defaulted (RANKGES = 3) . But, I need that the parameters of my
> consultation are correspondents from my main page where this file
> map_query.php to obtain the results as it is shown in the figure 1.
> Thanks, very much
> Part of the file map_query.php
> $campo = "RANKGES";
> $consulta = "('[RANKGES]' = '3')";
> $nNumResults = intval($oLayer->getNumResults());
> for ($i=0; $i < $nNumResults; $i++)
> // get next shape row
> $oResult = $oLayer->getResult($i);
> $oShape = $oLayer->getShape($oResult->tileindex,
> // push the row array onto the results array
> //$aTmp = $oShape->values;
> $aTmp = array("CONSEJO PROVINCIAL" =>
> "MUNICIPIO" => $oShape->values["CAN_DES"],
> "COD_ENTI" =>
> "RANK. GESTION" =>
> "RANK. AUTOSUF." =>
> "RANK. ENDEUD." =>
> "CALIF. RIESGO" => $oShape->values["CALIFICA"]);
> array_push( $axResults, $aTmp );
> // end for loop
> } $q_img = $oMap->drawquery();
> $q_path =$q_img->savewebimage();
> echo "Consulta:
> "."<br> ".$consulta."<br>";
> echo "<img src=".$q_path.">";
> } else
> Chameleon mailing list
> Chameleon at lists.maptools.org
William A. Bronsema, C.E.T.
Software & Applications Development,
DM Solutions Group Inc.
e-mail: wbronsema at dmsolutions.ca
Web : http://www.dmsolutions.ca
Phone : (613) 565-5056 ext.25
Fax : (613) 565-0925
More information about the Chameleon