tags:

views:

260

answers:

2

Hi every one,

I am developing a mobile based web-site, there i have intigrated google maps, i need to fill the 'From' field of google maps dynamically.

Is it possible to get the 'GPS' location form web-browser and fill it up in the 'From' field of a google map dynamically.

+2  A: 

There is the GeoLocation API, but browser support is rather thin on the ground at present. Most sites that care about such things use a GeoIP database (with the usual provisos about the inaccuracy of such a system). You could also look at third party services requiring user cooperation such as FireEagle.

David Dorward
thanks alot for your quick response.if possible, can you provide me some more tips...
Ganesh
A: 

If you use the GeoLocation API, it could be as simple as this:

navigator.geolocation.getCurrentPosition(GetLocation);
function GetLocation(location) {
    alert(location.coords.latitude);
    alert(location.coords.longitude);
    alert(location.coords.accuracy);
}

You may also be able to able to use Google's Client Location API's.

This issue has been discussed in previous posts here and here. They may be able to provide more insight.

Doc Hoffiday