use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class RasterizerGriddedElevationModelLayerRenderer method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "rasterizer", this.rasterizer);
addToMap(map, "opacity", this.opacity);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class MapGuideWebServerRecordLayer method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "url", this.url);
addToMap(map, "username", this.username);
addToMap(map, "password", PasswordUtil.encrypt(this.password));
addToMap(map, "layerPath", this.layerPath);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class ArcGisRestServerRecordLayer method initRenderer.
private void initRenderer() {
final List<AbstractRecordLayerRenderer> renderers = new ArrayList<>();
final MapEx drawingInfo = this.layerDescription.getProperty("drawingInfo");
if (drawingInfo != null) {
final MapEx rendererProperties = drawingInfo.getValue("renderer");
if (rendererProperties != null) {
final String rendererType = rendererProperties.getString("type");
if ("simple".equals(rendererType)) {
final AbstractRecordLayerRenderer renderer = newSymbolRenderer(rendererProperties, "symbol");
if (renderer != null) {
renderers.add(renderer);
}
} else if ("uniqueValue".equals(rendererType)) {
final FilterMultipleRenderer filterRenderer = newUniqueValueRenderer(rendererProperties);
renderers.add(filterRenderer);
} else {
Logs.error(this, "Unsupported renderer=" + rendererType + "\n" + rendererProperties);
}
}
final List<MapEx> labellingInfo = drawingInfo.getValue("labelingInfo");
if (labellingInfo != null) {
final MultipleRecordRenderer labelRenderer = new MultipleRecordRenderer(this);
labelRenderer.setName("labels");
for (final MapEx labelProperties : labellingInfo) {
addTextRenderer(labelRenderer, labelProperties);
}
if (!labelRenderer.isEmpty()) {
renderers.add(labelRenderer);
}
}
}
if (renderers.isEmpty()) {
} else if (renderers.size() == 1) {
setRenderer(renderers.get(0));
} else {
setRenderer(new MultipleRecordRenderer(this, renderers));
}
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class ArcGisRestServerRecordLayer method addTextRenderer.
private void addTextRenderer(final AbstractMultipleRenderer renderers, final MapEx labelProperties) {
final TextStyle textStyle = new TextStyle();
final String alignment = labelProperties.getString("labelPlacement");
if (alignment.endsWith("Left")) {
textStyle.setTextHorizontalAlignment("right");
} else if (alignment.endsWith("Right")) {
textStyle.setTextHorizontalAlignment("left");
} else if (alignment.endsWith("Before")) {
textStyle.setTextHorizontalAlignment("right");
textStyle.setTextPlacementType("vertex(0)");
} else if (alignment.endsWith("Start")) {
textStyle.setTextHorizontalAlignment("left");
textStyle.setTextPlacementType("vertex(0)");
} else if (alignment.endsWith("After")) {
textStyle.setTextHorizontalAlignment("left");
textStyle.setTextPlacementType("vertex(n)");
} else if (alignment.endsWith("End")) {
textStyle.setTextHorizontalAlignment("right");
textStyle.setTextPlacementType("vertex(n)");
} else if (alignment.endsWith("Along")) {
textStyle.setTextHorizontalAlignment("center");
textStyle.setTextPlacementType("auto");
} else {
textStyle.setTextHorizontalAlignment("center");
}
if (alignment.contains("Above")) {
textStyle.setTextVerticalAlignment("bottom");
} else if (alignment.endsWith("Below")) {
textStyle.setTextVerticalAlignment("top");
} else {
textStyle.setTextVerticalAlignment("center");
}
String textName = labelProperties.getString("labelExpression");
textName = textName.replace(" CONCAT ", "");
textName = textName.replaceAll("\"([^\"]+)\"", "$1");
textStyle.setTextName(textName);
final MapEx symbol = labelProperties.getValue("symbol");
if ("esriTS".equals(symbol.getString("type"))) {
final Color textFill = getColor(symbol);
textStyle.setTextFill(textFill);
final Color backgroundColor = getColor(symbol, "backgroundColor");
textStyle.setTextBoxColor(backgroundColor);
// "useCodedValues": false,
// "borderLineColor": null,
// "verticalAlignment": "bottom",
// "horizontalAlignment": "left",
// "rightToLeft": false,
// "kerning": true,
final double angle = symbol.getDouble("angle", 0);
textStyle.setTextOrientation(angle);
final Quantity<Length> textDx = Quantities.getQuantity(symbol.getDouble("xoffset", 0), CustomUnits.PIXEL);
textStyle.setTextDx(textDx);
final Quantity<Length> textDy = Quantities.getQuantity(symbol.getDouble("yoffset", 0), CustomUnits.PIXEL);
textStyle.setTextDx(textDy);
final MapEx font = symbol.getValue("font");
if (font != null) {
final String faceName = font.getString("family", "Arial");
textStyle.setTextFaceName(faceName);
final Quantity<Length> size = Quantities.getQuantity(font.getDouble("size", 10), CustomUnits.PIXEL);
textStyle.setTextSize(size);
}
// "font": {
// "style": "normal",
// "weight": "bold",
// "decoration": "none"
}
final TextStyleRenderer textRenderer = new TextStyleRenderer(this, textStyle);
textRenderer.setName(textName.replace("[", "").replace("]", ""));
long minimumScale = labelProperties.getLong("minScale", Long.MAX_VALUE);
if (minimumScale == 0) {
minimumScale = Long.MAX_VALUE;
}
textRenderer.setMinimumScale(minimumScale);
final long maximumScale = labelProperties.getLong("maxScale", 0);
textRenderer.setMaximumScale(maximumScale);
final String where = labelProperties.getString("where");
textRenderer.setQueryFilter(where);
renderers.addRenderer(textRenderer);
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class PointCloudLayer method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "url", this.url);
return map;
}
Aggregations