pane: fitting objects

I am using the Panel’s Pane. In, there is a possibility to create a custom Viewport object using the function fitBounds, to fit a number of points:

setState( newViewport = currentViewport.fitBounds([[lat1,lng1],[lat2,lng2]])

How could I get access to this function (fitBounds of the viewport object) in Panel. I need to ensure that several points selected by the user are visible in the map.