MapGuide RFC 181 - OpenLayers preview for WMS layers and development HTTP server

This page contains a 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 DateJul 28 2020
Last Modified4 Aug 2020
AuthorJackie Ng
RFC Statusadopted
Implementation Statusimplemented
Proposed Milestone4.0
Assigned PSC guide(s)(when determined)
Voting History(vote date)
no vote


This RFC proposes to add a new OpenLayers HTML viewer representation for WMS responses and a new developmental HTTP server to simplify dev/testing of the MapGuide Web Tier.


Currently, there is no built-in previewing mechanism for WMS layers in MapGuide. Right now, to preview a WMS layer from MapGuide requires an external WMS client like QGIS or Gaia to connect to the MapGuide WMS Service.

Another tangential problem is that the development/testing of mapagent C++ code in the MapGuide Web Tier is severely hampered by the need to stand up a full-blown instance of Apache httpd or IIS in front of the mapagent binaries. Having a simple http server that integrates the mapagent handling code can rapidly improve development and iteration of mapagent functionality.

Proposed Solution

Add cpp-httplib to Oem. This is a MIT-licensed header-only C++11 library for easily implementing a HTTP web server.

Add a new MgDevHttpServer project to the WebTier solution. This project is a simple console application using cpp-httplib that sets up a mapagent for testing/development purposes. This http server should not be used as a production or public-facing http server.

Update our WMS templates to include a HTML template for WMS GetMap previews with OpenLayers.

Update our WMS implementation to support a new FORMAT of application/openlayers. If this parameter value is supplied, an OpenLayers HTML preview of the given WMS layer is rendered instead of a map image.

Add a new MgWebTestRunner project to the WebTier solution. This is a skeleton catch2-based test runner that we can expand in the future with more test cases relating to the Web Tier.

This is already implemented and ready-to-merge in the ogc_viewer_representation sandbox. Upon adoption of this RFC, it will be merged into trunk.


None. This is a new output format for an existing operation.

Test Plan

Verify GetMap requests produce an OpenLayers preview of the WMS layers if a FORMAT of application/openlayers is provided

Funding / Resources


Last modified 3 years ago Last modified on Aug 4, 2020, 5:04:11 AM
Note: See TracWiki for help on using the wiki.