graphic.graphicalSymbols().add(externalGraphic);
}
if (styleJson.has(JSON_GRAPHIC_NAME)) {
Expression graphicName = parseProperty(styleJson.getString(JSON_GRAPHIC_NAME), new Function<String, Object>() {
public Object apply(final String input) {
return input;
}
});
Fill fill = createFill(styleJson);
Stroke stroke = createStroke(styleJson, false);
final Mark mark = this.styleBuilder.createMark(graphicName, fill, stroke);
graphic.graphicalSymbols().add(mark);
}
if (graphic.graphicalSymbols().isEmpty()) {
Fill fill = createFill(styleJson);
Stroke stroke = createStroke(styleJson, false);
final Mark mark = this.styleBuilder.createMark(DEFAULT_POINT_MARK, fill, stroke);
graphic.graphicalSymbols().add(mark);
}
graphic.setOpacity(parseExpression(null, styleJson, JSON_GRAPHIC_OPACITY, new Function<String, Object>() {
@Nullable
@Override
public Object apply(final String opacityString) {
return Double.parseDouble(opacityString);
}
}));
if (!Strings.isNullOrEmpty(styleJson.optString(JSON_POINT_RADIUS))) {
Expression size = parseExpression(null, styleJson, JSON_POINT_RADIUS, new Function<String, Object>() {
@Nullable
@Override
public Object apply(final String input) {
return Double.parseDouble(input) * 2;
}
});
graphic.setSize(size);
} else if (!Strings.isNullOrEmpty(styleJson.optString(JSON_GRAPHIC_WIDTH))) {
Expression size = parseExpression(null, styleJson, JSON_GRAPHIC_WIDTH, new Function<String, Object>() {
@Nullable
@Override
public Object apply(final String input) {
return Double.parseDouble(input);
}
});
graphic.setSize(size);
}
if (!Strings.isNullOrEmpty(styleJson.optString(JSON_ROTATION))) {
final Expression rotation = parseExpression(null, styleJson, JSON_ROTATION, new Function<String, Object>() {
@Nullable
@Override
public Object apply(final String rotation) {
return Double.parseDouble(rotation);
}