The ARDC 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.
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
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
The ARDC 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 ARDC 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
The initial zoom level of the map. Eg
The initial map view, given as a string of “longitude, latitude”. Eg
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
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
When entering “point” mode,
The ANDS resolver service to use. Change this when you want to use your own resolver service. Eg
The HTTP protocol to use for google asset (image) requests : choose