Files
editor/src/components/IconLayer.tsx
Harel M a322afdcee Use different icons for different layers (#1375)
## Launch Checklist

This changes the layers icons a bit in order to make them a bit more
distinct:

After:
<img width="580" height="331" alt="image"
src="https://github.com/user-attachments/assets/f341a64e-0310-40f7-8f5a-650d7bb06b9f"
/>


 - [x] Briefly describe the changes in this PR.
- [x] Include before/after visuals or gifs if this PR includes visual
changes.
 - [x] Add an entry to `CHANGELOG.md` under the `## main` section.

---------

Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-09-13 22:46:28 +00:00

34 lines
1.2 KiB
TypeScript

import React from "react";
import type {CSSProperties} from "react";
import { BsBack, BsDiamondFill, BsSunFill } from "react-icons/bs";
import { MdBubbleChart, MdCircle, MdLocationPin, MdPhoto, MdPriorityHigh } from "react-icons/md";
import { IoAnalyticsOutline } from "react-icons/io5";
import { IoMdCube } from "react-icons/io";
import { FaMountain } from "react-icons/fa";
type IconLayerProps = {
type: string
style?: CSSProperties
className?: string
};
const IconLayer: React.FC<IconLayerProps> = (props) => {
const iconProps = { style: props.style };
switch(props.type) {
case "fill-extrusion": return <IoMdCube {...iconProps} />;
case "raster": return <MdPhoto {...iconProps} />;
case "hillshade": return <BsSunFill {...iconProps} />;
case "color-relief": return <FaMountain {...iconProps} />;
case "heatmap": return <MdBubbleChart {...iconProps} />;
case "fill": return <BsDiamondFill {...iconProps} />;
case "background": return <BsBack {...iconProps} />;
case "line": return <IoAnalyticsOutline {...iconProps} />;
case "symbol": return <MdLocationPin {...iconProps} />;
case "circle": return <MdCircle {...iconProps} />;
default: return <MdPriorityHigh {...iconProps} />;
}
};
export default IconLayer;