From 60afc8d076df87a1a884bbb03067b925f8fb1f43 Mon Sep 17 00:00:00 2001 From: Platon Yasev Date: Wed, 16 Nov 2022 10:46:13 +0300 Subject: [PATCH] Add name for point popup --- src/Map/Popup.jsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Map/Popup.jsx b/src/Map/Popup.jsx index 04d4549..6563dff 100644 --- a/src/Map/Popup.jsx +++ b/src/Map/Popup.jsx @@ -37,6 +37,9 @@ const useRateValue = (feature) => { }; const pointConfig = [ + { + field: "name", + }, { field: "category", name: "Тип", @@ -77,12 +80,20 @@ export const MapPopup = ({ feature, lat, lng, onClose }) => { return ( - - {item.name} - - - {item.formatter ? item.formatter(value) : value} - + {item.field === "name" ? ( + + {value} + + ) : ( + <> + + {item.name} + + + {item.formatter ? item.formatter(value) : value} + + + )} ); })}