Class OpenStreetMapMapnik

  • All Implemented Interfaces:
    TileSource

    public class OpenStreetMapMapnik
    extends AbstractTileSource
    A tile source which fetches standard Mapnik tiles from OpenStreetMap.

    Layers using this tile source will enforce a time-to-live (TTL) of 8,279,000 milliseconds for cached tiles (unless the application explicitly sets a different TTL for that layer). The default TTL corresponds to the lifetime which the OSM server sets on a newly rendered tile.

    Refer to TileDownloadLayer for details on the TTL mechanism.

    Requires a valid HTTP User-Agent identifying application: https://operations.osmfoundation.org/policies/tiles/

    • Constructor Detail

      • OpenStreetMapMapnik

        public OpenStreetMapMapnik​(java.lang.String[] hostNames,
                                   int port)
    • Method Detail

      • getParallelRequestsLimit

        public int getParallelRequestsLimit()
        Returns:
        the maximum number of parallel requests which this TileSource supports.
      • getTileUrl

        public java.net.URL getTileUrl​(org.mapsforge.core.model.Tile tile)
                                throws java.net.MalformedURLException
        Returns:
        the download URL for the given Tile.
        Throws:
        java.net.MalformedURLException
      • getZoomLevelMax

        public byte getZoomLevelMax()
        Returns:
        the maximum zoom level which this TileSource supports.
      • getZoomLevelMin

        public byte getZoomLevelMin()
        Returns:
        the minimum zoom level which this TileSource supports.
      • hasAlpha

        public boolean hasAlpha()
        Returns:
        the if the TileSource supports transparent images.