I successfully integrated OpenStreetMap into my Android application using osmdroid and decided to try my hand at using OpenSeaMap as the map tile provider (the application is ocean-focussed).
Following the instructions outlined here for incorporating a custom tile provider into osmdroid I added the following code:
// Create a custom tile source
final IRegisterReceiver registerReceiver = new SimpleRegisterReceiver(context);
final ITileSource tileSource = new XYTileSource("Mapnik",
ResourceProxy.string.mapnik,
1,
18,
256,
".png",
new String[] {"http://tiles.openseamap.org/seamark/"});
// Create a file cache modular provider
final TileWriter tileWriter = new TileWriter();
final MapTileFilesystemProvider fileSystemProvider = new MapTileFilesystemProvider(registerReceiver, tileSource);
// Create a download modular tile provider
final NetworkAvailabliltyCheck networkAvailabliltyCheck = new NetworkAvailabliltyCheck(context);
final MapTileDownloader downloaderProvider = new MapTileDownloader(tileSource, tileWriter, networkAvailabliltyCheck);
// Create a custom tile provider array with the custom tile source and the custom tile providers
final MapTileProviderArray tileProviderArray = new MapTileProviderArray(tileSource, registerReceiver, new MapTileModuleProviderBase[] { fileSystemProvider, downloaderProvider });
// Create the mapview with the custom tile provider array
this.mapView = new MapView(context, 256, new DefaultResourceProxyImpl(context), tileProviderArray);
...notably, the code I've written excludes the GEMF file archive. To be honest, I don't understand the implications of this. Hopefully someone can shed some light on this topic as well. The effect of this is somewhat telling. Where OpenSeaMap information is provided a black tile is presented. Upon zooming in further, the tiles appear to be jumbled.
As I continue to experiment, I noticed that sometimes, the OpenSeaMap data is rendered correctly;
Has anyone experienced similar issues with OpenSeaMap?