如何在 Android 上显示 MapBox 磁贴?我尝试将它与 OSMDroid 和 Nutteq 一起使用,但没有成功。是否有 MapBox 的 android 库?
例如,我使用此代码在 OSMDroid 上实现 MapBox:http: //blog.spatialnetworks.com/post/2012/07/using-mbtiles-on-android-with-osmdroid
XYTileSource MBTILESRENDER = new XYTileSource("mbtiles", ResourceProxy.string.offline_mode, 1, 20, 256, ".png", "http://example.org/");
DefaultResourceProxyImpl mResourceProxy = new DefaultResourceProxyImpl(this.getApplicationContext());
SimpleRegisterReceiver simpleReceiver = new SimpleRegisterReceiver(this.getActivity());
File f = new File(Environment.getExternalStorageDirectory(), "mymbtilesfile.mbtiles");
IArchiveFile[] files = { MBTilesFileArchive.getDatabaseFileArchive(f) };
MapTileModuleProviderBase moduleProvider = new MapTileFileArchiveProvider(simpleReceiver, MBTILESRENDER, files);
MapTileProviderArray mProvider = new MapTileProviderArray(MBTILESRENDER, null, new MapTileModuleProviderBase[] { moduleProvider });
this.mMapView = new MapView(this, 256, mResourceProxy, mProvider);
但它不起作用,我想直接从网络加载 MbTiles。