Skip to content

Commit

Permalink
geosolutions-it#10711: Control loading FontAwesome for vector style (g…
Browse files Browse the repository at this point in the history
…eosolutions-it#10715)

* geosolutions-it#10711: Control loading FontAwsome for vector style
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

* geosolutions-it#10711: enhance drawIcons if there are icons in data and loadFontAwesomeForIcons = true --> it will load fontAwesome and if there is no icons ---> it won't load

* geosolutions-it#10711: using cfg loadFontAwesomeForIcons in root in localConfig instead of map plugin and revert other changes

* geosolutions-it#10711: remove unused console.log in StylePArserUtils
  • Loading branch information
mahmoudadel54 committed Dec 18, 2024
1 parent d93f2fb commit e7f8b64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/client/utils/styleparser/StyleParserUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import isNil from 'lodash/isNil';
import isObject from 'lodash/isObject';
import MarkerUtils from '../MarkerUtils';
import {randomInt} from '../RandomUtils';
import { getConfigProp } from '../ConfigUtils';


export const isGeoStylerBooleanFunction = (got) => [
Expand Down Expand Up @@ -917,7 +918,10 @@ export const drawIcons = (geoStylerStyle, options) => {
}, []);
const marks = symbolizers.filter(({ kind }) => kind === 'Mark');
const icons = symbolizers.filter(({ kind }) => kind === 'Icon');
return loadFontAwesome()
const loadFontAwesomeForIcons = getConfigProp("loadFontAwesomeForIcons");
// if undefined or true it will load it to preserve previous behaviour
const loadingPromise = (isNil(loadFontAwesomeForIcons) || loadFontAwesomeForIcons) && icons?.length ? loadFontAwesome() : Promise.resolve();
return loadingPromise
.then(
() => new Promise((resolve) => {
if (marks.length > 0 || icons.length > 0) {
Expand Down

0 comments on commit e7f8b64

Please sign in to comment.