1

i am new in asp.net. i am developing a website especially for mobile users. i want to get the longitude and latitude by the client side, if mobile is support GPS so it enable the location by GPS on website. how can i do that. is this work on HTML5?

plz help send some Code with description.

Thanks

wajidullah khan
  • 51
  • 1
  • 1
  • 3

2 Answers2

1

You can use HTML5 Geolocation for this, it's not using the phones GPS though

http://html5doctor.com/finding-your-position-with-geolocation/ for example.

  navigator.geolocation.getCurrentPosition(foundLocation, noLocation);

  function foundLocation(position)
  {
    var lat = position.coords.latitude;
    var long = position.coords.longitude;
    alert('Found location: ' + lat + ', ' + long); //Do something
  }
  function noLocation()
 {
    alert('Could not find location');
 }
Thomas
  • 1,563
  • 3
  • 17
  • 37
  • 1
    But remember that (most) browsers ask the user via a popup whether they will allow the access of `navigator.geolocation`. – feeela Aug 08 '12 at 08:17
-1

Use sim7100e attached to lattepanda with build in arduino the sim71000e will send a location data by sim7100e gps to the arduino this location data will process by arduino code then the arduino send the data to c# on lattepanda ang upload the data to your webpage by the internet

Ric
  • 1