Search code examples
androidosmdroid

Osmdroid map tiles doesnt show


I'm programming a Map application to my android.

Right now, got osmdroid working up, all good. Problem is that when I open the map, it shows the grid, but no tiles.

I'm using:

  • osmdroid-android-4.0.jar
  • slf4j-api-1.7.7.jar
  • slf4j-nop-1.7.7.jar

On create method, I have the following:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Specify the XML layout to use:
    setContentView(R.layout.osm_map);

    // Find the MapView controller in that layout:
    m_mapView = (MapView) findViewById(R.id.mapview);

    // Setup the mapView controller:
    m_mapView.setBuiltInZoomControls(true);
    m_mapView.setMultiTouchControls(true);
    m_mapView.setClickable(true);
    m_mapView.setUseDataConnection(false);
    m_mapView.getController().setZoom(MAP_DEFAULT_ZOOM);
    m_mapView.getController().setCenter(
        new GeoPoint(MAP_DEFAULT_LATITUDE, MAP_DEFAULT_LONGITUDE));
    m_mapView.setTileSource(TileSourceFactory.MAPNIK);
} // end onCreate()

The tiles have been created on MOBAC 1.9.16, and are stored in sd card in 2 ways:

  • /sdcard/osmdroid/mapnik.zip
  • /sdcard/osmdroid/tiles/(3folders)

Any tip for fixing it? Navcat gives no error at all.


Solution

  • Most likely a duplicate with this one.

    If you are planning to use a zip file produced with MOBAC, storing something in "/sdcard/osmdroid/tiles/(3folders)" is irrelevant. You should delete those 3 folders.