TerriaJS v6.0.2 — Printing, Magda Interoperability, and TerriaJsonCatalogFunction
Whoa, we’ve been slackers! At least in the blog writing department. Fortunately, we haven’t been slacking off when it comes to improving TerriaJS itself. Since the last version we announced on this blog (v5.6.2), we have released 6 (!) new versions of TerriaJS. You can try out the latest version at https://map.terria.io.
Here’s what’s new as of v6.0.2:
Printing Improvements
Previously, TerriaJS had, well… we’re all friends here, right? Good, then I’ll just say it. TerriaJS had terrible support for printing. Printed maps were cut off in many cases, and the formatting was totally weird. But now, in this release, we have a brand-new printing approach that delivers great results.
The new print feature is found on the Share panel. Click the Show Print View button to open a new tab with a printable view containing the map image, legends, dataset details, and map credits.
Or, click the Print button to print this view directly using your web browser’s print feature.
This also works if you’re embedding a TerriaJS application in an iframe and calling iframe.contentWindow.print() on it. Your users will automatically get the fancy new print view. Unfortunately, web browser limitations don’t give us a way to provide the new print view when the users invoke the print feature directly in their browser’s UI. In that situation, a message at the top gently suggests that users use the new TerriaJS print feature instead.
Magda Interoperability
TerriaJS now has support for directly loading catalog items from Magda, in much the same way it can load them from CKAN. Haven’t heard of Magda? Today is your lucky day! Magda is our new open-source platform for data portals. Check out our GitHub page or try a live instance at search.data.gov.au.
TerriaJsonCatalogFunction
Thanks to first-time contributor Jason-DNetto for this sweet new feature!
TerriaJS has long had support for OGC Web Processing Services (WPS). The idea is you can configure a WPS catalog item in TerriaJS, and TerriaJS will query the server for the input parameters required by the service. It will then automatically create a user interface allowing the user to specify each of those parameters and invoke the service. The result of the service, which may be map layer, chart, or something else, is then shown on the workbench. These “functions” can be added to the catalog or they can be invoked via buttons in the user interface.
In this release, we’ve added a similar mechanism for non-WPS services, called TerriaJsonCatalogFunction. In this case, it allows us to perform a GET to an arbitrary HTTP service with parameters from an automatically-generated user interface. The service is expected to return a chunk of TerriaJS catalog JSON, which can add items to the catalog, workbench, map, and charts.
We add a catalog entry like this:
And when we load it (by including it in our application’s main catalog file, dragging/dropping the JSON file onto the map, or by specifying it to be loaded in the application URL), we’ll get a user interface like this:
And when we click “Run Analysis”, TerriaJS will perform an HTTP GET to this URL, built from the base URL specified in our catalog configuration:
And show the returned map content in the application:
This is a great way to integrate your back-end services into a TerriaJS application without writing any custom front-end code.
And More
- The splitter thumb position can now be dragged vertically, allowing you to move it out of the way of whatever you’re trying to look at.
- Longitude and Latitude are now shown to 5 decimal places instead of 3.
- The workbench date/time picker is now available for time-varying point and region CSV files.
- Upgraded to React 16.
- Lots of bug fixes!
Check out of the complete changelog and, as always, find us on Gitter, Twitter, or Google Groups if you have any questions or comments.