我无法为我的城市区域(印度马哈拉施特拉邦纳西克)创建矢量 mbtiles 文件,我正在使用 nutiteq SDK 来显示离线地图。我曾尝试使用 Mobile Atlas creator 创建 mbtile,但输出的 .mbtile 文件在 Nutiteq SDK 中不起作用。
请在这方面提供帮助。我只想在我的应用程序中显示特定区域 .mbtiles。
先感谢您。
我无法为我的城市区域(印度马哈拉施特拉邦纳西克)创建矢量 mbtiles 文件,我正在使用 nutiteq SDK 来显示离线地图。我曾尝试使用 Mobile Atlas creator 创建 mbtile,但输出的 .mbtile 文件在 Nutiteq SDK 中不起作用。
请在这方面提供帮助。我只想在我的应用程序中显示特定区域 .mbtiles。
先感谢您。
MBTiles is general format which can contain also vector data (tiles), not only raster . Both TileMill and Mobile Atlas Creator can create only rasters, first one from vector data, and second one by scraping it from on-line APIs. You can use raster MBTiles with Nutiteq SDK, iOS sample:
// file-based local offline datasource
NSString* fullpathVT = [[NSBundle mainBundle] pathForResource:@"MBTILESFILENAME" ofType:@"mbtiles"];
NTTileDataSource* tileDataSource = [[NTMBTilesTileDataSource alloc] initWithMinZoom:0 maxZoom:19 path: fullpathVT];
// Initialize a raster layer with the previous data source
NTRasterTileLayer* rasterLayer = [[NTRasterTileLayer alloc] initWithDataSource:tileDataSource];
// Add the raster layer to the map
[[self getLayers] add:rasterLayer];
Android:
MBTilesTileDataSource tileDataSource = new MBTilesTileDataSource(
0, 19, filePath);
RasterTileLayer rasterLayer = new RasterTileLayer(tileDataSource);
mapView.getLayers().add(rasterLayer);
TileMill and Mobile Atlas Creator (MOBAC) does not support creating vector mbtiles. All the sources from where MOBAC gets data are raster ones, so it is not possible in principle. So there is no easy and free source to download the files as far as I know. I can suggest two options:
You should contact Nutiteq to get access to beta, or enterprise license. Disclaimer: I'm founder of Nutiteq.
You can create MBTiles from any .osm.pbf file using this tool - https://github.com/systemed/tilemaker
Download .osm.pbf file from Geofabric. To download for a custom area, you can use Protomaps or BBBike Extract
Download tilemaker
Execute the following command
tilemaker --input netherlands.osm.pbf --output netherlands.mbtiles --process resources/process-openmaptiles.lua --config resources/config-openmaptiles.json
You can read more about it in this blog post - https://blog.kleunen.nl/blog/tilemaker-generate-map