<script type="text/javascript" 
src="http://www.google.com/jsapi?key=<YOUR_GOOGLE_API_KEY>"></script>
    <script type="text/javascript">
        if(google.loader.ClientLocation)
        {
            visitor_lat = google.loader.ClientLocation.latitude;
            visitor_lon = google.loader.ClientLocation.longitude;
            visitor_city = google.loader.ClientLocation.address.city;
            visitor_region = google.loader.ClientLocation.address.region;
            visitor_country = google.loader.ClientLocation.address.country;
            visitor_countrycode = 
google.loader.ClientLocation.address.country_code;
            document.getElementById('yourinfo').innerHTML = '<p>Lat/Lon: ' 
+ visitor_lat + ' / ' + visitor_lon + '</p><p>Location: ' + visitor_city + 
', ' + visitor_region + ', ' + visitor_country + ' (' + visitor_countrycode 
+ ')</p>';
            {{session.lat=visitor_lat}}
            {{session.lon=visitor_lon }}
        }
        else
        {
            document.getElementById('yourinfo').innerHTML = 
'<p>Whoops!</p>';
        }
    </script>
        
        
error:

<type 'exceptions.NameError'> name 'visitor_lat' is not defined

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to