Google ประกาศให้ปล่อย Google Gears 0.4 เวอร์ชั่นใหม่สำหรับพัฒนา web application ซึ่งในเวอร์ชั่นนี้มี Gears Geolocation API ซึ่งเป็นช่องทางการใช้ข้อมูลตำแหน่งจากระบบของ google และใช้ในการระบุตำแหน่งของ user นอกจากนี้ google gear สำหรับ mobile ยังรองรับการคำนวณตำแหน่งจาก cell-ID ของมือถือซึ่งเป็น feature ที่อยู่บน google map mobile ( cell-ID of nearby cell towers or on-board GPS )
การใช้งานของ Geolocation API ก็สามารถใช้งานผ่าน javascript โดยเรียกใช้งานผ่าน getCurrentPosition() เพื่อดูตำแหน่งของผู้ใช้ สำหรับ application ที่จะใช้งานเครื่องลูกข่ายต้องมีการติดตั้ง plug-in google gear บน web browser ก่อนซึ่งรองรับทั้ง IE, firefox และ IE Mobile
นอกจากนี้ยังมีการสร้างมาตรฐานการทำงาน Geolocation API โดยปัจจุบันอยู่ในเวอร์ชั้น draft ของ W3C ภายใต้ชื่อ W3C Geolocation specification ซึ่งจะรองรับการทำงานร่วมกันของเว็บบราว์เซอร์บนมาตรฐาน HTML5 ที่กำลังจะมาในอนาคต
ตัวอย่างซอสโค้ดการเรียกใช้งาน geolocation api
<script type=”text/javascript” src=”gears_init.js“></script>
<script type=”text/javascript”>
var geo = google.gears.factory.create(’beta.geolocation’);
function updatePosition(position) {
alert(’Current lat/lon is: ‘ + position.latitude + ‘,’ + position.longitude);
}
function handleError(positionError) {
alert(’Attempt to get location failed: ‘ + positionError.message);
}
geo.getCurrentPosition(updatePosition, handleError);
</script>

อ้างอิงจาก
http://google-code-updates.blogspot.com/2008/08/two-new-ways-to-location-enable-your.html
http://googlemobile.blogspot.com/2008/08/new-gears-geolocation-api-powers-mobile.html



ตุลาคม 9, 2008 ที่ 4:54 am |
At the beginning, Google Geolocation API has determined the location for only Americans, for the other it has returned “unknown”. Later this service was advanced, but it often does not show results even for developed countries as yet. For such cases, there is a simple javascript extension to the Google API, which gives back the country of user.
http://www.wipmania.com/en/blog/google-geolocation-api/