UploadWizard/Geolocation

= Locator =

Code
In the following examples, $ is a jQuery object.

Creation of widget
The following code would create a map widget on the page, pre-centered and pre-zoomed to a point in San Francisco, CA.

var options = { location: { latitude: 37.775, longitude: -122.4183 }, // optional; both values decimal zoom: ?? precision: ?? // any other options about map appearance };

// create widget on page, at HTML element located at #foo var locator = $('#foo').locator( options );

If the user had not passed a location in the options, then the map would display a general map of the entire world. 'zoom' would not be respected.

If the location option is somehow improper, an exception is thrown. Improper locations include:
 * null
 * not an object
 * object does not contain both latitude and longitude properties
 * latitude < -90.0 or latitude > 90.0
 * longitude > 180.0 or longitude < -180.0

Obtaining wikitext
// Get location information var wikiText = locator.getWikiText; // wikiText now contains valid wikitext containing the appropriate Location template, corresponding to // the location selected in the widget