<div dir="ltr">I would be curious about the line:<div><br></div><div>$this->MapGuideObject->getMap();</div><div><br></div><div>Share this definition?</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, May 25, 2026 at 1:35 PM David Bowen via mapguide-users <<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>We're updating our application from using an MVC framework to being a PHP only application. We're getting an unexpected error when running a spatial query that looks for corresponding data, from a specified layer, that falls within a set distance of the geocoded coordinates. This function worked as expected in the MVC framework and the only code change, for this section of code, is how the MG_initialize library is loaded.</div><div><br></div>Going through the function step-by-step, it appears that it's failing when it attempts to retrieve the layers from MapGuide. Instead of returning something, it's returning NULL. This triggers a Fusion error, where 1 of 2 different error messages are displayed.<br><br>The first error message is:<br>Failed to retrieve message for "MgFileNotFoundException". Failed to retrieve message for "MgFileIoErrNo". - MgInitializeWebTier line 155 file C:\Workspace\mg-4.0\MgDev\Web\src\WebSupport\InitializeWebTier.cpp - MgInitializeWebTierInternal line 116 file C:\Workspace\mg-4.0\MgDev\Web\src\WebSupport\InitializeWebTier.cpp - MgResources.LoadResources line 388 file C:\Workspace\mg-4.0\MgDev\Common\Foundation\System\Resources.cpp - MgResources.ParseFile line 632 file C:\Workspace\mg-4.0\MgDev\Common\Foundation\System\Resources.cpp - ByteSourceFileImpl.LoadFile line 127 file C:\Workspace\mg-4.0\MgDev\Common\Foundation\System\ByteSourceFileImpl.cpp<br><br>The second error message is:<br>Fatal error: Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, string given in PATH\map\view\page.php:116 Stack trace: #0 PATH\map\view\page.php(116): extract() #1 PATH\maptools\sel_action.php(154): require_once('...') #2 PATH\maptools\sel_action.php(56): Sel_Action->selectionReport_ql() #3 PATH\maptools\sel_action.php(290): Sel_Action->__construct() #4 {main} thrown in PATH\map\view\page.php on line 116<br><br>The script is:<br> function __construct( $config ) {<br> $mapName = $config[ 'mapname' ];<br> $mgSessionID = $config[ 'mapsession' ];<br> $this->mgMapID = $mapName;<br> $this->mgSessionId = $mgSessionID;<br> //Initialize a MapGuide object instance<br> require_once('../library/mapguide/Mg_initialize.php');<br> $this->MapGuideObject = new Mg_initialize();<br> $this->MapGuideObject->init( $this->mgMapID, $this->mgSessionId );<br> }<br> <br> function getSelection() { <br> $myMap = $this->MapGuideObject->getMap();<br> $session = $this->mgSessionId;<br> $mapName = $this->mgMapID;<br> $objkeys = '';<br> $errorMsg = null;<br> $siteConnection = $this->MapGuideObject->getSiteConnection();<br> // Get an instance of the Resource and Mapping Services and use them to open the map and initialize a selection object.<br> $resourceSrvc = $this->MapGuideObject->getResourceService();<br> $featureSrvc = $this->MapGuideObject->getFeatureService();<br> //Get selected map layers.<br> $sel = new MgSelection( $myMap );<br> $sel->Open( $resourceSrvc, $mapName );<br> $this->originalSel = $sel->ToXml();<br> // this is where it appears to fail<br> $selLayers = $sel->GetLayers();<br> <br> //script continues but likely not relevant <br> }<br> <br>Any input would be greatly appreciated.</div>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</blockquote></div>