[Chameleon] oMapSession and MapQuery object

Eric Bridger eric at gomoos.org
Wed Aug 11 11:35:16 EDT 2004


I am writing a custom widget, based on the 1.99 Query widget, which
displays results in a popup window. My intent is to exectue a point
query on a layer, but not use a popup window. I just want the query
results.

I've got my new widget working. It extends the NavTool widget and I'm
trying to move the code from Query/QueryResults.phtml (this is the
source for the Query popup window into my custom widget.

But I seem to be having trouble with $oMapSession, used to create a
MapQuery object:
$oMapQuery = new MapQuery($oMapSession);

In my widget I have:
define("LOAD_MAPSESSION", 1);
include_once(CHAMELEON_PATH."/widgets/session.inc.php");
include_once( CHAMELEON_PATH."/common/wrapper/map_query.php" );


The MapQuery->executePointQuery() is returning no results.  I suspect
the $oMapSession because the $oMapSession->$oMap->nLayers is not set.

In my widget I can successfully use:
$oMap =& $this->moMapObject->oMap;

So perhaps my problem is how to access $oMapSession in a NavTool widget?

Very similiar code in the QueryResults.phtml works fine.

Eric







More information about the Chameleon mailing list