iPhone 通过以下调用支持移动 Safari 中的地理定位:
The iPhone supports geolocation in mobile Safari via the following call:
navigator.geolocation.getCurrentPosition(
function(pos){
var lat = pos.coords.latitude;
var long = pos.coords.longitude;
},
function(){
/* Handler if location could not be found */
}
);
我想建立一个良好的设备列表,这些设备具有以下之一:
I'd like to build a good list of devices that have one of the following:
我只熟悉我自己的设备,所以这是我目前的清单:
I'm only familiar with my own device, so this is my list so far:
?
Blackberry、Android 手机等的支持程度如何?
What is the level of support in Blackberry, Android phones, etc?
虽然我认为标准化(顺便提一下)是一个很好的实践W3C Geolocation API,值得注意的是浏览器中还有一些其他选项,如果您需要针对较旧的平台.
Although I think it's a great practice to standardize on the (draft, by the way) W3C Geolocation API, it's worth noting that there are a few other options in the browser, which can be particularly helpful if you need to target an older platform.
navigator.geolocation
语法非常相似.navigator.geolocation
with very similar syntax.这篇关于哪些设备支持通过 navigator.geolocation 进行 Javascript 地理定位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!