【解决办法】通过GeoText即可实现,示例代码:
TextPart textPart = new TextPart();
textPart.setAnchorPoint(new Point2D(125, 400));
textPart.setRotation(30);
textPart.setText("示例");
textPart.setX(100);
textPart.setY(100);
textPart.offset(10.0, 20.0);
// 将子对象添加到文本对象中
GeoText geotext = new GeoText();
geotext.addPart(textPart);
elements.addNew(geotext);