diff --git a/web/client/utils/styleparser/OLStyleParser.js b/web/client/utils/styleparser/OLStyleParser.js index c6a5d6cb2a..c2e333a1d0 100644 --- a/web/client/utils/styleparser/OLStyleParser.js +++ b/web/client/utils/styleparser/OLStyleParser.js @@ -425,7 +425,7 @@ export class OlStyleParser { */ geoStylerStyleToOlParserStyleFct(geoStylerStyle) { const rules = geoStylerStyle.rules; - const olStyle = ({ map, features } = {}) => drawIcons(geoStylerStyle, { features }) + const olStyle = ({ map, features, loadFontAwesomeForIcons } = {}) => drawIcons({...geoStylerStyle, loadFontAwesomeForIcons}, { features }) .then((images) => { this._getImages = () => images; this._getImageSrc = createGetImagesSrc(); diff --git a/web/client/utils/styleparser/StyleParserUtils.js b/web/client/utils/styleparser/StyleParserUtils.js index b6f4d96334..dd39298a4f 100644 --- a/web/client/utils/styleparser/StyleParserUtils.js +++ b/web/client/utils/styleparser/StyleParserUtils.js @@ -917,7 +917,8 @@ export const drawIcons = (geoStylerStyle, options) => { }, []); const marks = symbolizers.filter(({ kind }) => kind === 'Mark'); const icons = symbolizers.filter(({ kind }) => kind === 'Icon'); - return loadFontAwesome() + const shouldLoadFontAwesomeForIcons = geoStylerStyle.loadFontAwesomeForIcons ? loadFontAwesome() : Promise.resolve(); + return shouldLoadFontAwesomeForIcons .then( () => new Promise((resolve) => { if (marks.length > 0 || icons.length > 0) {