com.bbn.openmap.dataAccess.mapTile
Class ZoomLevelInfo
java.lang.Object
com.bbn.openmap.MapHandlerChild
com.bbn.openmap.OMComponent
com.bbn.openmap.dataAccess.mapTile.ZoomLevelInfo
- All Implemented Interfaces:
- LightMapHandlerChild, PropertyConsumer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener
- Direct Known Subclasses:
- ZoomLevelMaker
public class ZoomLevelInfo
- extends OMComponent
The ZoomLevelInfo class is used by the TileMaker and handles how tiles are
defined and created for a particular zoom level. It handles any bounds
restrictions, what layers should be rendered at this zoom level, and the path
to the tiles from the root directory. The properties for this component are:
#Needed for property file creation of TileMaker
zoomMarker.class=com.bbn.openmap.image.ZoomLevelInfo
#Optional, to limit tile areas created, in sets of 4
zoomMarker.bounds=lat lon lat lon lat lon lat lon
zoomMarker.description=Tiles for zoom level 4
#Marker names for layers to be rendered, the property prefixes for the layers held by TileMaker
zoomMarker.layers=lakes shape
zoomMarker.name=ZoomLayerInfo 4
zoomMarker.zoomLevel=4
Note that the zoomMarker keyword should be stored in the TileMaker zoomLevels
property list.
- Author:
- dietrick
|
Method Summary |
java.lang.String |
formatImageFilePath(java.lang.String rootDir,
int uvx,
int uvy)
Creates file path given a root directory plus current zoom level, x, and
y. |
java.lang.String |
formatParentDirectoryName(java.lang.String rootDir,
int uvx,
int uvy)
Creates the parent directory of the file with the current zoom level set
in the ZoomLevelInfo. |
int |
getEdgeTileCount()
|
java.awt.geom.Rectangle2D |
getUVBounds(java.awt.geom.Rectangle2D bounds,
MapTileCoordinateTransform mtct,
int zoomLevel)
Given a bounds containing a lat/lon box (x, y, w, h in decimal degrees)
and a transform for the MapTileCoordinates being used for the tiles
(OpenStreetMap or Google (MTS)), provide the UV tile coordinates for the
the bounding box. |
int |
getZoomLevel()
|
void |
setZoomLevel(int zoomLevel)
|
| Methods inherited from class com.bbn.openmap.MapHandlerChild |
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
zoomLevel
protected int zoomLevel
ZoomLevelInfo
public ZoomLevelInfo()
- Default constructor.
getZoomLevel
public int getZoomLevel()
- Returns:
- the current zoom level.
setZoomLevel
public void setZoomLevel(int zoomLevel)
- Parameters:
zoomLevel - the current zoom level.
getEdgeTileCount
public int getEdgeTileCount()
- Returns:
- the number of tiles across or down for the current zoom level.
getUVBounds
public java.awt.geom.Rectangle2D getUVBounds(java.awt.geom.Rectangle2D bounds,
MapTileCoordinateTransform mtct,
int zoomLevel)
- Given a bounds containing a lat/lon box (x, y, w, h in decimal degrees)
and a transform for the MapTileCoordinates being used for the tiles
(OpenStreetMap or Google (MTS)), provide the UV tile coordinates for the
the bounding box.
- Parameters:
bounds - decimal degree boundsmtct - MapTileCoordinateTransform (OSMMapTileCoordinateTransform or
TMSMapTileCoordinateTransform).
- Returns:
- UV tile coordinates for bounds.
formatParentDirectoryName
public java.lang.String formatParentDirectoryName(java.lang.String rootDir,
int uvx,
int uvy)
- Creates the parent directory of the file with the current zoom level set
in the ZoomLevelInfo.
- Parameters:
rootDir - path to root of dir structire, with no file separator at
the end.uvx - uv x coordinate of map tile.uvy - uv y coordinate of map tile.
- Returns:
- path of parent directory of the file (no y coordinate).
formatImageFilePath
public java.lang.String formatImageFilePath(java.lang.String rootDir,
int uvx,
int uvy)
- Creates file path given a root directory plus current zoom level, x, and
y. Ready for file extension, which should have a period on it.
- Parameters:
rootDir - path to root of dir structure, with no file separator at
the end.uvx - uv x coordinate of the map tile.uvy - uv y coordinate of the map tile
- Returns:
- a file path, sans file extension.
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details