Skip to content

Commit

Permalink
geosolutions-it#10711: Control loading FontAwsome for vector style
Browse files Browse the repository at this point in the history
Description:
- add boolean cfg called 'loadFontAwesomeForIcons' for Map plugin to control the loading fontAwesome for vector style
- add jsdocs in plugin/Map
- handle the control of loading fontAwesome for openlayers, leaflet and cesium
  • Loading branch information
mahmoudadel54 committed Dec 4, 2024
1 parent fb02dab commit 012db50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/client/utils/styleparser/OLStyleParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion web/client/utils/styleparser/StyleParserUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 012db50

Please sign in to comment.