Widget - using WFS endpoint on data.gov.au

Available for  Pozi Pro and Pozi Enterprise subscribers.

Introduction

This article describes using a Pozi Widget when the data behind the Widget is stored on data.gov.au, and there is a WFS endpoint available.  For details using a Pozi Widget when the data is not stored on data.gov.au (or there is no WFS endpoint available) please refer to the article " Widget - using data with no WFS endpoint".

The Pozi Widget is a html component that can be embedded into your organisation's website via an  iframe element, to add geospatial data search capability.

When the widget starts you can enter a physical address and when the address is selected the system retrieves the configured geospatial dataset.

For example, by typing in a home address, it could retrieve your next rubbish collection date.

Quick start example

Scenario 1: Display data under search box

This example will return the next rubbish pickup date for any address in Cardinia Shire.

https://widget.pozi.com/widget.html#site=cardinia&ckan=ckan_060534f1_7866_41ce_a367_4075d3b5f67a&transformer=garbage&fieldnames=Rubbish%20Next%20Pickup

Tip: Open URL and try "3 Albert St"

Scenario 2: Open map in new tab at address

This example will open a new tab with the Pozi map at the new address.

https://widget.pozi.com/widget.html#site=cardinia&newtab=true

Tip: Open URL and try "3 Albert St"

(Important note: The default setting in Internet Explorer and Firefox is to restrict popups. This may result is the user being presented with a browser dialog asking them to first enable browser popups. To avoid this issue the URL can be edited to remove the "&newtab=true" text.  However, this will result in the results of the address search appearing in the same tab. See further discussion regarding using newtab=true in the Optional Parameters section below)

URL Parameters

Required Parameters

Base URL

https://widget.pozi.com/widget.html#

Note: Requires # on the end

Site

This is the Pozi registered site name that is configured on a site by site basis.

This is a required field.

site=registeredSiteName

For example:

site=northerngrampians

CKAN Data identifier

A ckan id is a data.gov.au data identifier.

The ckan is required and must return geojson when queried.

These ids can be found at data.gov.au.  Please refer to document Obtaining CKAN Data Identifier.

Optional Parameters

Transformer

Pozi has some optional built in data transformers that can be used to clean up the data or perform calculations.

One of the transformers is called  garbage. The garbage transformer takes the raw data returned from data.gov.au in the standard openbins format and then calculates and returns next pickup dates.

transformer=...

For example:

transformer=garbage

Fieldnames

This parameter defines the fields in the returned data that are rendered.

fieldnames=field1,field2,...

For example:

fieldnames=Rubbish%20Next%20Pickup

Note, any spaces in field names need to be encoded as  %20.

Fieldnameshide

This parameter hides the fieldnames and only displays the field data.

fieldnameshide=true|false

For example:

fieldnameshide=true

Redirect

If this parameter is added, the current page will be redirected to the Pozi map zoomed to the address.

redirect=true

Newtab

If this parameter is added, the Pozi map will be loaded in a new tab zoomed to the address. Note this option can have issues with browser security such as the built in popup blockers, in particular in IE and Firefox. Whilst the user can change the settings in their browser to allow popups, depending on the expected customer, it may be more appropriate to avoid using the Newtab parameter and live with the downside of having the Pozi map load in the same tab as the address search was performed.

newtab=true

https://widget.pozi.com/widget.html#site=northerngrampians&newtab=true

Fontsize

By default the font size of the widget text is set to 18. However, you can specify a different font size by using the optional font size parameter, for example:

fontsize=10

https://widget.pozi.com/widget.html#site=northerngrampians&fontsize=10

Projection

The projection will normally be presumed to be WGS84 (EPSG=4326). It is possible to specify a different projection by explicitly declaring it in the URL (truncated here for clarity):

https://widget.pozi.com/widget.html#site=......Next%20Pickup/projection[EPSG%3A28355]/

Note that this sort of parameter is referred to as a Hash Parameter, and is added to the URL using a forward slash (/) rather than the usual ampersand (&).

The most common projections (other than WGS84) can be reviewed here:

http://spatialreference.org/ref/epsg/3111/
http://spatialreference.org/ref/epsg/28354/
http://spatialreference.org/ref/epsg/28355/

Using iframes

<iframe width="100%" src="https://widget.pozi.com/widget.html#site=cardinia&ckan=ckan_060534f1_7866_41ce_a367_4075d3b5f67a&transformer=garbage&fieldnames=Rubbish%20Next%20Pickup"></iframe>
<iframe width="100%" src="https://widget.pozi.com/widget.html#site=cardinia&redirect=true"></iframe>

See other  iframe parameters:

https://www.w3schools.com/tags/tag_iframe.asp

Managing Scrollbars

When using a small iframe, you may encounter scrollbars. You can control the appearance of scrollbars using the CSS   overflow setting.

<style>     iframe {         overflow:hidden;     } </style> (...) <iframe scrolling="no" src="http://www.google.com" width="400px" height="300"></iframe>

For more information about overflow, see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow