[Chameleon-dev] [Bug 1118] New: query_utils.php: add option
$bVisibilityCheck to executeQuery function
bugzilla-daemon at bugzilla.maptools.org
bugzilla-daemon at bugzilla.maptools.org
Mon Jul 18 09:53:03 EDT 2005
http://bugzilla.maptools.org/show_bug.cgi?id=1118
Summary: query_utils.php: add option $bVisibilityCheck to
executeQuery function
Product: Chameleon
Version: 2.2
Platform: PC
OS/Version: Windows 2000
Status: NEW
Severity: enhancement
Priority: P2
Component: Core
AssignedTo: chameleon-dev at lists.maptools.org
ReportedBy: bartvde at xs4all.nl
I would like to make the following change to the executeQuery function in
query_utils.php.
Add an optional parameter $bVisibilityCheck which determines wether or not the
check on the visibility of layers should be executed when doing a query.
For our situation, we want to display query results even if the layer is not
visible in the map.
I propose to make it an optional parameter, with a default value of true so
nothing happens for the existing Chameleon code, ie:
function executeQuery( $oMapSession, $nMinX, $nMinY, $nMaxX = -1, $nMaxY = -1,
$bVisibilityCheck = true)
{
//this could take a while for WMS results
set_time_limit( 120 );
// create a new map query object
$oMapQuery = new MapQuery( $oMapSession );
// initalize vars
$aszWMSResults = array();
// loop through all layers and add to list of layers to query
// NOTE: Layers will only have results generated for them if they
// have a "template" value set. The template value does not have
// to be valid, it could be as simple as "ttt".
$aszLayers = array();
$aszTitles = array();
$oMap = $oMapSession->oMap;
$nCount = $oMap->numlayers;
for ( $i=0; $i<$nCount; $i++ )
{
// get layer name
$oLayer = $oMap->getLayer( $i );
$bQueryable = false;
if ($bVisibilityCheck)
{
if ($oLayer->status == MS_ON || $oLayer->status == MS_DEFAULT)
{
if ($oLayer->template != "")
{
$bQueryable = true;
}
else
{
for( $j=0; $j < $oLayer->numclasses; $j++)
{
$oClass = $oLayer->getClass($j);
if ($oClass->template != "")
{
$bQueryable = true;
break;
}
}
}
}
}
else
{
if ($oLayer->template != "")
{
$bQueryable = true;
}
else
{
for( $j=0; $j < $oLayer->numclasses; $j++)
{
$oClass = $oLayer->getClass($j);
if ($oClass->template != "")
{
$bQueryable = true;
break;
}
}
}
}
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Please do NOT reply to this email, use the link above instead to
login to bugzilla and submit your comment. Any email reply to this
address will be lost.
More information about the Chameleon-dev
mailing list