2.6 introduces new operations in the mapagent to allow for creating new MgMap instances and describing key information about the MgMap such as their layer/group structure, map name, coordinate system, etc without the need to write any .net/Java/PHP web extensions glue code to do this:
- CREATERUNTIMEMAP - To create a new MgMap instance and return information about this instance
- DESCRIBERUNTIMEMAP - Returns information about a MgMap instance, given a map name and session ID.
Both operations return the same XML/JSON structure, except they take different input parameters:
- CREATERUNTIMEMAP requires a Map Definition ID and a session ID or MapGuide user credentials
- DESCRIBERUNTIMEMAP requires a Map Name and a session ID
The motivation for implementing this feature was looking at the MapGuide example for OpenLayers. It was clear that to consume MapGuide from OpenLayers, key information that we needed to make a OpenLayers.Layer.MapGuide instance was missing from the mapagent, and to fill in this information you needed to write a glue layer in .net/Java/PHP that can tap into the MapGuide API to return this missing information.
Fusion which uses OpenLayers can get away with this because it calls into PHP code to bootstrap the application with the required information. However, if you were making a pure OpenLayers application, this was not possible. CREATERUNTIMEMAP/DESCRIBERUNTIMEMAP addresses this shortcoming.
Both operations also support JSON output, albeit with the same quirk that affects other JSON responses in the mapagent where all JSON properties a generally arrays (because the XML to JSON conversion code has no current way to infer cardinality of elements to be converted)
This new feature not only allows for new client application possibilities, Fusion has also been modified to take advantage of these new operations. Using CREATERUNTIMEMAP bypasses the request chain of LoadMap.php and LoadScaleRanges.php which returns the same information. Similarly, DESCRIBERUNTIMEMAP is used when a layer/group structure needs to be refreshed. Not only are less requests required as a result. the actual response payload and round-trip time is smaller and faster as well.
Here's a sample load time of the Sheboygan dataset in Fusion using the current LoadMap.php/LoadScaleRanges.php approach
Here's the same dataset loaded by Fusion using CREATERUNTIMEMAP
As you can see, not only does CREATERUNTIMEMAP gives smaller responses. The time/latency is also smaller as well. You'll be glad to know that as the map you're loading gets bigger, so do the size/time/latency savings. And the rub of all this? This is the first cut implementation. There are still unexplored caching opportunities on the server side that could make these response times even faster!
So even if you're not building your own custom map viewer, if you're using Fusion you should still see the benefits introduced with these new operations.
If you want to find out more about these new operations, check out the MapGuide RFCs:
2 comments:
Very nice,
I just had a second look to my own post on using selections in openlayers with mapguide. Server plumbing here is significantly reduced, but I will still be using php functions from the basic viewer to get the selected objects. I wrote: wishlist: this function should be present in the mapagent , so lets repeat this again, it would be nice to have the functionality of getselectedfeatures.php in the mapagent.
You probably want to stay tuned to my next post then :)
Post a Comment