[fusion-users] Fusion in Autodesk Mapguide 2010

Paul Spencer pspencer at dmsolutions.ca
Tue Mar 31 08:50:13 EDT 2009


Thanks Benoit,

the pertinent code has been there for a while and not touched.   
ResourceExists and ToString did not exist in earlier versions of the  
API and so we had to invent code to do the job.  Now that more elegant  
solutions exist, you are probably right that we should take advantage  
of them.

I would ask that you file this as a ticket in the fusion trac system (http://trac.osgeo.org/fusion 
) with your proposed change and someone will patch Fusion 2.0 before  
it goes out the door.

Cheers

Paul

On 30-Mar-09, at 1:52 PM, Benoit Begin wrote:

>
> 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.
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://research.dmsolutions.ca/



More information about the fusion-users mailing list