MapGuide RFC 73 - Batch processing of layers

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.


RFC Template Version(1.0)
Submission Date(July 7, 2009)
Last Modified(Christine Bao Tue July 7 02:22:17 2009)
AuthorChristine Bao
RFC Statusadopted
Implementation Statuscompleted
Proposed Milestone2.2
Assigned PSC guide(s)Tom Fukushima
Voting History
+1Tom, Kenneth, Paul, Trevor, Bruce
no voteJason, Harris, Bob, Andy


This RFC improves performance by getting batch layers in one request, instead of each layer in one request.


Currently MgMap is created on Web Extension side, and for each layer of this map it sends a request to get the resource content. This causes a lot of requests send to server again and again. To improve performance MgMap should get the layers in a single request, and use the batch processing result to create layer models. The more layers a map has, the better performance improvement is achieved.

Proposed Solution

The possible solutions could be:

  1. Add a new API of ResourceService to get a batch of resource contents for a collection of resource identifiers
    /// \brief
    /// Gets the contents of the specified resources.
    /// \param resources
    /// Resource identifiers describing the resources.
    /// \param preProcessTags
    /// Pre-processing to apply to resource before returning content.  An empty
    /// string indicate no pre-processing. See MgResourcePreProcessingType for
    /// a list of supported pre-processing tags.
    /// \return
    /// MgStringCollection object representing the corresponding resource contents.
    /// \exception MgInvalidRepositoryTypeException
    /// \exception MgInvalidRepositoryNameException
    /// \exception MgInvalidResourcePathException
    /// \exception MgInvalidResourceNameException
    /// \exception MgInvalidResourceTypeException
    virtual MgStringCollection* GetResourceContents(MgStringCollection* resources,
        MgStringCollection* preProcessTags) = 0;

  1. MgMap doesn't request the resource content of layers one by one, instead it forms a collection of layer resource ids, and use the new API to get a collection of layer definitions.


This is new API only. There are no effects on existing applications. However, API documentation need to be updated.

Test Plan

Test both Ajax viewer and Fusion viewer.


Supplied by Autodesk.


Another APIs are added into MgLayerBase.

    /// \brief
    /// Gets the layer's resource content.
    virtual STRING GetLayerResourceContent();

    /// \brief
    /// Sets the resource content for this layer.
    virtual void SetLayerResourceContent(CREFSTRING resourceContent);
Last modified 14 years ago Last modified on Feb 4, 2010, 11:37:41 PM
Note: See TracWiki for help on using the wiki.