在 MapView 中保存标记
我有一个地图视图来在其上设置标记。我想将这些点存储为行程的一部分,稍后当我选择该行程时能够看到我之前添加的标记。
我见过的所有示例都使用 XML 中的 file.plist 文件,其中包含他们想要解析并在地图视图上绘制的所有点。但不是相反,这是从点创建文件。
我想到了几种方法来做到这一点:
- 创建 file.plist。稍后检索数据会更容易,但创建起来会更麻烦。
- 将这些点与行程点一起存储在数据库中,并在以后检索它们。
期待您的建议。
最好的 大卫.
I have a mapView to set markers on it. I would like to store this points as part of an itinerary, and later when I select that itinerary been able to see the markers that previoulsy I added.
All examples I have seen work with a file in XML a file.plist with all the points that they want to parse and draw on the mapview. But not the oposite, this is create the file from the points.
I have thought of several ways of doing this:
- Creating the file.plist. It will be easier to retrive the data later, but more hassle to create.
- Storing the points in a database along with the points of the itinerary and retriving them later.
Looking forward your advice.
Best
David.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在数据库中实现了一个行程表。将表的 id 作为主表 Itineraries 的外键。我认为这种方式比创建 XML file.plist 更容易。
当您拥有静态点时,file.plist 非常有用,因为它为您提供了访问变量的方法:
但在这种情况下,我可以使用数据库中的坐标存储来创建标记。
I have implemented a table in a database for the itineraries. with the id of the table as foreing key of the main table Itineraries. I think is easier this way than create the XML file.plist.
The file.plist it's very helpful when you have the static points, as offers you methods to access the variables:
But in this case I can create the markers using the coordinates store in the database.