I try to show tiles from my custom tileserver. I'm using my own tileserver (shown at https://www.url.be) Tiles are shown correct here. I just don't understand why my tiles are messed up on the android studio app (using osmdroid). The problem persists when zooming in too.
And my code:
map = (MapView) findViewById(R.id.map);
// Create a custom tile source
map.setTileSource(new OnlineTileSourceBase("hot", 1, 20, 256, ".png",
new String[] { "https://www.url.be/hot/" }) {
@Override
public String getTileURLString(long pMapTileIndex) {
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ mImageFilenameEnding;
}
});
//map.setTileSource(TileSourceFactory.MAPNIK);
map.setMultiTouchControls(true);
IMapController mapController = map.getController();
mapController.setZoom(15.0);
GeoPoint startPoint = new GeoPoint(51.111500, 3.985040);
mapController.setCenter(startPoint);
Any advice on this?
So, I have been looking further on this issue. I had to switch the getY and getX in the code.
So:
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ mImageFilenameEnding;
Had was wrong and should be:
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ mImageFilenameEnding;
Hope this helps anyone