LineString line = mapModel.getGeometryFactory().createLineString(coordinates);
graphics.drawLine(parentGroup, "style" + lineCount, line, style);
} else if (vLayer.getLayerInfo().getLayerType() == LayerType.POLYGON
|| vLayer.getLayerInfo().getLayerType() == LayerType.MULTIPOLYGON) {
// Polygons: draw a rectangle:
Bbox rect = new Bbox(10, y, 16, 16);
graphics.drawRectangle(parentGroup, "style" + lineCount, rect, style);
} else if (vLayer.getLayerInfo().getLayerType() == LayerType.POINT
|| vLayer.getLayerInfo().getLayerType() == LayerType.MULTIPOINT) {
// Points: draw a symbol:
graphics.drawSymbol(parentGroup, "style" + lineCount, new Coordinate(18, y + 8), style,
styleInfo.getStyleId());
}
// After the style, draw the style's name:
Coordinate textPosition = new Coordinate(30, y - 2);
graphics.drawText(parentGroup, "text" + lineCount, styleInfo.getName(), textPosition,
fontStyle);
y += 21;
}
} else if (layer instanceof RasterLayer) {
// For raster layers; show a nice symbol:
lineCount++;
graphics.drawImage(parentGroup, "style" + lineCount, Geomajas.getIsomorphicDir()
+ "geomajas/osgeo/layer-raster.png", new Bbox(10, y, 16, 16), new PictureStyle(1));
Coordinate textPosition = new Coordinate(30, y - 2);
graphics.drawText(parentGroup, "text" + lineCount, layer.getLabel(), textPosition, fontStyle);
y += 20;
}
}