polylines tooltip content
This commit is contained in:
26
hooks/usePoiTypData.js
Normal file
26
hooks/usePoiTypData.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// hooks/usePoiTypData.js
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
const usePoiTypData = (url) => {
|
||||
const [poiTypData, setPoiTypData] = useState([]);
|
||||
const [isPoiTypLoaded, setIsPoiTypLoaded] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchPoiTypData = async () => {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
setPoiTypData(data);
|
||||
setIsPoiTypLoaded(true);
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Abrufen der poiTyp-Daten:", error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchPoiTypData();
|
||||
}, [url]);
|
||||
|
||||
return { poiTypData, isPoiTypLoaded };
|
||||
};
|
||||
|
||||
export default usePoiTypData;
|
||||
Reference in New Issue
Block a user