public class SteplessMapWindow extends Objectimplements MapWindow
| Constructor and Description |
|---|
SteplessMapWindow(BBox
|
SteplessMapWindow(int width, int height, double zoom, double lon, double lat)
|
SteplessMapWindow(int width, int height, double zoom, int px, int py)
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(MapWindowChangeListener
Add the given listener to the set of general change listeners.
|
void |
addWorldScaleListener(MapWindowWorldScaleListener
Add the given listener to the set of tile size change listeners.
|
void |
addZoomListener(ZoomChangedListener
Add the given listener to the set of zoom change listeners.
|
boolean |
containsPoint(OverlayPoint
Test whether this point is within this window.
|
BBox |
getBoundingBox()
Get the covered area as a bounding box.
|
double |
getCenterLat()
|
double |
getCenterLon()
|
double |
getCenterX()
Get the window's center's tile coordinate.
|
double |
getCenterY()
Get the window's center's tile coordinate.
|
int |
getHeight()
|
int |
getMaxZoom()
|
int |
getMinZoom()
|
double |
getPositionLat(int y)
Get the latitude of the given y in view space.
|
double |
getPositionLon(int x)
Get the longitude of the given x in view space.
|
double |
getPositionX(int px)
Get the tile coordinate at the given x in view space.
|
double |
getPositionY(int py)
Get the tile coordinate at the given y in view space.
|
int |
getWidth()
|
int |
getWorldScale()
|
double |
getWorldsizePixels()
|
double |
getX(double x)
|
double |
getY(double y)
|
double |
getZoom()
|
void |
gotoLonLat(double longitude, double latitude)
Center the map on this position.
|
void |
gotoLonLat(double lon1, double lon2, double lat1, double lat2)
|
void |
gotoPoints(Collection
Move the viewport to show all points.
|
double |
latitudeToY(double ilat)
Calculate the current y position of the given latitude.
|
double |
longitudeToX(double ilon)
Calculate the current x position of the given longitude.
|
double |
mercatorToX(double mx)
Calculate the current x position of the given mercator x.
|
double |
mercatorToY(double my)
Calculate the current y position of the given mercator y.
|
void |
move(int dx, int dy)
Reposition the map window with the given values.
|
void |
resize(int newWidth, int newHeight)
Adjust the size of the window.
|
void |
setMaxZoom(int zoomMax)
Set the maximum allowed zoomlevel.
|
void |
setMinZoom(int zoomMin)
Set the minimum allowed zoomlevel.
|
void |
setViewBounds(ViewBounds
|
boolean |
setWorldScale(int worldScale)
Set the scale factor of the map that determines how big the image of the world is.
|
boolean |
zoom(double zoomlevel)
zoom in to the denoted zoomlevel if possible.
|
boolean |
zoom(int zoomlevel)
zoom in to the denoted zoomlevel if possible.
|
boolean |
zoomIn()
zoom in to center if possible.
|
boolean |
zoomIn(double d)
zoom in to center if possible.
|
void |
zoomInToPosition(int x, int y)
|
void |
zoomInToPosition(int x, int y, double d)
|
boolean |
zoomOut()
zoom out from center if possible.
|
boolean |
zoomOut(double d)
zoom out from center if possible.
|
void |
zoomOutToPosition(int x, int y)
|
void |
zoomOutToPosition(int x, int y, double d)
|
public SteplessMapWindow(int width,
int height,
double zoom,
int px,
int py)
width - the window's width.
height - the window's height.
zoom - the zoom level.
px - the x coordinate.
py - the y coordinate.
public SteplessMapWindow(int width,
int height,
double zoom,
double lon,
double lat)
width - the window's width.
height - the window's height.
zoom - the zoom level.
lon - the center longitude.
lat - the center latitude.
public SteplessMapWindow(BBoxbbox, double zoom)
bbox - a bounding box to cover.
zoom - the zoomlevel to use.
public void setViewBounds(ViewBoundsbounds)
public double getCenterX()
public double getCenterY()
public double getCenterLon()
getCenterLon in interface
MapWindow
public double getCenterLat()
getCenterLat in interface
MapWindow
public double getPositionX(int px)
px - the position in view space.
public double getPositionY(int py)
py - the position in view space.
public double getPositionLon(int x)
getPositionLon in interface
MapWindow
x - the position in view space.
public double getPositionLat(int y)
getPositionLat in interface
MapWindow
y - the position in view space.
public BBoxgetBoundingBox()
getBoundingBox in interface
MapWindow
public double getZoom()
public int getWidth()
public int getHeight()
public void resize(int newWidth,
int newHeight)
public void move(int dx,
int dy)
public void setMaxZoom(int zoomMax)
setMaxZoom in interface
MapWindow
zoomMax - the maximum zoomlevel to allow
public void setMinZoom(int zoomMin)
setMinZoom in interface
MapWindow
zoomMin - the minimum zoomlevel to allow
public int getMaxZoom()
getMaxZoom in interface
MapWindow
public int getMinZoom()
getMinZoom in interface
MapWindow
public boolean zoomIn(double d)
public boolean zoomOut(double d)
public boolean zoom(double zoomlevel)
zoomlevel - the new zoomlevel to set.
public void zoomInToPosition(int x,
int y,
double d)public void zoomOutToPosition(int x,
int y,
double d)public void addChangeListener(MapWindowChangeListenerlistener)
addChangeListener in interface
MapWindow
listener - the listener to add.
public void addZoomListener(ZoomChangedListenerlistener)
addZoomListener in interface
MapWindow
listener - the listener to add.
public void addWorldScaleListener(MapWindowWorldScaleListenerlistener)
addWorldScaleListener in interface
MapWindow
listener - the listener to add.
public double longitudeToX(double ilon)
longitudeToX in interface
MapWindow
ilon - the longitude.
public double latitudeToY(double ilat)
latitudeToY in interface
MapWindow
ilat - the latitude.
public double mercatorToX(double mx)
mercatorToX in interface
MapWindow
mx - the mercator value in the window's zoom level dimension.
public double mercatorToY(double my)
mercatorToY in interface
MapWindow
my - the mercator value in the window's zoom level dimension.
public void gotoLonLat(double longitude,
double latitude)
gotoLonLat in interface
MapWindow
longitude - the longitude.
latitude - the latitude.
public void gotoPoints(Collection<OverlayPoint > points)
gotoPoints in interface
MapWindow
points - the points to show
public void gotoLonLat(double lon1,
double lon2,
double lat1,
double lat2)
gotoLonLat in interface
MapWindow
lon1 - minimum longitude.
lon2 - maximum longitude.
lat1 - minimum latitude.
lat2 - maximum latitude.
public boolean containsPoint(OverlayPointpoint)
containsPoint in interface
MapWindow
point - the point to test for.
public double getX(double x)
public double getY(double y)
public boolean setWorldScale(int worldScale)
MapWindow
setWorldScale in interface
MapWindow
worldScale - the factor by which to multiply the worldsize.
public int getWorldScale()
getWorldScale in interface
MapWindow
public boolean zoomIn()
MapWindow
public boolean zoomOut()
MapWindow
public boolean zoom(int zoomlevel)
MapWindow
public void zoomInToPosition(int x,
int y)public void zoomOutToPosition(int x,
int y)public double getWorldsizePixels()
getWorldsizePixels in interface
MapWindow