Building tech points colour
This commit is contained in:
+19
-1
@@ -1,4 +1,14 @@
|
||||
// Global leaflet
|
||||
|
||||
// See app.css - Building tech colors
|
||||
const buildingTechColors = {
|
||||
"Opera cementizia" : "cement-tech",
|
||||
"Opera poligonale" : "polygon-tech",
|
||||
"Opera incerta" : "uncertain-tech",
|
||||
"Opera reticolata" : "reticul-tech",
|
||||
"Opera laterizia" : "later-tech",
|
||||
"Opera mista" : "mixed-tech",
|
||||
};
|
||||
/**
|
||||
* @namespace Icons
|
||||
*/
|
||||
@@ -59,6 +69,14 @@ Icons.reuse = L.icon(
|
||||
|
||||
Icons.camera = L.divIcon({className: 'fa fa-camera'});
|
||||
|
||||
Icons.techs = L.divIcon({className: 'fa fa-circle has-text-link-45'});
|
||||
/**
|
||||
* Assigns a different color to the icon
|
||||
* based on building tech type
|
||||
* @param {string} techType The type (name) of the building tech
|
||||
*/
|
||||
Icons.techIcon = (techType) => {
|
||||
const colorClass = buildingTechColors[techType] ?? "has-text-link-45";
|
||||
return L.divIcon({className: `fa fa-circle ${colorClass}`});
|
||||
}
|
||||
|
||||
export default Icons;
|
||||
Reference in New Issue
Block a user