Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a link to the documentation on the relevant Google Maps API:</p> <p><a href="http://code.google.com/apis/ajax/documentation/#ClientLocation" rel="noreferrer">http://code.google.com/apis/ajax/documentation/#ClientLocation</a></p> <p>It shows an example of how to use it:</p> <pre><code>/** * Set the currentState_ and currentCountry_ properties based on the client's * current location (when available and in the US), or to the defaults. */ InTheNews.prototype.setDefaultLocation_ = function() { this.currentState_ = this.options_.startingState; if (google.loader.ClientLocation &amp;&amp; google.loader.ClientLocation.address.country_code == "US" &amp;&amp; google.loader.ClientLocation.address.region) { // geo locate was successful and user is in the United States. range // check the region so that we can safely use it when selecting a // state level polygon overlay var state = google.loader.ClientLocation.address.region.toUpperCase(); if (InTheNews.stateNames[state]) { this.currentState_ = state; } } this.currentCountry_ = "US"; } </code></pre> <p>And tells you what you will get from it:</p> <blockquote> <p>When populated, the <code>google.loader.ClientLocation</code> object is populated with the following metro-level granularity properties:</p> <ul> <li><p><code>ClientLocation.latitude</code> — supplies the low resolution latitude associated with the client's IP address</p></li> <li><p><code>ClientLocation.longitude</code> — supplies the low resolution longitude associated with the client's IP address</p></li> <li><p><code>ClientLocation.address.city</code> — supplies the name of the city associated with the client's IP address</p></li> <li><p><code>ClientLocation.address.country</code> — supplies the name of the country associated with the client's IP address</p></li> <li><p>ClientLocation.address.country_code — supplies the name of the ISO 3166-1 country code associated with the client's IP address</p></li> <li><p>ClientLocation.address.region — supplies the country specific region name associated with the client's IP address</p></li> </ul> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload