From bc23855777633dfd1caf7237b75c1e8fee88dff4 Mon Sep 17 00:00:00 2001 From: zaultavangar Date: Mon, 11 Dec 2023 20:37:52 -0500 Subject: new updates to map feature --- src/client/views/nodes/MapBox/MarkerIcons.tsx | 87 +++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/client/views/nodes/MapBox/MarkerIcons.tsx (limited to 'src/client/views/nodes/MapBox/MarkerIcons.tsx') diff --git a/src/client/views/nodes/MapBox/MarkerIcons.tsx b/src/client/views/nodes/MapBox/MarkerIcons.tsx new file mode 100644 index 000000000..cf50109ac --- /dev/null +++ b/src/client/views/nodes/MapBox/MarkerIcons.tsx @@ -0,0 +1,87 @@ +import { IconProp } from '@fortawesome/fontawesome-svg-core'; +import { faShopify } from '@fortawesome/free-brands-svg-icons'; +import { IconLookup, faBasketball, faBicycle, faBowlFood, faBus, faCameraRetro, faCar, faCartShopping, faFilm, faFootball, faFutbol, faHockeyPuck, faHospital, faHotel, faHouse, faLandmark, faMasksTheater, faMugSaucer, faPersonHiking, faPlane, faSchool, faShirt, faShop, faSquareParking, faStar, faTrainSubway, faTree, faUtensils, faVolleyball } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import React = require('react'); + +export type MapboxColor = 'yellow' | 'red' | 'orange' | 'purple' | 'pink' | 'blue' | 'green'; +type ColorProperties = { + fill: string, + stroke: string +} +type ColorsMap = { + [key in MapboxColor]: ColorProperties; +} + +export class MarkerIcons { + + static getMapboxIcon = (color: string) => { + return ( + + + + + + + + + + + + + + + + ) + } + + static getFontAwesomeIcon(key: string, color?: string): JSX.Element | undefined { + const icon: IconProp = MarkerIcons.FAMarkerIconsMap[key]; + + if (icon) { + const iconProps: any = { icon }; + + if (color) { + iconProps.color = color; + } + + return (); + } + + return undefined; + } + + static FAMarkerIconsMap: {[key: string]: IconProp} = { + 'RESTAURANT_ICON': faUtensils, + 'HOTEL_ICON': faHotel, + 'HOUSE_ICON': faHouse, + 'AIRPLANE_ICON': faPlane, + 'CAR_ICON': faCar, + 'BUS_ICON': faBus, + 'TRAIN_ICON': faTrainSubway, + 'BICYCLE_ICON': faBicycle, + 'PARKING_ICON': faSquareParking, + 'PHOTO_ICON': faCameraRetro, + 'CAFE_ICON': faMugSaucer, + 'STAR_ICON': faStar, + 'SHOPPING_CART_ICON': faCartShopping, + 'SHOPIFY_ICON': faShopify, + 'SHOP_ICON': faShop, + 'SHIRT_ICON': faShirt, + 'FOOD_ICON': faBowlFood, + 'LANDMARK_ICON': faLandmark, + 'HOSPITAL_ICON': faHospital, + 'NATURE_ICON': faTree, + 'HIKING_ICON': faPersonHiking, + 'SOCCER_ICON': faFutbol, + 'VOLLEYBALL_ICON': faVolleyball, + 'BASKETBALL_ICON': faBasketball, + 'HOCKEY_ICON': faHockeyPuck, + 'FOOTBALL_ICON': faFootball, + 'SCHOOL_ICON': faSchool, + 'THEATER_ICON': faMasksTheater, + 'FILM_ICON': faFilm + } + + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2