[Chameleon] oMapSession and MapQuery object
Ken Sanderson
ken at rockies.ca
Wed Aug 11 12:24:50 EDT 2004
Will posted the following yesterday in regards to one of my questions:
***********
When you extend the NavTool widget you need to reference the Map object
this way:
$this->moMapNavigator->oSession->oMap
So your array of layer names would be like this:
$aszLayerNames =
$this->moMapNavigator->oSession->oMap->getAllLayerNames();
***********
Hope that helps,
Ken
-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Eric Bridger
Sent: August 11, 2004 9:35 AM
To: chameleon at lists.maptools.org
Subject: [Chameleon] oMapSession and MapQuery object
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
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list