MAP SCRIPTING 101 by Adam DuVander

MAP SCRIPTING 101 by Adam DuVander

Author:Adam DuVander [Adam DuVander]
Language: eng
Format: epub
Tags: COMPUTERS / Web / Web Programming
ISBN: 9781593273361
Published: 2010-08-17T16:00:00+00:00


Use Google's ClientLocation JavaScript Object

If you don't need the user's location on the server, you can easily get it if you use Google's Ajax Loader. This is an alternate way to load Google's JavaScript APIs, including Maps and Search. The ClientLocation object is available even without loading a specific API, which makes for minimal overhead considering the data it provides.

As with the standard Google Maps API, you need to include the call to Google's JavaScript within the header of your HTML file:

<script type="text/javascript" src="http://www.google.com/jsapi?key= yourkey"></script>

Then, anywhere within your JavaScript code, you can access google.loader.ClientLocation.latitude and google.loader.ClientLocation.longitude (in addition to a few other data items, such as the city name).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.