= !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 [wiki:MapGuideRfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date||Jul 28 2020|| ||Last Modified||4 Aug 2020|| ||Author||Jackie Ng|| ||RFC Status||adopted|| ||Implementation Status||implemented|| ||Proposed Milestone||4.0|| ||Assigned PSC guide(s)||(when determined)|| ||'''Voting History'''||(vote date)|| ||+1||Jackie,Reno,Gordon,Martin|| ||+0|||| ||-0|||| ||-1|||| ||no vote|| || == Overview == 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. == Motivation == 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 [https://qgis.org/en/site/ QGIS] or [http://www.thecarbonproject.com/Products/Gaia 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 [https://github.com/yhirose/cpp-httplib 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 [https://trac.osgeo.org/mapguide/browser/sandbox/jng/ogc_viewer_representation ogc_viewer_representation sandbox]. Upon adoption of this RFC, it will be merged into trunk. == Implications == 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 == Community