private void addViewportModelListener() {
viewportListener = new IViewportModelListener(){
public void changed( ViewportModelEvent event ) {
if (event.getType() == EventType.CRS){
//need to update the overview map crs
CoordinateReferenceSystem newcrs = (CoordinateReferenceSystem)event.getNewValue();
mapviewer.getMap().getViewportModelInternal().setCRS(newcrs);
}else if (event.getType() == EventType.BOUNDS){
//bounds have changed change the overview box correspondingly
if (!mainmap.getViewportModel().isBoundsChanging()) {
ReferencedEnvelope bnds = findNewOverviewZoom(mainmap.getViewportModel().getBounds(), mainmap.getRenderManager().getMapDisplay(), mapviewer.getMap().getViewportModel().getBounds());