use of org.gwtopenmaps.openlayers.client.StyleMap in project geo-platform by geosdi.
the class PrintUtility method createRectangle.
public static Vector createRectangle(LonLat center, float scale, Map map, double sizeFactor, boolean portrait) {
Bounds extent = getExtent(center, scale, map, sizeFactor, portrait);
Geometry rect = extent.toGeometry();
VectorFeature features = new VectorFeature(rect);
Vector vectorLayer = new Vector(GPPrintWidget.PRINT_VECTOR_NAME);
vectorLayer.addFeature(features);
// Define a style for the vectors
Style style = new Style();
style.setFillColor("white");
style.setStrokeColor("violet");
style.setStrokeWidth(1);
style.setStrokeDashstyle("dash");
style.setFillOpacity(0.4);
StyleMap styleMap = new StyleMap(style);
vectorLayer.setStyleMap(styleMap);
return vectorLayer;
}
Aggregations