在 iPhone 应用程序的地图上绘制用户位置
如何接收和存储用户位置数据以便将其添加到地图中?
一直在研究Apple的MapKit和UserLocation代码。我想要做的是获取所有用户的位置并在地图上绘制 - 一个带有点的世界地图,显示组合的用户基础位置 - 就像我们都见过的几个应用程序一样。不需要寻找代码,需要做我自己的工作,只要有人可以分享他们将如何解决这个问题..谢谢!我是否以某种方式收集用户位置 - 添加到 plist 并......不确定......
How can I receive and store user location data so that I can add it to a map?
Have been studying MapKit and the UserLocation code from Apple. What I want to do is get all user's locations and plot on a map - a worldmap with dots showing the combined user base locations - like several apps we've all seen. NOT looking for code, need to do my own work, just if someone could share how they would tackle this..Thanks! Do I gather the user location somehow - add to a plist and .... Not sure...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该查看核心位置 API 以及地图工具包,您可以找到一种方法来获取用户位置。将结果存储在一个数组中,如果需要,可以使用 plist 来保存它们,并在地图上添加注释以显示所有位置。
You should look at the Core Location APIs as well as map kit, you can find a way to get user locations there. Store the results in an array, with a plist to save them if you want, and put annotations on your map to show all locations.
如果我正确理解你的问题,你将需要构建几个网络服务:
1) 各种客户端可以将其位置数据发送到 TO,然后将其存储在数据库中。然后
2)当任何用户需要打开地图视图时,他们将请求完整的数据集,以便您可以使用该数据来绘制点
If I'm understanding your question correctly, you're going to need to build a couple web services:
1) that the assorted clients can send their location data TO, and that will then store it in a database. Then
2) when any user needs to open the map view, they'll request the full set of data so that you can then use that data to plot the points