Geometry style map

Hello ! I am currently using Jmix version 2.3.4 and trying to modify the style of a geometry displayed on a map using the setStyleProvider method. I have configured layerSource to display a specific marker icon
However, the custom style does not apply, and the default style remains visible on the map.

<maps:vector id=“networkFeatureStructuresLayer” >
<maps:dataVectorSource id=“networkFeatureStructuresLayerSource”
dataContainer=“networkFeatureStructuresDc” property=“geometry”/>
</maps:vector>

private fun initStyleSource() {
networkFeatureStructuresLayerSource.setStyleProvider { location →
Style()
.withImage(
IconStyle()
.withSrc(“map-icons/point-marker.png”)
.withScale(0.5)
.withAnchorOrigin(IconOrigin.BOTTOM_LEFT)
.withAnchor( Anchor(0.49, 0.12))

            )
    }

@Subscribe
private fun onInit(event: InitEvent) {
    initStyleSource()
}

open class NetworkFeatureStructure : NetworkFeature(){

@Column(name = "GEOMETRY")
var geometry: Point? = null

}

Hello!

I don’t see any issues in the provided code. I did the same and custom icon is displayed for points. Do you place the icons to a correct directory in the resource folder? Do you see any errors in the dev-tools of your web browser?

I attached a demo project where custom icon works fine: kt-map.zip (114.0 KB)

Thank you for your response! The issue was that in the onInit method, I initially interacted with the map (initialized the extent, zoom, and loaded some data) before setting the setStyleProvider. However, when I reordered the steps and placed the setStyleProvider at the very beginning of the onInit method, the custom style started working as expected.