I have created a mapnik tile provider on my local server based on
this tutorial and I want to use it to source my osmdroid app's tiles. Although I set it in the code, it still seems to be loading from online Mapnik source.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Context ctx = getApplicationContext();
Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));
setContentView(R.layout.activity_maps);
mMapView = findViewById(R.id.mMapView);
myLoc=findViewById(R.id.myLoc);
this.mOsmvController = this.mMapView.getController();
final DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
this.mLocationOverlay = new MyLocationNewOverlay(new GpsMyLocationProvider(mContext),
mMapView);
//Set map tile source
final ITileSource tileSource = new XYTileSource(
"myMapnik", 1, 15, 256, ".png", new String[] {"http://192.168.5.15/osm_tiles"});
mMapView.setTileSource(tileSource);
...
How can I prevent osmdroid from loading the map tiles from online Mapnik and have it only request tiles from my local server?
This is mainly because I want to test whether my server servers tiles correctly.