Class TileServer

  • Direct Known Subclasses:
    GoogleTileServer, OsmTileServer

    public class TileServer
    extends URLService
    This class encapsulates a tileserver, which has the concept of a baseurl and a maximum zoom level.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int maxZoom  
      private java.lang.String urlFormat  
    • Constructor Summary

      Constructors 
      Constructor Description
      TileServer​(java.lang.String url, int maxZoom)
      Initializes a TileServer using the default slippy format
      TileServer​(java.lang.String url, int maxZoom, java.lang.String urlFormat)
      Initializes a TileServer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Map<java.lang.String,​java.lang.String> createZXYMap​(TileRef tile, java.lang.String zKey, java.lang.String xKey, java.lang.String yKey)  
      int getMaxZoom()
      Gets the max zoom level supported by this TileServer
      java.lang.String getTileURL​(TileRef tile)  
      protected java.lang.String getTileURL​(TileRef tile, java.lang.String urlFormat, java.lang.Object[] formatArguments)  
      protected java.lang.String getTileURL​(TileRef tile, java.lang.String urlFormat, java.util.Map<java.lang.String,​java.lang.String> formatMap)  
      protected java.lang.Object[] getURLFormatArguments​(java.lang.Object ref)  
      protected java.util.Map<java.lang.String,​java.lang.String> getURLFormatMap​(TileRef tile)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • urlFormat

        private java.lang.String urlFormat
      • maxZoom

        private final int maxZoom
    • Constructor Detail

      • TileServer

        public TileServer​(java.lang.String url,
                          int maxZoom,
                          java.lang.String urlFormat)
        Initializes a TileServer
        Parameters:
        url - the base url of the TileServer
        maxZoom - the max zoom level supported by this TileServer
        urlFormat - the format of the url parameters that are appended to the base url
      • TileServer

        public TileServer​(java.lang.String url,
                          int maxZoom)
        Initializes a TileServer using the default slippy format
        Parameters:
        url - the base url of the TileServer
        maxZoom - the max zoom level supported by this TileServer
    • Method Detail

      • getURLFormatArguments

        protected java.lang.Object[] getURLFormatArguments​(java.lang.Object ref)
        Specified by:
        getURLFormatArguments in class URLService
      • createZXYMap

        protected java.util.Map<java.lang.String,​java.lang.String> createZXYMap​(TileRef tile,
                                                                                      java.lang.String zKey,
                                                                                      java.lang.String xKey,
                                                                                      java.lang.String yKey)
      • getURLFormatMap

        protected java.util.Map<java.lang.String,​java.lang.String> getURLFormatMap​(TileRef tile)
      • getTileURL

        protected java.lang.String getTileURL​(TileRef tile,
                                              java.lang.String urlFormat,
                                              java.lang.Object[] formatArguments)
      • getTileURL

        protected java.lang.String getTileURL​(TileRef tile,
                                              java.lang.String urlFormat,
                                              java.util.Map<java.lang.String,​java.lang.String> formatMap)
      • getTileURL

        public java.lang.String getTileURL​(TileRef tile)
      • getMaxZoom

        public int getMaxZoom()
        Gets the max zoom level supported by this TileServer
        Returns:
        the max zoom level