I have this piece of code in my template, expecting that the marker will appear with the text "1SSMMMS", but I don't see any text at all in the market
var iconStyle = new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46],
text: "1SSMMMS",
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: '../../../map_marker.png'
}))
});
startMarker = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([lng, lat], 'EPSG:4326', 'EPSG:3857')),
name: 'The icon',
population: 4000,
rainfall: 500
});
startMarker.setStyle(iconStyle);
You would need to create the
text
property (see the doc for default values)