code: public GeoPosition convertPointToGeoPosition(Point2D pt)
      {
          // convert from local to world bitmap
          Rectangle bounds = getViewportBounds();
          Point2D pt2 = new Point2D.Double(pt.getX() + bounds.getX(), pt.getY() + bounds.getY());
  
          // convert from world bitmap to geo
          GeoPosition pos = getTileFactory().pixelToGeo(pt2, getZoom());
          return pos;
      }
docs: Converts the specified Point2D in the JXMapViewer's local coordinate space to a GeoPosition on the map. This
  method is especially useful for determining the GeoPosition under the mouse cursor.
  @param pt a point in the local coordinate space of the map
  @return the point converted to a GeoPosition