简体   繁体   English

route-me和libosmscout(iOS的离线矢量地图)

[英]route-me together with libosmscout (offline vector maps for iOS)

I´m trying to use the route-me framework together with C++ library libosmscout . 我正在尝试将route-me框架与C ++库libosmscout一起使用。

What I have done so far: 到目前为止,我所做的是:

  • import OSM data into libosmscout format 将OSM数据导入libosmscout格式
  • compiling the iOS example-project from libosmscout-repo libosmscout-repo编译iOS示例项目

The example project only draws one image of the map depending on given lat, long and zoom-factor. 示例项目仅根据给定的纬度,经度和缩放因子绘制一张地图图像。

What I want to do is, using the map view functionality of route-me but with map source data from libosmscout. 我想做的是,使用route-me的地图视图功能,但使用来自libosmscout的地图源数据。

Is there anybody who has been managed this problem or could give me some hints? 有没有人处理过这个问题或可以给我一些提示?

I'm trying to do exactly the same thing. 我正在尝试做完全相同的事情。
But I haven' been able to compile the libosmscout for iOS up to now. 但是到目前为止 ,我还不能为iOS编译libosmscout

Anyway, I'm no sure how comfortable you are with route-me but I'm gonna try and answer your question. 无论如何,我不确定您对我的路线有多满意,但我会尽力回答您的问题。 If you are going to use libosmscout to leverage map data form osm xml or pbf files (probably for offline use) you're gonna need to implement a new MapSource and write the code yourself. 如果要使用libosmscout来利用osm xml或pbf文件形式的地图数据(可能供离线使用),则需要实现一个新的MapSource并自己编写代码。

you'd better inherit from RMAbstractWebMapSource and implement imageForTile:tile inCache:tileCache method to meet your requirements. 您最好继承自RMAbstractWebMapSource并实现imageForTile:tile inCache:tileCache方法以满足您的要求。 Route-me is a tile based map viewer, therefore you need to convert those vector data to tiles, for that you're gonna need to convert tile requests to boundingbox (a few examples are available in OSM wiki) and then try and extract the data from your OSM file and pass it to route-me as an image instance (a png for example). Route-me是一个基于图块的地图查看器,因此您需要将这些矢量数据转换为图块,因为您将需要将图块请求转换为boundingbox(OSM Wiki中提供了一些示例),然后尝试提取OSM文件中的数据并将其作为图像实例(例如png)传递给route-me。

Don't forget that Route-me caches loaded images, so you have to consider passing the right image for future uses. 不要忘记Route-me缓存加载的图像,因此您必须考虑传递正确的图像以供将来使用。 don't be fooled with the fact that your data is on device, reading vector files can be as demanding as reading raster files from web. 不要被您的数据在设备上这一事实所迷惑,读取矢量文件的需求可能与从Web读取栅格文件的要求一样高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM