Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control loading FontAwesome for vector style #10711

Closed
mahmoudadel54 opened this issue Dec 3, 2024 · 0 comments · Fixed by #10715 or #10730
Closed

Control loading FontAwesome for vector style #10711

mahmoudadel54 opened this issue Dec 3, 2024 · 0 comments · Fixed by #10715 or #10730
Assignees
Milestone

Comments

@mahmoudadel54
Copy link
Contributor

mahmoudadel54 commented Dec 3, 2024

Description

This issue is for enhancement the way of loading fontawesome for vector style for icons implemented here:

return loadFontAwesome()
.then(
() => new Promise((resolve) => {
if (marks.length > 0 || icons.length > 0) {
Promise.all([
...marks.map(getWellKnownNameImageFromSymbolizer),
...icons.map(getImageFromSymbolizer)
]).then((images) => {
resolve(images);
});
} else {
resolve([]);
}
})
);
};

The current implementation is loading the fontawesome whatever the data has icons or not.

The main use case for this issue is [When uploading shapefiles with vector data, there's no need to load the FontAwesome style,] because:

  • if there is a project uses MS submodule and this project uses fontawesome package [latest version '6'] in its UI rather than MS one [version 4.7]
  • If this fontawesome in MS loaded by calling the above function, the appearance of project icons will be changed in their appearance due to loading old fontawesome style
  • the shapefiles don't contain any icons that require loading the FontAwesome style like the implemented one

So we need:

  • Control the loading of FontAwesome of vector style through a configuration setting (cfg) flag in localConfigs if the project makes sure that there will not be any need for loading fontAwesome for vector style it should be false and by default it is true.
  • Implement a check to ensure that if no icons are needed, the FontAwesome style is not loaded.

Other useful information

@mahmoudadel54 mahmoudadel54 self-assigned this Dec 4, 2024
@MV88 MV88 added this to the 2024.02.02 milestone Dec 4, 2024
@MV88 MV88 added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Dec 4, 2024
@tdipisa tdipisa modified the milestones: 2024.02.02, 2025.01.00 Dec 4, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 4, 2024
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
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 4, 2024
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
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 4, 2024
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
@mahmoudadel54 mahmoudadel54 changed the title Control loading FontAwsome for vector style Control loading FontAwesome for vector style Dec 4, 2024
@mahmoudadel54 mahmoudadel54 linked a pull request Dec 4, 2024 that will close this issue
12 tasks
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 4, 2024
…nd loadFontAwesomeForIcons = true --> it will load fontAwesome and if there is no icons ---> it won't load
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 9, 2024
…ocalConfig instead of map plugin and revert other changes
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 9, 2024
MV88 pushed a commit that referenced this issue Dec 9, 2024
* #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

* #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

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

* #10711: remove unused console.log in StylePArserUtils
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Dec 18, 2024
…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
@ElenaGallo ElenaGallo self-assigned this Dec 19, 2024
MV88 pushed a commit that referenced this issue Dec 19, 2024
* #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

* #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

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

* #10711: remove unused console.log in StylePArserUtils
@ElenaGallo ElenaGallo removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment