}
//ApplicationGIS.drawMap makes a copy of the map, and may change its bounds. If it does change
//the bounds then update the original map to match (this will force the mapgraphics to update too)
if (!getMap().getViewportModel().getBounds().equals(modifiedMap.getViewportModel().getBounds())) {
SetViewportBBoxCommand cmdBBox = new SetViewportBBoxCommand(modifiedMap.getViewportModel().getBounds());
getMap().sendCommandSync(cmdBBox);
}
//restore regular clip rectangle
graphics.setClip(0, 0, size.width, size.height);