title: Integrating OpenSeaMap into Android application
body: <p>I successfully integrated OpenStreetMap into my Android application using <a href="https://code.google.com/p/osmdroid/" rel="nofollow noreferrer">osmdroid</a> and decided to try my hand at using <a href="http://wiki.openseamap.org/wiki/OpenSeaMap_in_Website" rel="nofollow noreferrer">OpenSeaMap</a> as the map tile provider (the application is ocean-focussed).</p>
  
  <p>Following the instructions outlined <a href="https://code.google.com/p/osmdroid/wiki/HowToIncludeInYourProject#Creating_a_tile_provider_chain" rel="nofollow noreferrer">here</a> for incorporating a custom tile provider into <em>osmdroid</em> I added the following code:</p>
  
  <pre><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);
  </code></pre>
  
  <p>...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.</p>
  
  <p><img src="https://i.stack.imgur.com/kcL0g.png" alt="Black tiles where OpenSeaMap is adding content"></p>
  
  <p>As I continue to experiment, I noticed that sometimes, the OpenSeaMap data is rendered correctly;</p>
  
  <p><img src="https://i.stack.imgur.com/lyd3H.png" alt="Kind of working OpenSeaMap"></p>
  
  <p>Has anyone experienced similar issues with OpenSeaMap?</p>