Yes, you need to use the ClientLocation object in the google.loader namespace, so you do not need to reference api maps or anything else. For instance.
<script src="http://www.google.com/jsapi" language="javascript"></script> <script language="javascript"> if (google.loader.ClientLocation != null) { alert(google.loader.ClientLocation.address.city); } else { alert("Not found"); } </script>
Available properties
- google.loader.ClientLocation.latitude
- google.loader.ClientLocation.longitude
- google.loader.ClientLocation.address.city
- google.loader.ClientLocation.address.country
- google.loader.ClientLocation.address.country_code
- google.loader.ClientLocation.address.region
source share