sandcode: https://codesandbox.io/s/icon-color-forked-v7chj?file=/main.js
I use markers with icon style and text style, but I found something strange. When I added two markers with icon and text style, it seemed like I added two layers which are a icon layer and a text layer. That's to say, icons are in one level, and texts are in another level. I think a marker should be a whole, so it's icon and text should lay in the same level.
Accoding to the picture, the two markers with icon and text ,should be in different two level.But a marker's icon and text separateed.
rome.setStyle(
new Style({
image: new Icon({
color: "#BADA55",
crossOrigin: "anonymous",
// For Internet Explorer 11
imgSize: [180, 180],
src: "data/square.svg"
}),
text: new Text({
text: "Wow such labeladfasdfasdf",
offsetY: 0,
fill: new Fill({
color: "#42f"
})
})
})
);