[fusion-users] Fusion in Autodesk Mapguide 2010

Benoit Begin bbegin at geomapgis.ca
Mon Mar 30 13:52:34 EDT 2009


So the Mapguide 2010 version is now available to download to subscription users. I've noticed two major issues in the PHP backend that makes very large maps (350+ layers) simply not load in Fusion.

In Utilities.php, the function ResourceExists at line 320 is not very good. It does a GetResourceContent, when there is a ResourceExists API on the MgResourceService that is available. This probably slows things down considerably if it's used in many places, not to mention filling up memory with the content. I'm not really well-versed in PHP and its memory management scheme, but doing that without calling a Dispose on the $cnt in .NET would cause some memory degradation until the garbage collector runs. So the function should look more like so:

function ResourceExists($resourceSrvc, $dataSourceId)
{
    try
    {
        return $resourceSrvc->ResourceExists($dataSourceId);
    }
    catch(MgException $mgEx)
    {
        return false;
    }
}

The next function is ByteReaderToString. I'm not even sure why this one exists, as a MgByteReader already has a ToString() API function. It seems to me that the only use of this function would be to display an MgByteReader that contains binary data as a string, but what use would it have? As it stands, if this function remains the way it is now, a very large map like the ones we have here, will make the LoadMap.php call simply not work. The function should likely be something along those lines:

function ByteReaderToString($byteReader)
{
    return $byteReader->ToString();
}

To be very thorough, it would be a good idea to call GetMimeType() on the Reader to make sure it is text/plain or text/xml.

With these two fixes, my maps can run through the LoadMap.php call and they load. I'm not too sure where this should go, so I apologize in advance if this is not the right forum to discuss those issues.
-- 
View this message in context: http://n2.nabble.com/Fusion-in-Autodesk-Mapguide-2010-tp2558700p2558700.html
Sent from the Fusion Users mailing list archive at Nabble.com.



More information about the fusion-users mailing list