开发者

can a webpage on a mobile browser ask/get users location from the phone?

开发者 https://www.devze.com 2023-01-04 21:22 出处:网络
Is there any way that a webpage can make a request for the users location from the android / iphone device ?

Is there any way that a webpage can make a request for the users location from the android / iphone device ?

Since all I need is the users location, I am trying to figure out if there开发者_如何学编程 is anyway I can bypass developing a native app and use some nifty html5 call to just get the users location so all a user would need to do is visit my webpage and provide permission to access his/her location?


Yes. Webkit browsers on Android and Iphone support geolocation. The Google maps api has some great info on it.


Have a look at the Google Maps API (http://code.google.com/apis/maps/documentation/javascript/introduction.html), particularly the sensor parameter...may give you want you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消