Groovy Documentation

org.jdesktop.swingx.mapviewer
[Java] Class TileFactoryInfo

java.lang.Object
  org.jdesktop.swingx.mapviewer.TileFactoryInfo

public class TileFactoryInfo
extends 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. Currently

Authors:
joshy


Field Summary
protected String baseURL

The base url for loading tiles from.

private int defaultZoomLevel

private double[] longitudeDegreeWidthInPixels

An array of doubles that contain the number of pixels per degree of longitude at a give zoom level.

private double[] longitudeRadianWidthInPixels

An array of doubles that contain the number of radians per degree of longitude at a given zoom level (where longitudeRadianWidthInPixels[0] is the most zoomed out)

private Point2D[] mapCenterInPixelsAtZoom

An array of coordinates in pixels that indicates the center in the world map for the given zoom level.

private int[] mapWidthInTilesAtZoom

private int maximumZoomLevel

private int minimumZoomLevel

private String name

private int tileSize

private int totalMapZoom

private String xparam

private boolean xr2l

private String yparam

private boolean yt2b

private String zparam

 
Constructor Summary
TileFactoryInfo(int minimumZoomLevel, int maximumZoomLevel, int totalMapZoom, int tileSize, boolean xr2l, boolean yt2b, String baseURL, String xparam, String yparam, String zparam)

Creates a new instance of TileFactoryInfo.

TileFactoryInfo(String name, int minimumZoomLevel, int maximumZoomLevel, int totalMapZoom, int tileSize, boolean xr2l, boolean yt2b, String baseURL, String xparam, String yparam, String zparam)

Creates a new instance of TileFactoryInfo.

 
Method Summary
int getDefaultZoomLevel()

double getLongitudeDegreeWidthInPixels(int zoom)

A property indicating if the X coordinates of tiles go from right to left or left to right.

double getLongitudeRadianWidthInPixels(int zoom)

A property indicating if the X coordinates of tiles go from right to left or left to right.

Point2D getMapCenterInPixelsAtZoom(int zoom)

int getMapWidthInTilesAtZoom(int zoom)

@return

Parameters:
zoom

int getMaximumZoomLevel()

@return

int getMinimumZoomLevel()

@return

String getName()

int getTileSize(int zoom)

Get the tile size.

String getTileUrl(int x, int y, int zoom)

int getTotalMapZoom()

@return

Parameters:
zoom

boolean isXr2l()

A property indicating if the Y coordinates of tiles go from right to left or left to right.

boolean isYt2b()

void setDefaultZoomLevel(int defaultZoomLevel)

void setXr2l(boolean xr2l)

A property indicating if the Y coordinates of tiles go from right to left or left to right.

void setYt2b(boolean yt2b)

The name of this info.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

baseURL

protected String baseURL
The base url for loading tiles from.


defaultZoomLevel

private int defaultZoomLevel


longitudeDegreeWidthInPixels

private double[] longitudeDegreeWidthInPixels
An array of doubles that contain the number of pixels per degree of longitude at a give zoom level.


longitudeRadianWidthInPixels

private double[] longitudeRadianWidthInPixels
An array of doubles that contain the number of radians per degree of longitude at a given zoom level (where longitudeRadianWidthInPixels[0] is the most zoomed out)


mapCenterInPixelsAtZoom

private Point2D[] mapCenterInPixelsAtZoom
An array of coordinates in pixels that indicates the center in the world map for the given zoom level.


mapWidthInTilesAtZoom

private int[] mapWidthInTilesAtZoom


maximumZoomLevel

private int maximumZoomLevel


minimumZoomLevel

private int minimumZoomLevel


name

private String name


tileSize

private int tileSize


totalMapZoom

private int totalMapZoom


xparam

private String xparam


xr2l

private boolean xr2l


yparam

private String yparam


yt2b

private boolean yt2b


zparam

private String zparam


 
Constructor Detail

TileFactoryInfo

public TileFactoryInfo(int minimumZoomLevel, int maximumZoomLevel, int totalMapZoom, int tileSize, boolean xr2l, boolean yt2b, String baseURL, String xparam, String yparam, String zparam)
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
totalMapZoom - the top zoom level, essentially the height of the pyramid
tileSize - the size of the tiles in pixels (must be square)
xr2l - if the x goes r to l (is this backwards?)
yt2b - if the y goes top to bottom
baseURL - the base url for grabbing tiles
xparam - the x parameter for the tile url
yparam - the y parameter for the tile url
zparam - the z parameter for the tile url


TileFactoryInfo

public TileFactoryInfo(String name, int minimumZoomLevel, int maximumZoomLevel, int totalMapZoom, int tileSize, boolean xr2l, boolean yt2b, String baseURL, String xparam, String yparam, String zparam)
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:
name - A name to identify this information.
minimumZoomLevel - The minimum zoom level
maximumZoomLevel - the maximum zoom level
totalMapZoom - the top zoom level, essentially the height of the pyramid
tileSize - the size of the tiles in pixels (must be square)
xr2l - if the x goes r to l (is this backwards?)
yt2b - if the y goes top to bottom
baseURL - the base url for grabbing tiles
xparam - the x parameter for the tile url
yparam - the y parameter for the tile url
zparam - the z parameter for the tile url


 
Method Detail

getDefaultZoomLevel

public int getDefaultZoomLevel()


getLongitudeDegreeWidthInPixels

public double getLongitudeDegreeWidthInPixels(int zoom)
A property indicating if the X coordinates of tiles go from right to left or left to right.
Returns:


getLongitudeRadianWidthInPixels

public double getLongitudeRadianWidthInPixels(int zoom)
A property indicating if the X coordinates of tiles go from right to left or left to right.
Parameters:
xr2l


getMapCenterInPixelsAtZoom

public Point2D getMapCenterInPixelsAtZoom(int zoom)


getMapWidthInTilesAtZoom

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


getMaximumZoomLevel

public int getMaximumZoomLevel()
Returns:


getMinimumZoomLevel

public int getMinimumZoomLevel()
Returns:


getName

public String getName()


getTileSize

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


getTileUrl

public String getTileUrl(int x, int y, int zoom)


getTotalMapZoom

public int getTotalMapZoom()
Parameters:
zoom
Returns:


isXr2l

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


isYt2b

public boolean isYt2b()


setDefaultZoomLevel

public void setDefaultZoomLevel(int defaultZoomLevel)


setXr2l

public void setXr2l(boolean xr2l)
A property indicating if the Y coordinates of tiles go from right to left or left to right.
Parameters:
yt2b


setYt2b

public void setYt2b(boolean yt2b)
The name of this info.
Returns:
Returns the name of this info class for debugging or GUI widgets.


 

Groovy Documentation