Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @return a Pair of two pairs with: top left corner (lat, lon), bottom right corner (lat, lon)
- */
- public Pair<Pair<Double, Double>, Pair<Double, Double>> getMapCorners() {
- GeoPoint topLeft = this.getProjection().fromPixels(0, 0);
- GeoPoint bottomRight = this.getProjection().fromPixels(getWidth(),getHeight());
- double topLeftLat = topLeft.getLatitudeE6() / 1.0E6;
- double topLeftLon = topLeft.getLongitudeE6() / 1.0E6;
- double bottomRightLat = bottomRight.getLatitudeE6() / 1.0E6;
- double bottomRightLon = bottomRight.getLongitudeE6() / 1.0E6;
- return new Pair<Pair<Double, Double>, Pair<Double, Double>>(
- new Pair<Double, Double>(topLeftLat, topLeftLon),
- new Pair<Double, Double>(bottomRightLat, bottomRightLon));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement