有没有一种简单的方法来设计一个网站来促进iphone用户提供gps网站坐标?
我想知道表单字段是否有命名约定,例如,让用户以自动方式输入。
我正在考虑建立一个基于位置的网站,并希望为 iPhone(和其他移动用户)量身定制。我意识到 iPhone 应用程序可以做到这一点,但我没有能力创建一个。
以下是有关如何从 iPhone 读取位置的片段。看起来需要3.0:
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
function foundLocation(position)
{
var lat = position.coords.latitude;
var long = position.coords.longitude;
alert('Found location: ' + lat + ', ' + long);
}
function noLocation()
{
alert('Could not find location');
}
See: http://mapscripting.com/how-to-use-geolocation-in-mobile-safari http://mapscripting.com/how-to-use-geolocation-in-mobile-safari
顺便说一句,如果您想在 iPhone 上使用 Web 代码,您可以尝试一些中间解决方案,这些解决方案不会强迫您创建本机应用程序,而是允许您将网站包装在应用程序中并获得访问权限GPS 和其他本机功能。
- 电话差距:http://phonegap.com/ http://phonegap.com/
- 加速器:http://www.appcelerator.com/products/titanium-mobile/ http://www.appcelerator.com/products/titanium-mobile/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)