So my previous article about fusing QGIS Desktop with web technologies generated quite a bit of interest, including some people interested to start hacking on it (always a good sign). In this article I want to show the next level of functionality we can obtain by means of a simple example. There won’t be any flashy graphics here but hopefully it will give you inspiration for other things we can do.
Here is the executive summary and a quick video to demonstrate it:
- I replaced Metadata tab in the QGIS Raster Layer Properties with a QWebView widget
- I created a simple web page that accepts a C++ QgsRasterLayer object and then does stuff with it
- I implemented a Q_PROPERTY on QgsMapLayer (the base class for all map layers) that exposed the metadata property as a read-only property.
- I created a customised BluePrint CSS template (using a narrower format than the traditional 960 grid) and deployed it in QGIS resources
You can browse the changes I pushed to my fork of QGIS today so see how I implemented all of this. It was a few minutes work (if you disregard the formatting tweaking I did to the metadata to make it more blueprint friendly). If anyone would like to start pitching in, it would be really nice to have some designers start tweaking the content we deliver in these QWebViews to make them look gob-smackingly beautiful! Next on my todo list is to make the providers return their metadata as json and then we can properly separate the content from the mark up (and use the metadata in other interesting contexts too).