Search in sources :

Example 1 with PolygonStyle

use of io.jmix.mapsui.component.layer.style.PolygonStyle in project jmix-docs by Haulmont.

the class Canvas method onDrawPolygonClick.

@Subscribe("drawPolygon")
private void onDrawPolygonClick(Button.ClickEvent event) {
    CanvasLayer canvasLayer = map.getCanvas();
    PolygonStyle style = new PolygonStyle().setFillColor("#08a343").setStrokeColor("#004912");
    canvasLayer.drawPolygon(polygon -> polygon.setStyle(style));
}
Also used : PolygonStyle(io.jmix.mapsui.component.layer.style.PolygonStyle) Subscribe(io.jmix.ui.screen.Subscribe)

Aggregations

PolygonStyle (io.jmix.mapsui.component.layer.style.PolygonStyle)1 Subscribe (io.jmix.ui.screen.Subscribe)1