public synchronized OMGraphicList prepare(){
  OMGraphicList list=new OMGraphicList();
  Projection proj=getProjection();
  if (proj == null) {
    return list;
  }
  Point2D upperLeft=proj.getUpperLeft();
  Point2D lowerRight=proj.getLowerRight();
  if (upperLeft.getX() > lowerRight.getX()) {
    getPoints(new DataBounds(upperLeft,new Point2D.Double(180,lowerRight.getY())),list,proj);
    getPoints(new DataBounds(new Point2D.Double(-180,upperLeft.getY()),lowerRight),list,proj);
  }
 else {
    getPoints(new DataBounds(upperLeft,lowerRight),list,proj);
  }
  OMText statement=new OMText(10,proj.getHeight() - 10,getName() + " displaying " + list.size()+ "/"+ dataSource.size()+ " points",OMText.JUSTIFY_LEFT);
  statement.setFillPaint(Color.gray);
  statement.generate(proj);
  list.add(0,statement);
  return list;
}

public synchronized OMGraphicList prepare ( ) { OMGraphicList list = new OMGraphicList ( ) ; Projection proj = getProjection ( ) ; if ( proj == null ) { return list ; } Point2D upperLeft = proj . getUpperLeft ( ) ; Point2D lowerRight = proj . getLowerRight ( ) ; if ( upperLeft . getX ( ) > lowerRight . getX ( ) ) { getPoints ( new DataBounds ( upperLeft , new Point2D . Double ( 180 , lowerRight . getY ( ) ) ) , list , proj ) ; getPoints ( new DataBounds ( new Point2D . Double ( - 180 , upperLeft . getY ( ) ) , lowerRight ) , list , proj ) ; } else { getPoints ( new DataBounds ( upperLeft , lowerRight ) , list , proj ) ; } OMText statement = new OMText ( 10 , proj . getHeight ( ) - 10 , getName ( ) + " displaying " + list . size ( ) + "/" + dataSource . size ( ) + " points" , OMText . JUSTIFY_LEFT ) ; statement . setFillPaint ( Color . gray ) ; statement . generate ( proj ) ; list . add ( 0 , statement ) ; return list ; }
this is an important layer method to override . the prepare method gets called when the layer is added to the map , or when the map projection changes . we need to make sure the omgraphiclist returned from this method is what we want painted on the map . the omgraphics need to be generated with the current projection .
