GovHack

Resources for developers and hackers at GovHack

Hi

These are a set of code samples we’ve prepared for developers and hackers participating in GovHack to quickly get up to speed with using WA Government’s Shared Location Information Platform (SLIP).

If you’ve stumbled on this page you might want to check out data.wa.gov.au’s more general guidance for everyone, not just developers at data.wa.gov.au/govhack.

Need help?

Get in touch with a member of our friendly team of mentors. We love nerding out about everything geospatial :)

Code Samples

We realise that getting started with SLIP and the ArcGIS Server platform may not be the easiest task - particularly if you aren’t a spatial nerd - so we’ve put together some code samples and demo apps to help developers get off to a flying start.

The initial set of code samples primarily concern themselves with visualising data (WMS and ESRI MapServer) or extracting the underlying raw feature data (WFS and ESRI FeatureServer). We plan to expand the range of samples over time to include more than just web maps (e.g. Python scripts, mobile apps), and more complex sample applications demonstrating some of the more advanced features of ArcGIS Server.

The data used here are all publicly available from data.wa.gov.au.

If you spot any bugs in these samples, or have an idea of a code sample you’d like to see, do please file an issue in GitHub. If you have any trouble with these code samples, or there’s something you’d like to do but aren’t show of how, please contact us.

ESRI’s Documentation

Our SLIP platform is based on ESRI’s ArcGIS Server technology, and these days ESRI is all about “Developers, Developers, Developers”, so do check out their ArcGIS for Developers site.

ArcGIS for Developers header banner screenshot

Or just jump right in to their GitHub repos.

ESRI GitHub repos header banner screenshot

ArcGIS JavaScript API 4.0 Code Samples

ArcGIS JavaScript API 4.0 Documentation

MapImageLayer

Let’s start simple by grabbing some shipwrecks data and displaying them as pre-rendered image tiles on a 3D globe using a MapImageLayer layer.

View live example Get the code

FeatureLayer

This time let’s use the raw data to render our shipwrecks client-side using a FeatureLayer layer. (We haven’t demonstrated it here - but client-side rendering means you’re in control of the styling and presentation of the data. Custom symbology ahoy!)

View live example Get the code

FeatureLayer Querying

OK, let’s step it up a notch and build on the previous example by dynamically querying our shipwrecks to populate a list of wrecks, and throw in a popup info window for good measure.

queryFeatures()

View live example Get the code

Custom Client-side Rendering

Now we’re just going to show off a little - let’s grab the ABS’s 2011 Census data on dwellings per suburb, roughly bin suburbs in Western Australia by the number of dwellings they have, and apply a custom client-side renderer over the top with some funky colours.

View live example Get the code

OpenLayers Code Samples

OpenLayers

Web Map Service & feature querying

A simple one to start with here - we’ll display townsites in Western Australia’s as image tiles on a map, and throw in an interactive “What features are at this location” query ability.

View live example Get the code

Web Feature Service [WORK IN PROGRESS]

This time we’ll use a WFS service to pull down some raw data and render it client-side.

View live example Get the code

Leaflet Code Samples [WORK IN PROGRESS]

Leaflet

Web Feature Service [WORK IN PROGRESS]

This time we’ll use a WFS service to pull down some raw data and render it client-side.

View live example Get the code