Control Map Zoom and Scale

In our application we are displaying the map in a widget. When multiple widgets along with the map widget is displayed and the widgets resized the map Scale values is set to NaN and the computed zoom levels is negative. The viewport changed event is raised
continuously and the map has to be reloaded. How can this problem be adressed.