public String createQueryString(Projection p){
  if (queryHeader == null) {
    return null;
  }
  StringBuffer buf=new StringBuffer(queryHeader);
  buf.append(REQUEST + "=" + MAP+ "&");
  if (p != null) {
    Point2D center=p.getCenter();
    buf.append(PROJTYPE + "=" + p.getName()+ "&"+ SCALE+ "="+ p.getScale()+ "&"+ LAT+ "="+ center.getY()+ "&"+ LON+ "="+ center.getX()+ "&"+ HEIGHT+ "="+ p.getHeight()+ "&"+ WIDTH+ "="+ p.getWidth());
  }
 else {
    buf.append(PROJTYPE + "=name_undefined&" + SCALE+ "=scale_undefined&"+ LAT+ "=center_lat_undefined&"+ LON+ "=center_lon_undefined&"+ HEIGHT+ "=height_undefined&"+ WIDTH+ "=width_undefined");
  }
  if (imageFormat != null) {
    buf.append("&" + FORMAT + "="+ imageFormat);
  }
  if (transparent) {
    buf.append("&" + TRANSPARENT + "=true");
  }
  if (backgroundColor != null) {
    buf.append("&" + BGCOLOR + "="+ backgroundColor);
  }
  String layers=getLayerMarkers();
  if (layers != null) {
    buf.append("&" + layers);
  }
  return buf.toString();
}

public String createQueryString ( Projection p ) { if ( queryHeader == null ) { return null ; } StringBuffer buf = new StringBuffer ( queryHeader ) ; buf . append ( REQUEST + "=" + MAP + "&" ) ; if ( p != null ) { Point2D center = p . getCenter ( ) ; buf . append ( PROJTYPE + "=" + p . getName ( ) + "&" + SCALE + "=" + p . getScale ( ) + "&" + LAT + "=" + center . getY ( ) + "&" + LON + "=" + center . getX ( ) + "&" + HEIGHT + "=" + p . getHeight ( ) + "&" + WIDTH + "=" + p . getWidth ( ) ) ; } else { buf . append ( PROJTYPE + "=name_undefined&" + SCALE + "=scale_undefined&" + LAT + "=center_lat_undefined&" + LON + "=center_lon_undefined&" + HEIGHT + "=height_undefined&" + WIDTH + "=width_undefined" ) ; } if ( imageFormat != null ) { buf . append ( "&" + FORMAT + "=" + imageFormat ) ; } if ( transparent ) { buf . append ( "&" + TRANSPARENT + "=true" ) ; } if ( backgroundColor != null ) { buf . append ( "&" + BGCOLOR + "=" + backgroundColor ) ; } String layers = getLayerMarkers ( ) ; if ( layers != null ) { buf . append ( "&" + layers ) ; } return buf . toString ( ) ; }
when a projection is received , translate it into a valid request for a simplehttpimageserver , and then return the image received back from it .
