Namespace AlphaGeo
Defined in: geo.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Set of methods for getting geo information
|
Method Attributes | Method Name and Description |
---|---|
<static> |
AlphaGeo.councils()
|
<static> |
AlphaGeo.deleteGeoCookie()
Removes any currently set geo cookies
|
<static> |
AlphaGeo.locate(String, opts, ignoreKnown, errorSelector)
Based on Matt Patterson's Alphagov Locator jQuery plugin
|
<static> |
AlphaGeo.locationCoords()
|
<static> |
AlphaGeo.locationName()
|
<static> |
AlphaGeo.locator_object()
|
<static> |
AlphaGeo.readAndParseJSONCookie(String)
|
Method Detail
<static>
AlphaGeo.councils()
AlphaGeo.councils()
- Returns:
- A string containing the current "friendly name" for the current location, set in the cookie, or false if no cookie found.
<static>
AlphaGeo.deleteGeoCookie()
Removes any currently set geo cookies
AlphaGeo.deleteGeoCookie()
- Returns:
- true
<static>
AlphaGeo.locate(String, opts, ignoreKnown, errorSelector)
Based on Matt Patterson's Alphagov Locator jQuery plugin
AlphaGeo.locate("#global-locator-form", "{ ignoreKnown: false, errorSelector: '#global-locator-error', noJSSubmit: false }")
- Parameters:
- String
- id Selector ID for the element containing the location feature widget (Can be the form ID or the container)
- {Object} opts Optional
- Options. Options
- ignoreKnown
- Set to false if you want to ignore the known value if it has been set, on page load
- errorSelector
- A selector where error messages will be shown
- Returns:
- false
<static>
AlphaGeo.locationCoords()
AlphaGeo.locationCoords()
- Returns:
- A string containing the current "friendly name" for the current location, set in the cookie, or false if no cookie found.
<static>
AlphaGeo.locationName()
AlphaGeo.locationName()
- Returns:
- A string containing the current "friendly name" for the current location, set in the cookie, or false if no cookie found.
<static>
AlphaGeo.locator_object()
AlphaGeo.locator_object()
- Returns:
- A string containing the current "friendly name" for the current location, set in the cookie, or false if no cookie found.
<static>
AlphaGeo.readAndParseJSONCookie(String)
AlphaGeo.readAndParseJSONCookie("qwerty")
- Parameters:
- String
- name Name of the cookie
- Returns:
- A JSON object or false if no match found