类 TileFactory

  • 直接已知子类:
    AbstractTileFactory, EmptyTileFactory

    public abstract class TileFactory
    extends java.lang.Object
    A class that can produce tiles and convert coordinates to pixels
    作者:
    joshy
    • 构造器概要

      构造器 
      限定符 构造器 说明
      protected TileFactory​(TileFactoryInfo info)
      Creates a new instance of TileFactory
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型 方法 说明
      java.awt.geom.Point2D geoToPixel​(GeoPosition c, int zoomLevel)
      Convert a GeoPosition to a pixel position in the world bitmap a the specified zoom level.
      TileFactoryInfo getInfo()
      Get the TileFactoryInfo describing this TileFactory
      java.awt.Dimension getMapSize​(int zoom)
      Returns a Dimension containing the width and height of the map, in tiles at the current zoom level.
      abstract Tile getTile​(int x, int y, int zoom)
      Return the Tile at a given TilePoint and zoom level
      int getTileSize​(int zoom)
      Gets the size of an edge of a tile in pixels at the current zoom level.
      abstract void load​(Tile tile)  
      GeoPosition pixelToGeo​(java.awt.geom.Point2D pixelCoordinate, int zoom)
      Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition
      protected abstract void startLoading​(Tile tile)
      Override this method to load the tile using, for example, an ExecutorService.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • TileFactory

        protected TileFactory​(TileFactoryInfo info)
        Creates a new instance of TileFactory
        参数:
        info - a TileFactoryInfo to configure this TileFactory
    • 方法详细资料

      • getTileSize

        public int getTileSize​(int zoom)
        Gets the size of an edge of a tile in pixels at the current zoom level. Tiles must be square.
        参数:
        zoom - the current zoom level
        返回:
        the size of an edge of a tile in pixels
      • getMapSize

        public java.awt.Dimension getMapSize​(int zoom)
        Returns a Dimension containing the width and height of the map, in tiles at the current zoom level. So a Dimension that returns 10x20 would be 10 tiles wide and 20 tiles tall. These values can be multipled by getTileSize() to determine the pixel width/height for the map at the given zoom level
        参数:
        zoom - the current zoom level
        返回:
        the size of the world bitmap in tiles
      • getTile

        public abstract Tile getTile​(int x,
                                     int y,
                                     int zoom)
        Return the Tile at a given TilePoint and zoom level
        参数:
        x - X index
        y - Y index
        zoom - the current zoom level
        返回:
        the tile that is located at the given tilePoint for this zoom level. For example, if getMapSize() returns 10x20 for this zoom, and the tilePoint is (3,5), then the appropriate tile will be located and returned. This method must not return null. However, it can return dummy tiles that contain no data if it wants. This is appropriate, for example, for tiles which are outside of the bounds of the map and if the factory doesn't implement wrapping.
      • load

        public abstract void load​(Tile tile)
      • pixelToGeo

        public GeoPosition pixelToGeo​(java.awt.geom.Point2D pixelCoordinate,
                                      int zoom)
        Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition
        参数:
        pixelCoordinate - a Point2D representing a pixel in the world bitmap
        zoom - the zoom level of the world bitmap
        返回:
        the converted GeoPosition
      • geoToPixel

        public java.awt.geom.Point2D geoToPixel​(GeoPosition c,
                                                int zoomLevel)
        Convert a GeoPosition to a pixel position in the world bitmap a the specified zoom level.
        参数:
        c - a GeoPosition
        zoomLevel - the zoom level to extract the pixel coordinate for
        返回:
        the pixel point
      • getInfo

        public TileFactoryInfo getInfo()
        Get the TileFactoryInfo describing this TileFactory
        返回:
        a TileFactoryInfo
      • startLoading

        protected abstract void startLoading​(Tile tile)
        Override this method to load the tile using, for example, an ExecutorService.
        参数:
        tile - The tile to load.