code: private static Set<GeoPosition> getMapGeoBounds(JXMapViewer mapViewer)
      {
          Set<GeoPosition> set = new HashSet<GeoPosition>();
          TileFactory tileFactory = mapViewer.getTileFactory();
          int zoom = mapViewer.getZoom();
          Rectangle2D bounds = mapViewer.getViewportBounds();
          Point2D pt = new Point2D.Double(bounds.getX(), bounds.getY());
          set.add(tileFactory.pixelToGeo(pt, zoom));
          pt = new Point2D.Double(bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight());
          set.add(tileFactory.pixelToGeo(pt, zoom));
          return set;
      }
docs: Gets the bounds as a set of two <code>GeoPosition</code> objects.
  @param mapViewer The map viewer.
  @return Returns the set of two <code>GeoPosition</code> objects that represent the north west and south east
  corners of the map.