public interface MapWindow extends CoordinateTransformer
| 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 world scale 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()
|
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.
|
int |
getWidth()
|
int |
getWorldScale()
|
double |
getWorldsizePixels()
|
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.
|
boolean |
setWorldScale(int worldScale)
Set the scale factor of the map that determines how big the image of the world is.
|
boolean |
zoom(int zoomlevel)
zoom in to the denoted zoomlevel if possible.
|
boolean |
zoomIn()
zoom in to center if possible.
|
void |
zoomInToPosition(int x, int y)
|
boolean |
zoomOut()
zoom out from center if possible.
|
void |
zoomOutToPosition(int x, int y)
|
getX, getYboolean setWorldScale(int worldScale)
worldScale - the factor by which to multiply the worldsize.
int getWorldScale()
double getWorldsizePixels()
double getCenterLon()
double getCenterLat()
double getZoom()
double getPositionLon(int x)
x - the position in view space.
double getPositionLat(int y)
y - the position in view space.
BBoxgetBoundingBox()
int getWidth()
int getHeight()
void resize(int newWidth,
int newHeight)
newWidth - the new width value.
newHeight - the new height value.
void move(int dx,
int dy)
dx - the amount of pixels to move to the left.
dy - the amount of pixels to move to the top.
void setMaxZoom(int zoomMax)
zoomMax - the maximum zoomlevel to allow
void setMinZoom(int zoomMin)
zoomMin - the minimum zoomlevel to allow
int getMaxZoom()
int getMinZoom()
boolean zoomIn()
boolean zoomOut()
boolean zoom(int zoomlevel)
zoomlevel - the new zoomlevel to set.
void zoomInToPosition(int x,
int y)void zoomOutToPosition(int x,
int y)void addChangeListener(MapWindowChangeListenerlistener)
listener - the listener to add.
void addZoomListener(ZoomChangedListenerlistener)
listener - the listener to add.
void addWorldScaleListener(MapWindowWorldScaleListenerlistener)
listener - the listener to add.
double longitudeToX(double ilon)
ilon - the longitude.
double latitudeToY(double ilat)
ilat - the latitude.
double mercatorToX(double mx)
mx - the mercator value in the window's zoom level dimension.
double mercatorToY(double my)
my - the mercator value in the window's zoom level dimension.
void gotoLonLat(double longitude,
double latitude)
longitude - the longitude.
latitude - the latitude.
void gotoPoints(Collection<OverlayPoint > points)
points - the points to show
void gotoLonLat(double lon1,
double lon2,
double lat1,
double lat2)
lon1 - minimum longitude.
lon2 - maximum longitude.
lat1 - minimum latitude.
lat2 - maximum latitude.
boolean containsPoint(OverlayPointpoint)
point - the point to test for.