Page tree

The ANDS Location Capture Widget allows you to instantly enrich your data capture system, adding geospatial capabilities such as custom drawings and place name resolution (using the Australian Gazetteer Service and Google Maps API).


Simply drop the following lines of HTML into your web form. You only need to specify the name of the form field and the widget will do the rest!

Step 1. Drop this code somewhere in the <head></head> of your web page

Note: From 16th of July 2018 you must include your API key when using the google map API

Otherwise the Map will display a "This page can't load Google Maps correctly." pop up message,

and the overlay of "For development purposes only" is added to the map tiles.

<script type="text/javascript" src="//"></script>
<script src='//'></script>
<script type="text/javascript" src="//"></script>
<link rel="stylesheet" type="text/css" href="//" />

Step 2. Invoke the plugin using this code towards the bottom of the page. This example invokes the plugin on an HTML element with id mapContainer, and stores the final coordinate data in the HTML element with id coordinates:

<script type="text/javascript">
  $(document).ready(function() {

Step 3. Load the web page and see the new widget appear!
Once submitted, the coordinates of the location selected will be in the form value you chose for target





The ANDS Location Capture widget plugin supports the following functions

Intialise the plugin against a jQuery Object, use a jQuery selector to define the object


Once initialised, call the plugin on the jQuery object again to access the underlying google map object

var map = $("#mapContainer").ands_location_widget('googlemap');


The ANDS Location Capture widget plugin’s init function has the following options:


Under normal operation, the widget opens in map view. Use this setting to open either in the searchor coordsdialogue. Eg

$("#mapContainer").ands_location_widget('init', {mode:'search'});

The initial zoom level of the map. Eg

$("#mapContainer").ands_location_widget('init', {zoom:7});

The initial map view, given as a string of “longitude, latitude”. Eg

$("#mapContainer").ands_location_widget('init', {start:"130, -16"});

The HTML id attribute of the element to store the final coordinate data in. If no such element exists, it wil be created for you, and inserted immediately after the plugin element. Eg

$("#mapContainer").ands_location_widget('init', {target:'coordinate_data'});

Initial coordinate data to display on the map. Coordinates are specified as a comma-delimited string longitude, latitude. Coordinate data can be a single point, or an array of points representing a region. Regions should be closed (that is, the first and last points should be the same). Eg

$("#mapContainer").ands_location_widget('init', {lonLat:'133, -27'});

When entering “point” mode, jumpToPointdefines whether the map view should jump to the existing point, or stay at the current map view. Eg

$("#mapContainer").ands_location_widget('init', {jumpToPoint:false});

The ANDS resolver service to use. Change this when you want to use your own resolver service. Eg

$("#mapContainer").ands_location_widget('init', {endpoint:'http://localhost.localdomain/myresolver/'});
gasset_protocol(the current window's protocol)

The HTTP protocol to use for google asset (image) requests : choose http:// or https://. Eg

$("#mapContainer").ands_location_widget('init', {gasset_protocol:'https://'});
  • No labels