org.epseelon.mobimap.tiles
Class TileFactoryInfo

java.lang.Object
  extended by org.epseelon.mobimap.tiles.TileFactoryInfo

public class TileFactoryInfo
extends java.lang.Object

A TileFactoryInfo encapsulates all information specific to a map server. This includes everything from the url to load the map tiles from to the size and depth of the tiles. Theoretically any map server can be used by installing a customized TileFactoryInfo.

Author:
sarbogast

Constructor Summary
TileFactoryInfo(java.lang.String provider, java.lang.String mode, int minimumZoomLevel, int maximumZoomLevel, int tileSize, boolean zeroTileAbscissaLeft, boolean zeroTileOrdinateTop, java.lang.String baseUrl, java.lang.String urlSuffix)
          Creates a new instance of TileFactoryInfo.
 
Method Summary
 java.lang.String getBaseUrl()
           
 int getDefaultZoomLevel()
           
 double getLongitudeDegreeWidthInPixels(int zoom)
           
 double getLongitudeRadianWidthInPixels(int zoom)
           
 Point2D getMapCenterInPixelsAtZoom(int zoom)
           
 int getMapWidthInTilesAtZoom(int zoom)
           
 int getMaximumZoomLevel()
           
 int getMinimumZoomLevel()
           
 java.lang.String getMode()
           
 int getNumberOfZoomLevels()
           
 java.lang.String getProvider()
           
 int getTileSize(int zoom)
          Get the tile size.
 java.lang.String getUrlSuffix()
           
 boolean isZeroTileAbscissaLeft()
          A property indicating if the X coordinates of tiles go from right to left or left to right.
 boolean isZeroTileOrdinateTop()
          A property indicating if the Y coordinates of tiles go from right to left or left to right.
 void setBaseUrl(java.lang.String baseUrl)
           
 void setDefaultZoomLevel(int defaultZoomLevel)
           
 void setUrlSuffix(java.lang.String urlSuffix)
           
 void setZeroTileAbscissaLeft(boolean zeroTileAbscissaLeft)
          A property indicating if the X coordinates of tiles go from right to left or left to right.
 void setZeroTileOrdinateTop(boolean zeroTileOrdinateTop)
          A property indicating if the Y coordinates of tiles go from right to left or left to right.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileFactoryInfo

public TileFactoryInfo(java.lang.String provider,
                       java.lang.String mode,
                       int minimumZoomLevel,
                       int maximumZoomLevel,
                       int tileSize,
                       boolean zeroTileAbscissaLeft,
                       boolean zeroTileOrdinateTop,
                       java.lang.String baseUrl,
                       java.lang.String urlSuffix)
Creates a new instance of TileFactoryInfo. Note that TileFactoryInfo should be considered invariate, meaning that subclasses should ensure all of the properties stay the same after the class is constructed. Returning different values of getTileSize() for example is considered an error and may result in unexpected behavior.

Parameters:
minimumZoomLevel - The minimum zoom level
maximumZoomLevel - the maximum zoom level
tileSize - the size of the tiles in pixels (must be square)
zeroTileAbscissaLeft - true if tile x is measured from the far left of the map to the far right, or else false if based on the center line.
zeroTileOrdinateTop - true if tile y is measured from the top (north pole) to the bottom (south pole) or else false if based on the equator.
baseUrl - the base url for grabbing tiles
Method Detail

getMinimumZoomLevel

public int getMinimumZoomLevel()
Returns:

getMaximumZoomLevel

public int getMaximumZoomLevel()
Returns:

getMapWidthInTilesAtZoom

public int getMapWidthInTilesAtZoom(int zoom)
Parameters:
zoom -
Returns:

getMapCenterInPixelsAtZoom

public Point2D getMapCenterInPixelsAtZoom(int zoom)
Parameters:
zoom -
Returns:

getTileSize

public int getTileSize(int zoom)
Get the tile size.

Returns:
the tile size

getLongitudeDegreeWidthInPixels

public double getLongitudeDegreeWidthInPixels(int zoom)
Parameters:
zoom -
Returns:

getLongitudeRadianWidthInPixels

public double getLongitudeRadianWidthInPixels(int zoom)
Parameters:
zoom -
Returns:

isZeroTileAbscissaLeft

public boolean isZeroTileAbscissaLeft()
A property indicating if the X coordinates of tiles go from right to left or left to right.

Returns:

setZeroTileAbscissaLeft

public void setZeroTileAbscissaLeft(boolean zeroTileAbscissaLeft)
A property indicating if the X coordinates of tiles go from right to left or left to right.

Parameters:
zeroTileAbscissaLeft -

isZeroTileOrdinateTop

public boolean isZeroTileOrdinateTop()
A property indicating if the Y coordinates of tiles go from right to left or left to right.

Returns:

setZeroTileOrdinateTop

public void setZeroTileOrdinateTop(boolean zeroTileOrdinateTop)
A property indicating if the Y coordinates of tiles go from right to left or left to right.

Parameters:
zeroTileOrdinateTop -

getDefaultZoomLevel

public int getDefaultZoomLevel()

setDefaultZoomLevel

public void setDefaultZoomLevel(int defaultZoomLevel)

getProvider

public java.lang.String getProvider()
Returns:
The name of the provider for tiles

getMode

public java.lang.String getMode()
Returns:
The type of tiles (map, satellite, etc.)

getBaseUrl

public java.lang.String getBaseUrl()

setBaseUrl

public void setBaseUrl(java.lang.String baseUrl)

getUrlSuffix

public java.lang.String getUrlSuffix()

setUrlSuffix

public void setUrlSuffix(java.lang.String urlSuffix)

getNumberOfZoomLevels

public int getNumberOfZoomLevels()


Copyright © 2008 Epseelon. All Rights Reserved.