How to make osmdroid limited to my custom tile provider

42 views
Skip to first unread message

Mehdi Haghgoo

unread,
Jun 3, 2018, 5:37:49 AM6/3/18
to osmdroid
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.

Spieltrieb

unread,
Sep 16, 2018, 4:34:25 AM9/16/18
to osmdroid
Hello,
it does not work for me either. Could you solve the problem?

Best regards

Alex O'Ree

unread,
Sep 16, 2018, 8:02:13 AM9/16/18
to osmdroid
this looks correct to me, how do you know it's not working?
Reply all
Reply to author
Forward
0 new messages