Package org.openstreetmap.josm.data
Class ViewportData
java.lang.Object
org.openstreetmap.josm.data.ViewportData
Data class to keep viewport information.
This can be either a combination of map center and map scale or
a rectangle in east-north coordinate space.
Either of those will be null, so the consumer of the ViewportData
object has to check, which one is set.
- Since:
- 5670 (creation), 6992 (extraction in this package)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionViewportData(EastNorth center, Double scale) Constructs a newViewportData.ViewportData(ProjectionBounds bounds) Create a newViewportData -
Method Summary
-
Field Details
-
center
-
scale
-
bounds
-
-
Constructor Details
-
ViewportData
Constructs a newViewportData.- Parameters:
center- Projected coordinates of the map centerscale- Scale factor in east-/north-units per pixel
-
ViewportData
Create a newViewportData- Parameters:
bounds- The bounds to zoom to
-
-
Method Details
-
getCenter
Return the projected coordinates of the map center- Returns:
- the center
-
getScale
Return the scale factor in east-/north-units per pixel.- Returns:
- the scale
-
getBounds
Return the bounds in east-north coordinate space.- Returns:
- the bounds
-