iPhone 网络应用程序可以获取 GPS 位置吗?
有没有一种简单的方法来设计一个网站,以方便 iphone 用户向网站提供 gps 坐标?
我想知道表单字段是否有命名约定,例如,让用户以自动方式输入。
我正在考虑建立一个基于位置的网站,并希望为 iPhone(和其他移动用户)量身定制。 我意识到 iPhone 应用程序可以做到这一点,但我没有能力创建一个。
Is there an easy way to design a website to facilitate an iphone user providing gps coordinates to the site?
I am wondering if there might be a naming convention for form fields for example, to let the user input in an automated way.
I am considering building a location based website and would like to tailor it for iphone (and other mobile users). I realize an iphone app could do this but I'm not equipped to create one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
以下是有关如何从 iPhone 读取位置的片段。 看起来需要 3.0:
请参阅:http://mapscripting.com/how -to-use-geolocation-in-mobile-safari
顺便说一句,如果您想在 iPhone 上使用 Web 代码,您可以尝试一些中间解决方案,这些解决方案不会强迫您创建一个本机应用程序,但允许您将您的网站包装在应用程序中并访问 GPS 和其他本机功能。
Here's a snippet on how to read location from the iPhone. Looks like it requires 3.0:
See: http://mapscripting.com/how-to-use-geolocation-in-mobile-safari
By the way, if you want to use web code on the iPhone, there are a couple middle-ground solutions you could try that don't force you to create a native app but allow you to wrap your site in an app and get access to GPS and other native features.
查看 Jouni Erola 导航下的 SendLocation 应用程序。
它是一个简单的应用程序,可以发送纬度和纬度。 iPhone 的远程连接到您的服务器。
只需输入您的服务器 URL 即可以 HTTP-GET 方法接收位置
Check out the app SendLocation under navigation by Jouni Erola.
Its a simply app that will send out the lat & lon of the iPhone to YOUR server.
Simply enter your server url to receive the location as HTTP-GET methid
我没有任何编程就做到了这一点。 您可以:
请参阅 http://CharlieBloom.com 上的工作示例。 仅显示 3 条最新(可自定义)推文,单击“在 Twitter 上关注我”以查看“我的位置......”和 Google 地图链接。 职位发送后 2-3 分钟就会在我的网站上更新。
此致,
查理·布鲁姆
I've don this without any programming. You can:
See a working axample at http://CharlieBloom.com. Only the 3 latest (customizeable) Tweets are visible, click on "Follow me on Twitter" to se "My position ....." and a Google Maps-link. Positions are updated on my website 2-3 minutes after I have sent them.
Best regards,
Charlie Bloom
是的,但是准确度很差。 我刚刚构建了一个 Web 表单,将 GPS 设置从 watchPosition() 函数发布到我的数据库,然后映射结果。 当沿着当地一条河流划船时,七个帖子中只有两个正确。 其余的都在河外,其中两个距离大约一英里! 我现在正在寻找更好的解决方案。
这是我用来更新表单字段的代码:
这就是表单。 更新以满足您的需求。
Yes, but the accuracy is pretty bad. I just built a web form that posts GPS settings from the watchPosition() function to my database and then maped the results. While paddling down a local river it got only two of seven posts correct. The rest were outside the river, and two of those were about a mile away! I'm now looking for a better solution.
Here's the code I use to update the form fields:
And this is the form. Update to suite your needs.