[mapguide-users] Intermittent MapGuide issue
David Bowen
dbowenrci at gmail.com
Wed May 17 11:17:10 PDT 2023
Our application has functionality where a user can search for an address
and then click on a button to return data, when available, from a selection
of layers. We're encountering an issue where there is data present, however
when the user clicks the button, MapGuide returns an error saying no valid
objects are selected. If the user clicks the button a second time, results
are returned. This seems like a MapGuide error and I've been attempting to
troubleshoot it without success.
This issue is intermittent and only seems to exist in our Development
environment, however I can recreate it if I export the Development package
from Maestro and import it into another environment.
The relevant section of code that seems to be failing is:
$myMap = $this->MapGuideObject->getMap();
$session = $this->mgSessionId;
$mapName = $this->mgMapID;
$objkeys = '';
$errorMsg = null;
$siteConnection = $this->MapGuideObject->getSiteConnection();
// Get an instance of the Resource and Mapping Services and use them to open
// the map and initialize a selection object.
$resourceSrvc = $this->MapGuideObject->getResourceService();
$featureSrvc = $this->MapGuideObject->getFeatureService();
//Get selected map layers.
$sel = new MgSelection( $myMap );
$sel->Open( $resourceSrvc, $mapName );
$this->originalSel = $sel->ToXml();
$selLayers = $sel->GetLayers();
//Check to see if no objects are selected.
It appears that the line $this->originalSel = $sel->ToXml(); is the issue
as there are times where it returns data but other times it's an empty
string. Has anyone encountered an issue like this, or would anyone have an
idea of how to resolve it?
Alternatively, what would be the best way to try to catch a potential
MapGuide error that is being generated? I believe that we have all error
logging turned on but nothing has appeared in the log files.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20230517/8794d526/attachment.htm>
More information about the mapguide-users
mailing list