From 33b340b6bb220c4884bc7b0812110a07c0fc1468 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 6 Jan 2024 13:35:48 +0100 Subject: [PATCH] move getValue to utils --- src/Components/Map/Layer.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Components/Map/Layer.tsx b/src/Components/Map/Layer.tsx index 9c4bb9cd..53287af9 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -12,6 +12,7 @@ import { useAddMarker, useAddPopup, useLeafletRefs } from './hooks/useLeafletRef import { Popup } from 'leaflet' import { useLocation } from 'react-router-dom'; import { useAssetApi } from '../AppShell/hooks/useAssets' +import { getValue } from '../../Utils/GetValue' export const Layer = (props: LayerProps) => { @@ -170,14 +171,4 @@ export const Layer = (props: LayerProps) => { } ) -} - -function getValue(obj, path) { - if (obj) { - for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) { - obj = obj[path[i]]; - }; - return obj; - } - -}; \ No newline at end of file +} \ No newline at end of file