วิธีรับละติจูดและลองจิจูดเหมือนการค้นหาใน Google Map

ฉันต้องการแสดงละติจูดและลองจิจูดบนหน้าเว็บของฉันเหมือนกับที่เราค้นหาใน Google Map ตัวอย่างเช่น ถ้าฉันป้อน Comfort Inn Sunset ก็จะแสดงละติจูดและลองจิจูดในกล่องข้อความ

ดังนั้นโปรดช่วยฉันโดยเร็วที่สุด


person VIPUL PARMAR    schedule 28.11.2013    source แหล่งที่มา
comment
ความเร่งด่วนที่คุณต้องการความช่วยเหลือจะไม่ทำให้คุณได้รับการตอบกลับเร็วไปกว่านี้แล้ว ผมว่าไม่ค่อยมีคนมองคำถามแล้วคิดอะไรบางอย่างแล้วไม่พูด.. คงต้องติด GPS ครับ   -  person barlop    schedule 28.11.2013
comment
คุณควรชี้แจงคำถามของคุณจริงๆ และคุณควรจะหาคำศัพท์ภาษาอังกฤษพื้นฐานบางคำ เช่น ADDRESS   -  person barlop    schedule 28.11.2013
comment
จนถึงตอนนี้คุณทำอะไรด้วยตัวเองบ้าง? คุณได้อ่านข้อมูลอ้างอิง Google Maps API บางส่วนแล้วหรือยัง   -  person sabotero    schedule 28.11.2013


คำตอบ (2)


โปรดดูลิงค์ด้านล่าง

http://jsfiddle.net/nB2ej/

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

             };
});
person RGS    schedule 28.11.2013
comment
ขอบคุณ rgs มันใช้งานได้ดี แต่คุณมีตัวอย่างมากกว่านี้ไหม ฉันใช้ตัวอย่างหนึ่งเพราะมันไม่ได้ให้คำตอบที่ถูกต้อง - person VIPUL PARMAR; 28.11.2013
comment
โปรดดูลิงค์นี้ด้วย อันนี้เป็นแผนที่แบบกำหนดเองjsfiddle.net/UeP2f - person RGS; 28.11.2013
comment
โปรดตรวจสอบสิ่งนี้ด้วย jsfiddle.net/xJ26V/1 ตัวอย่างนี้จะค้นหาระยะทางจากตำแหน่งที่ค้นหา - person RGS; 29.11.2013

คุณสามารถทำได้ด้วยตนเองบนเว็บไซต์เช่น:

http://stevemorse.org/jcal/latlon.php?cookie=&hidden=&doextra=&time=1253907285187&addr2latlon=1&address=508+Tremont+Ave.+S.W.+Apt.+3R+Building+behind+first+row+-+Upstairs&city=Massillon&state=OH&zip=44647&country=US&latlon2addr=0&latitude=&longitude=

or

http://stuff.mit.edu/geo?location=New+york%2Cnew+york

person teledextri    schedule 28.11.2013
comment
แต่ฉันต้องการเพียงละติจูดและลองจิจูดในนี้เมื่อฉันป้อนเฉพาะชื่อเหมือนใน Google Map ในนี้เราจะป้อนชื่อสถานที่ใดก็ได้และแสดงตำแหน่งนี้ในหมุดเหมือนกับที่ฉันต้องการสำหรับละติจูดและลองจิจูด - person VIPUL PARMAR; 28.11.2013