Map PointStyle IconStyle

I have en entity with icon and style.

class MyEntity (val vaadinIcon: VaadinIcon, val styleCss: String)
In Jmix1 that was 
class MyEntity (val jmixIcon: JmixIcon, val styleCss: String)

I have an app that display item with icon and color, on entityComboBox, datagrid, etc…
In each component, the configuration is to set the icon et the style css (that’s include the color)

In the map addon v1, that was the same thing

geometryStyles.point()
.withFontIcon(myEntity.jmixIcon)
.setIconPathFillColor(myEntity.styleCss)

But in the map addon v2, style are

IconStyle()
.withSrc("icons/question.png")
.withColor("#A368D5")

But I don’t know the image src, I just have a VaadinIcon,
and I don’t know the exact color, (it’s in the css theme), I just know the style.

So, in jmix 2, is-it possible to display an icon (VaadinIcon) and a style to display the same icon on the map and on the other components.

Hello!

Unfortunately, the Maps add-on does not support using VaadinIcon as an icon for points and markers. We have an open GitHub issue regarding font icon support: Support Font icons in Maps add-on · Issue #3650 · jmix-framework/jmix · GitHub.

I’ve updated the issue to include the possibility of adding VaadinIcon as an icon and the workaround.

For now, you can display VaadinIcon like this:

PointFeature pointFeature = new PointFeature(GeometryUtils.createPoint(0, 0));
pointFeature.withStyles(new Style()
        .withText(new TextStyle()
                .withText(VaadinIcon.PYRAMID_CHART.name()
                        .toLowerCase()
                        .replace("_", "-"))
                .withFont("18px Vaadin-Icons")));

OpenLayers uses canvas to render features, therefore selectors from global styles won’t be applied for features.