This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Custom Tile Server Zoom Levels

1

I created an Android Mobile Application which uses OSMDroid Mapview. It loads perfectly fine from zoom levels 18 and larger. However it only rescales and never serves me tiles from 19 and below.

I have my own tile server using Mapnik, Renderd, Mod_tile so on and so forth. I've set my application to use my own tile server too. Using/Checking with .../osm_tiles/{zoom}/{x}/{y} I know it goes down to level 20, as I've set because it returns an image, no error nor 404. It simply doesn't serve it to my mobile device.

I've checked the console logs and if needed, it downloads the tiles. But once it reaches zoom level 19, it stops and rescales instead. Is there some sort of.... Other settings I need to put?

mv.setUseDataConnection(true);
mv.setMinZoomLevel(16);
mv.setMaxZoomLevel(20);
mv.getController().setZoom(17);
mv.setMultiTouchControls(true);

ITileSource tileSource;
tileSource = new XYTileSource("custom", ResourceProxy.string.mapnik, 16, 20, 256, ".png", custom);
TileSourceFactory.addTileSource(tileSource);

By the way, the last variable "custom" is actually declare like so:

String custom[] = {"http://mytileserver/osm_tiles/"};

asked 21 Jan '16, 06:17

Damian's gravatar image

Damian
46113
accept rate: 0%

edited 21 Jan '16, 06:31


One Answer:

2

I found the answer, it seems I had forgotten to add the line

mv.setTileSource(TileSourceFactory.getTileSource("private"));

After creating and adding the source I need to also set it.

answered 21 Jan '16, 08:04

Damian's gravatar image

Damian
46113
accept rate: 0%

Source code available on GitHub .