私はasp.netが初めてです。特にモバイル ユーザー向けの Web サイトを開発しています。モバイルが GPS をサポートしている場合は、クライアント側で経度と緯度を取得したいので、ウェブサイトで GPS による位置情報を有効にします。どうやってやるの。これは HTML5 で動作しますか?
説明付きのコードを送るのを手伝ってください。
ありがとう
これには HTML5 Geolocation を使用できますが、携帯電話の GPS は使用していません。
http://html5doctor.com/finding-your-position-with-geolocation/など。
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');
}