【发布时间】:2015-04-29 10:20:37
【问题描述】:
我有一个基本的 Android 应用程序,它使用 Mapbox SDK(版本 0.7.3)加载并显示本地 .mbtiles 文件,但在加载瓷砖。看起来它可能正在加载所有图块(不仅仅是启动时可见的图块)。有没有办法改变这一点。 .mbtiles 文件大小约为 257 MB,应用启动后大约需要 40 秒才能显示地图。
任何帮助将不胜感激。
这是加载图块的位置:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.findViewById(R.id.mapview);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setZoom(9);
mapView.setMinZoomLevel(8);
mapView.setMaxZoomLevel(15);
mapView.setCenter(new LatLng(55.676111, 12.568333));
mapView.setTileSource(new MBTilesLayer(this, "DK_underlay_1_0_4.mbtiles"));
}
以下是加载应用时显示约 40 秒间隔的日志:
04-29 11:07:54.173 23590-23590/com.example.stugrey.testapp D/MapboxMapView﹕ centerLatLng is not specified in XML.
04-29 11:07:54.173 23590-23590/com.example.stugrey.testapp D/Mapbox MapView﹕ zoomLevel is not specified in XML.
04-29 11:08:34.236 23590-23590/com.example.stugrey.testapp D/AppUtils﹕ Device density is 320, and result of @2x check is true
04-29 11:08:34.236 23590-23590/com.example.stugrey.testapp D/MapTileDownloader﹕ Going to use @2x tiles? 'true'
04-29 11:08:34.308 23590-23590/com.example.stugrey.testapp I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018_msm8226_LNX.LA.3.5.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.08
Build Date: 03/07/14 Fri
Local Branch:
Remote Branch: quic/LNX.LA.3.5.1_RB1.1
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018 + f2fd134 + NOTHING
【问题讨论】: