ฉันต้องการแสดงละติจูดและลองจิจูดบนหน้าเว็บของฉันเหมือนกับที่เราค้นหาใน Google Map ตัวอย่างเช่น ถ้าฉันป้อน Comfort Inn Sunset ก็จะแสดงละติจูดและลองจิจูดในกล่องข้อความ
ดังนั้นโปรดช่วยฉันโดยเร็วที่สุด
ฉันต้องการแสดงละติจูดและลองจิจูดบนหน้าเว็บของฉันเหมือนกับที่เราค้นหาใน Google Map ตัวอย่างเช่น ถ้าฉันป้อน Comfort Inn Sunset ก็จะแสดงละติจูดและลองจิจูดในกล่องข้อความ
ดังนั้นโปรดช่วยฉันโดยเร็วที่สุด
โปรดดูลิงค์ด้านล่าง
geocoder.geocode({ 'address': addresscity }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latitude = results[0].geometry.location.lat();
longitude = results[0].geometry.location.lng();
document.getElementById("lat").value= latitude;
document.getElementById("lon").value= longitude;
var myLatlng = new google.maps.LatLng(latitude, longitude);
var mapOptions = {
center: new google.maps.LatLng(latitude, longitude),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
});
คุณสามารถทำได้ด้วยตนเองบนเว็บไซต์เช่น:
or
http://stuff.mit.edu/geo?location=New+york%2Cnew+york