如何在route-me中集成map2sqlite文件

时间:2014-09-15 06:50:16

标签: ios7 openstreetmap route-me

关于如何使用openstreetmap数据和route-me在ios中使用离线地图,我经历了这个link。我生成了map2sqlite文件并通过链接将其集成到route-me中。但是地图没有加载所需的区域。是否有关于将map sqlite文件集成到route-me中的示例或教程。关于此的教程或工作示例将更有帮助。

当我在设备上运行我的代码时,我得到了以下日志。

2014-09-15 13:08:09.659 SimpleMap[8658:60b] <MapViewAppDelegate: 0x14db9d10> init
2014-09-15 13:08:09.689 SimpleMap[8658:60b] <MapViewViewController: 0x14dbab30> viewDidLoad
2014-09-15 13:08:09.692 SimpleMap[8658:60b] logged method call: -[<RMMapContents: 0x14db9b00> initWithView:screenScale:] (line 96)
2014-09-15 13:08:09.713 SimpleMap[8658:60b] logged method call: -[<RMMapContents: 0x14db9b00> initWithView:tilesource:centerLatLon:zoomLevel:maxZoomLevel:minZoomLevel:backgroundImage:screenScale:] (line 143)
2014-09-15 13:08:09.719 SimpleMap[8658:60b] logged method call: -[MapView at 0,0-320,480 performInitialSetup] (line 70)
2014-09-15 13:08:09.726 SimpleMap[8658:60b] initializing memory cache <RMMemoryCache: 0x14dbf2f0> with capacity 32
2014-09-15 13:08:09.732 SimpleMap[8658:60b] Opening database at /var/mobile/Applications/8886B2C4-1C6A-4160-AE77-519C256A4FBB/Documents/MapOpenStreetMap.sqlite
2014-09-15 13:08:09.837 SimpleMap[8658:60b] Map contents initialised. view: MapView at 0,0-320,480 tileSource <RMCachedTileSource: 0x14dbeeb0> renderer <RMCoreAnimationRenderer: 0x14dc0420>
2014-09-15 13:08:09.850 SimpleMap[8658:60b] Center: Lat: -33.858771 Lon: 151.201596
2014-09-15 13:08:09.854 SimpleMap[8658:60b] Trying to Open db map source /var/mobile/Applications/8886B2C4-1C6A-4160-AE77-519C256A4FBB/SimpleMap.app/mymap.sqlite
2014-09-15 13:08:09.860 SimpleMap[8658:60b] Opening db map source mymap.sqlite
2014-09-15 13:08:09.870 SimpleMap[8658:60b] Tile size: -2147483648 pixel
2014-09-15 13:08:09.874 SimpleMap[8658:60b] Supported zoom range: 0 - -1042284544
2014-09-15 13:08:09.876 SimpleMap[8658:60b] Coverage area: (-2147483648.000000,-2147483648.000000) x (-2147483648.000000,-2147483648.000000)
2014-09-15 13:08:09.878 SimpleMap[8658:60b] Center: (-2147483648.000000,-2147483648.000000)
2014-09-15 13:08:09.880 SimpleMap[8658:60b] logged method call: -[<RMMapContents: 0x14dc5050> initWithView:tilesource:screenScale:] (line 119)
2014-09-15 13:08:09.882 SimpleMap[8658:60b] logged method call: -[<RMMapContents: 0x14dc5050> initWithView:tilesource:centerLatLon:zoomLevel:maxZoomLevel:minZoomLevel:backgroundImage:screenScale:] (line 143)
2014-09-15 13:08:09.885 SimpleMap[8658:60b] logged method call: -[<RMMapContents: 0x14db9b00> dealloc] (line 307)
2014-09-15 13:08:09.890 SimpleMap[8658:60b] logged method call: -[MapView at 0,0-320,480 performInitialSetup] (line 70)
2014-09-15 13:08:09.900 SimpleMap[8658:60b] initializing memory cache <RMMemoryCache: 0x14d78300> with capacity 32
2014-09-15 13:08:09.904 SimpleMap[8658:60b] Opening database at /var/mobile/Applications/8886B2C4-1C6A-4160-AE77-519C256A4FBB/Documents/Map(null).sqlite
2014-09-15 13:08:09.914 SimpleMap[8658:60b] fetching tile 0 (y:0, x:0)@0
2014-09-15 13:08:09.920 SimpleMap[8658:60b] DB error 1 on line 49: no such table: tiles
2014-09-15 13:08:09.923 SimpleMap[8658:60b] Map contents initialised. view: MapView at 0,0-320,480 tileSource <RMCachedTileSource: 0x14dc11b0> renderer <RMCoreAnimationRenderer: 0x14dc5c10>

1 个答案:

答案 0 :(得分:0)

您的日志似乎表明您的数据库格式/内容不正确:

template<class T,class ...Args> std::vector<T> generate_with_index(size_t qty,Args ...args)
{
    std::vector<T> result;
    result.reserve(qty);
    for(size_t i = 0 ; i < qty ; ++qty)
        result.emplace_back(i, args...);
    return result;
}

由于您的数据库中没有任何图块,因此无法显示任何图块。

我建议您查看Mapbox SDKtheir sample application