private Bbox screenToWorld(Bbox bbox) { if (bbox != null) { Coordinate c1 = screenToWorld(BboxService.getOrigin(bbox)); Coordinate c2 = screenToWorld(BboxService.getEndPoint(bbox)); double x = (c1.getX() < c2.getX()) ? c1.getX() : c2.getX(); double y = (c1.getY() < c2.getY()) ? c1.getY() : c2.getY(); return new Bbox(x, y, Math.abs(c1.getX() - c2.getX()), Math.abs(c1.getY() - c2.getY())); } return null; } }
private Bbox screenToWorld(Bbox bbox) { if (bbox != null) { Coordinate c1 = screenToWorld(BboxService.getOrigin(bbox)); Coordinate c2 = screenToWorld(BboxService.getEndPoint(bbox)); double x = (c1.getX() < c2.getX()) ? c1.getX() : c2.getX(); double y = (c1.getY() < c2.getY()) ? c1.getY() : c2.getY(); return new Bbox(x, y, Math.abs(c1.getX() - c2.getX()), Math.abs(c1.getY() - c2.getY())); } return null; } }
private Bbox worldToScreen(Bbox bbox) { if (bbox != null) { Coordinate c1 = worldToScreen(BboxService.getOrigin(bbox)); Coordinate c2 = worldToScreen(BboxService.getEndPoint(bbox)); double x = (c1.getX() < c2.getX()) ? c1.getX() : c2.getX(); double y = (c1.getY() < c2.getY()) ? c1.getY() : c2.getY(); return new Bbox(x, y, Math.abs(c1.getX() - c2.getX()), Math.abs(c1.getY() - c2.getY())); } return null; }
private Bbox worldToScreen(Bbox bbox) { if (bbox != null) { Coordinate c1 = worldToScreen(BboxService.getOrigin(bbox)); Coordinate c2 = worldToScreen(BboxService.getEndPoint(bbox)); double x = (c1.getX() < c2.getX()) ? c1.getX() : c2.getX(); double y = (c1.getY() < c2.getY()) ? c1.getY() : c2.getY(); return new Bbox(x, y, Math.abs(c1.getX() - c2.getX()), Math.abs(c1.getY() - c2.getY())); } return null; }
double w = mapWidth * newResolution / 2; double h = mapHeight * newResolution / 2; Coordinate minCoordinate = BboxService.getOrigin(maxBounds); Coordinate maxCoordinate = BboxService.getEndPoint(maxBounds);
double w = mapWidth / (newScale * 2); double h = mapHeight / (newScale * 2); Coordinate minCoordinate = BboxService.getOrigin(maxBounds); Coordinate maxCoordinate = BboxService.getEndPoint(maxBounds);