}
public SVGGraphics2D createSVGMap(final StreamingRenderer renderer,
final WMSMapContext mapContext) throws ServiceException, IOException {
try {
MapContext map = renderer.getContext();
double width = -1;
double height = -1;
if (map instanceof WMSMapContext) {
WMSMapContext wmsMap = (WMSMapContext) map;
width = wmsMap.getMapWidth();
height = wmsMap.getMapHeight();
} else {
// guess a width and height based on the envelope
Envelope area = map.getAreaOfInterest();
if ((area.getHeight() > 0) && (area.getWidth() > 0)) {
if (area.getHeight() >= area.getWidth()) {
height = 600;
width = height * (area.getWidth() / area.getHeight());