public Coordinate viewToWorld(Coordinate coordinate) {
		if (coordinate != null) {
			Vector2D position = new Vector2D(coordinate);
			double inverseScale = 1 / mapView.getCurrentScale();
			position.scale(inverseScale, -inverseScale);

			Bbox bounds = mapView.getBounds();
			// -cam: center X axis around cam. +bbox.w/2: to place the origin in the center of the screen
			double translateX = -mapView.getViewState().getX() + (bounds.getWidth() / 2);
			double translateY = -mapView.getViewState().getY() - (bounds.getHeight() / 2); // Inverted Y-axis here...
			position.translate(-translateX, -translateY);
			// TODO: implement rotation support.
			return new Coordinate(position.getX(), position.getY());
		}
		return null;
	}
public Coordinate viewToWorld ( Coordinate coordinate ) { if ( coordinate != null ) { Vector2D position = new Vector2D ( coordinate ) ; double inverseScale = 1 / mapView . getCurrentScale ( ) ; position . scale ( inverseScale , - inverseScale ) ; Bbox bounds = mapView . getBounds ( ) ; double translateX = - mapView . getViewState ( ) . getX ( ) + ( bounds . getWidth ( ) / 2 ) ; double translateY = - mapView . getViewState ( ) . getY ( ) - ( bounds . getHeight ( ) / 2 ) ; position . translate ( - translateX , - translateY ) ; return new Coordinate ( position . getX ( ) , position . getY ( ) ) ; } return null ; }
Transform a coordinate from view space to world space.

@param coordinate
The views pace coordinate.
@return Returns the world space equivalent of the given coordinate.