Geolocation API
Geolocation Object ၊
Geolocation object သည် သုံးစွဲသူအား ၎င်းတို့၏တည်နေရာကို ဝဘ်အပလီကေးရှင်းများသို့ ပေးဆောင်ခွင့်ပြုသည်။ ကိုယ်ရေးကိုယ်တာအကြောင်းများကြောင့်၊ အသုံးပြုသူကို တည်နေရာအချက်အလက်ကို အစီရင်ခံရန် ခွင့်ပြုချက်တောင်းခံထားသည်။
မှတ်ချက်- ဤအင်္ဂါရပ်ကို လုံခြုံသောအကြောင်းအရာများ (HTTPS) တွင်သာ ရနိုင်သည်။
မှတ်ချက်- iPhone ကဲ့သို့ GPS ပါရှိသည့် စက်များအတွက် Geolocation သည် အတိကျဆုံးဖြစ်သည်။
Geolocation API ကို navigator.geolocation object မှတဆင့် ထုတ်ဝေ ပါသည်။
Geolocation Object Properties
Property | Description |
---|---|
coordinates | Returns the position and altitude of the device on Earth |
position | Returns the position of the concerned device at a given time |
positionError | Returns the reason of an error occurring when using the geolocating device |
positionOptions | Describes an object containing option properties to pass as a parameter of Geolocation.getCurrentPosition() and Geolocation.watchPosition() |
Geolocation Object Methods
Method | Description |
---|---|
clearWatch() | Unregister location/error monitoring handlers previously installed using Geolocation.watchPosition() |
getCurrentPosition() | Returns the current position of the device |
watchPosition() | Returns a watch ID value that then can be used to unregister the handler by passing it to the Geolocation.clearWatch() method |