I have generated a set of maps, zipped it under name tiles.zip
and copied in sdcard/osmdroid
folder. Here are atlas
setting and folder content.
I used the example project here.
It runs without error but my maps are not presented in MapView
. Here is MainActivity and layout:
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
public class MainActivity extends AppCompatActivity {
public static final GeoPoint BERLIN = new GeoPoint(52.516667, 13.383333);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setClickable(true);
mapView.setBuiltInZoomControls(true);
mapView.setMultiTouchControls(true);
mapView.setUseDataConnection(true);
mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
IMapController mapViewController = mapView.getController();
mapViewController.setZoom(15);
mapViewController.setCenter(BERLIN);
}
}
and
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}">
<org.osmdroid.views.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" />
</RelativeLayout>
As I tested, if I unzip the maps and add them as assets
, maps are shown but in wrong order.
any idea what's wrong? thanks
EDIT1
Here my log: