Is it possible to get a GPS location from a web browser?

828770 pts.
Tags:
Browsers
Mobile
Our development team is working a mobile based website, where we have integrated Google Maps but we still need to fill "from" field of GM dynamically. Would it be possible to get the GPS location from a web browser and fill it up that way?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    Take a look at the Geolocation API.  If the browsers you intend to address support it, that might be all you need.
    83,255 pointsBadges:
    report
  • excellentrandy
    Using ASP?
    function onPositionUpdate(position)
            {
                var lat = position.coords.latitude;
                var lng = position.coords.longitude;
                alert("Current position: " + lat + " " + lng);
            }
    
            if(navigator.geolocation)
                navigator.geolocation.getCurrentPosition(onPositionUpdate);
            else
                alert("navigator.geolocation is not available");
    1,330 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: