i tried to make an offline map using sqlite tiles in assets. I move the sqlite file to the osmdroid folder, but it loads only few parts of the map.
I created my sqlite file using MOBAC, I tried to select different zoom level using same or different layer and force redraw square as PNG.
The map is created using the following code:
map = (MapView) findViewById(R.id.mapview);
map.setTileSource(TileSourceFactory.MAPNIK);
MyLocationNewOverlay mLocationOverlay = new MyLocationNewOverlay(new GpsMyLocationProvider(StepActivity.this), map);
mLocationOverlay.enableMyLocation();
map.getOverlays().add(mLocationOverlay);
map.setBuiltInZoomControls(true);
map.getController().setZoom(15);
map.setClickable(false);
map.setUseDataConnection(false);
map.setMinZoomLevel(15);
map.setMaxZoomLevel(18);
But when the map is loaded (take some times I dont know if it's normal). There is most of the map greyed, I have to zoom in/out several times to load some parts.
I don't understand how to load all my visible map.
The "name" of the tile source used in MOBAC, in your example, would have to match "MAPNIK". You can verify what it's set to by either using the sqlite3 command line tool or using the sqlite manager plugin for firefox.
select * from tiles
should do it
Your example code also sets the zoom level to 15. Are you sure you selected zoom level 15 in mobac? It may be help to set the default lat/lon when the app starts to a location you know is in the database. It's also helpful to include zoom levels 0-9 or so as the content for those zoom levels isn't too big and it will help you find out where is where.
The delay is probably from copying from assets to /sdcard on start up. You'll also want to be sure that the database exists where osmdroid can find it before creating the map view (setContentView). If that isn't an option, you can also reset
the map tile provider after the copy action is complete by mapView.setTileProvider(new MapTileProviderBasic(context));