I can't show these icons from FontAwesome:
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
]
, target: 'map'
, controls: ol.control.defaults({
attributionOptions: {
collapsible: true
}
}), //Vista inicial del mapa
view: new ol.View({
center: ol.proj.fromLonLat([-5.9334, 43.5848])
, zoom: 15
})
});
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: new ol.format.GeoJSON().readFeatures(geojsonObject, {
featureProjection: 'EPSG:3857'
})
})
, style: new ol.style.Style({
/*image: new ol.style.Circle( /** @type {olx.style.IconOptions} ({
radius: 20
, fill: new ol.style.Fill({
color: '#000000'
})
}))*/
text: new ol.style.Text({
text: '\uf041'
, font: 'normal 38px FontAwesome'
, fill: new ol.style.Fill({
color: '#ff0000'
})
})
})
});
map.addLayer(vectorLayer);
Does anybody use typographic icons as Openlayers icons?
I need help…
Best Answer
You just need to look at the existing solution on parent forum website StackOverflow
You may prefer using
ol.style.FontSymbol
from ol-ext project