Rss Feed

  1. <html>
    <head>
    <title>google location test</title>
    <script src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
                var city = latitude = longitude = country = region = "dunno";
                if (google.loader.ClientLocation) {
                    latitude = google.loader.ClientLocation.latitude;
                    longitude = google.loader.ClientLocation.longitude;
                    city = google.loader.ClientLocation.address.city;
                    region = google.loader.ClientLocation.address.region;
                    country = google.loader.ClientLocation.address.country;
                }
    </script>
    </head>
    <body>
    <h1>You are in (roughly): <script type="text/javascript">
    document.write(city);
    </script></h1>
    Other parts of the location include:

    <script type="text/javascript">
                document.write("Latitude: "+latitude+"<br/>");
                document.write("Longitude: "+longitude+"<br/>");
                document.write("City: "+city+"<br/>");
                document.write("Region: "+region+"<br/>");
                document.write("Country: "+country+"<br/>");
    </script>
    </body>
    </html>





    google location test



    Refer: http://csausdev.wordpress.com/2009/10/12/trying-out-google-client-location-service/

    In this client city info will not be there so use reverse geocoding to get client city info using latitude and longitude value.



  2. 0 comments:

    Post a Comment