在 iOS 中使用 OpenStreetMap .osm XML 数据
我有一个使用 Google 地图的 iOS 应用程序来显示带有 POI 的城市。现在我也想提供一个离线地图,用户不需要数据连接即可显示。
我检查了OpenStreetMap项目,这个城市的一个.osm
导出是5MB -非常适合 iOS 应用程序。我还检查了routeme库,但只使用了图块,并且没有生成矢量数据。这是正确的吗? PNG 图块的文件大小对于我的应用程序来说太大了。
哪个库适合显示 OSM-XML 数据?我知道有 cloudmade,但这是正确的决定吗?我对他们的许可模式有点困惑。还有其他建议吗?提示?
I have an iOS app using Google Maps to display a city with POIs. Now I want to offer an offline map too, which a user does not require a data connection to display.
I checked the OpenStreetMap project, and a .osm
export of this city is 5MB - perfect for an iOS app. I also checked the routeme library, but there only tiles are used, and no vector data is generated. Is this correct? The file size of the PNG tiles is too big for my app.
Which library makes sense to display OSM-XML data? I know there is cloudmade, but is this the right decision? I'm a bit confused by their licensing model. Any other suggestions? Hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试基于 OSM 的 skobbler/telenav sdk:http://developer.skobbler.com。
您拥有离线地图(小型矢量地图)、自定义 POI 和可配置样式 - 它应该可以满足您的需求。
免费套餐应该足以让您启动应用程序并获得一些用户,直到您必须付费为止。
Try skobbler/telenav's sdk based on OSM: http://developer.skobbler.com.
You've got offline maps (small vector maps), custom POIs and configurable styles - it should cover your needs.
And the free tier should be enough for you to launch your app and get a couple of users until you'd have to pay.
Route-me 仅渲染图块数据,而不渲染矢量数据。
Cloudmade 没有直接的离线库,您必须自己构建。
http://support.cloudmade.com/answers/offline-maps
我没有见过任何开源矢量地图渲染器,但谷歌搜索显示了一两个闭源渲染器。
Route-me only renders tile data, not vector data.
Cloudmade doesn't have a direct offline library, you have to roll your own.
http://support.cloudmade.com/answers/offline-maps
I haven't seen any open source vector map renderers out there, but google search show up one or two closed source renderers.
请参阅 http://wiki.openstreetmap.org/wiki/Rendering 了解渲染引擎列表OSM 数据(免责声明:我是其中之一的作者)。有些是开源的;有些(例如我的)可以免费用于非商业用途,但属于封闭源代码。
您可以尝试使用开源库 Mapnik,但 OSM 页面表示很难设置。这里有一个适用于 iOS 的 Mapnik 视图控制器:https://gist.github.com/2934223。
您在那里找到的任何 C 或 C++ 代码当然都可以在 iOS 中使用,因为 C 和 C++ 与 Objective C 兼容;我发现将可移植的 C++ 代码挂接到 iOS 应用程序中相对容易。
See http://wiki.openstreetmap.org/wiki/Rendering for a list of rendering engines for OSM data (disclaimer: I am the author of one of them). Some are open-source; some (e.g., mine) are free for non-commercial use but closed-source.
You could try using Mapnik, an open-source library, but the OSM page says it is hard to set up. There is a Mapnik view controller for iOS here: https://gist.github.com/2934223.
Any C or C++ code you find out there can of course be used in iOS, because C and C++ are compatible with Objective C; I have found it relatively easy to hook portable C++ code into an iOS app.