if (style == null) {
style = definition.getStyle();
}
SymbolInfo symbol = definition.getSymbol();
if (symbol.getRect() != null) {
Element rect = helper.createOrUpdateElement(parent, name, "rect", style);
// Real position is the upper left corner of the rectangle:
float w = symbol.getRect().getW();
float h = symbol.getRect().getH();
applyAbsolutePosition(rect, new Coordinate(position.getX() - 0.5 * w, position.getY() - 0.5 * h));
// width and height
applyElementSize(rect, (int) w, (int) h, false);
} else if (symbol.getCircle() != null) {
Element circle = helper.createOrUpdateElement(parent, name, "oval", style);
// Real position is the upper left corner of the circle:
float radius = symbol.getCircle().getR();
applyAbsolutePosition(circle, new Coordinate(position.getX() - radius, position.getY() - radius));
// width and height are both radius*2
int size = (int) (2 * radius);
applyElementSize(circle, size, size, false);
} else if (symbol.getImage() != null) {
// Creating an image; ignoring style....
Element image = helper.createOrUpdateElement(parent, name, "image", null);
DOM.setElementAttribute(image, "src", symbol.getImage().getHref());
int width = symbol.getImage().getWidth();
int height = symbol.getImage().getHeight();
applyElementSize(image, width, height, false);
applyAbsolutePosition(image, new Coordinate(position.getX() - Math.round(width / 2), position.getY()