【发布时间】:2011-07-05 23:57:51
【问题描述】:
我正在尝试使用Route-Me 使用离线 MBTiles 数据库。为此,我使用了Landez,而这又依赖于MBUtil。
现在,我得到的只是一个灰色屏幕,其中的引脚位于正确的位置。以下是打印到控制台的内容:
initializing memory cache <RMMemoryCache: 0x4e42e50> with capacity 32
Opening database at /Users/chrislong/Library/Application Support/iPhone Simulator/4.3.2/Applications/E53BC885-1B02-4B06-B45B-408EB9A147DE/Documents/MapOpenStreetMap.sqlite
Map contents initialised. view: MapView at 0,0-320,411 tileSource <RMCachedTileSource: 0x4e428b0> renderer <RMCoreAnimationRenderer: 0x4e13dc0>
initializing memory cache <RMMemoryCache: 0x5929930> with capacity 32
Opening database at /Users/chrislong/Library/Application Support/iPhone Simulator/4.3.2/Applications/E53BC885-1B02-4B06-B45B-408EB9A147DE/Documents/MapMBTilestiles.mbtiles.sqlite
Warning: I could not find the column named 'tile_data'.
Warning: I could not find the column named 'tile_data'.
Warning: I could not find the column named 'tile_data'.
Warning: I could not find the column named 'tile_data'.
Map contents initialised. view: MapView at 0,0-320,411 tileSource <RMCachedTileSource: 0x592a400> renderer <RMCoreAnimationRenderer: 0x5925770>
值得注意的是,该文件名为tiles.mbtiles,而不是MapMBTilestiles.mbtiles.sqlite,并且存储在捆绑包的根目录中,而不是Documents 文件夹中。
这是我用来制作mapView 并加载数据库的代码:
CLLocationCoordinate2D center = {50, 50};
self.mapView = [[[RMMapView alloc] initWithFrame:self.view.frame] autorelease];
self.mapView.backgroundColor = [UIColor blackColor];
self.mapView.delegate = self;
NSURL *tilePath = [[NSBundle mainBundle] URLForResource:@"tiles" withExtension:@"mbtiles"];
RMMBTilesTileSource *tiles = [[[RMMBTilesTileSource alloc] initWithTileSetURL:tilePath] autorelease];
[self.mapView.contents removeAllCachedImages];
self.mapView.contents = [[[RMMapContents alloc] initWithView:self.mapView tilesource:tiles centerLatLon:center zoomLevel:0.0 maxZoomLevel:[tiles maxZoom] minZoomLevel:[tiles minZoom] backgroundImage:nil] autorelease];
[self addMarkers];
Route-Me 显然根本没有读取文件;即使我完全删除数据库,我也会得到相同的日志输出。 IOW,问题可能是由于 Route-Me 无法找到该文件。任何帮助将不胜感激!
【问题讨论】:
-
您能否向我发送有关如何添加图块图像以路由我的参考,因为我被这个问题困住了,现在我有了地图图像并且我设法将其添加到图块中,但我怎么能将其添加到地图中。谢谢
标签: iphone objective-c route-me