move getValue to utils

This commit is contained in:
Anton 2024-01-06 13:35:48 +01:00
parent eb47b05fe4
commit 33b340b6bb

View File

@ -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;
}
};
}