I am using use super clusture in react map (i am using package google-map-react) But my clusture function is giving undefined Below is my code
const mapRef = useRef();
const [zoom, setZoom] = useState(10);
const [bounds, setBounds] = useState(null);
const [mapData, setMapData] = useState([]);
const points = pestMap.map((map) => ({
type: "Feature",
properties: {
cluster: false,
mapId: map.id,
company_name: map.company_name,
},
geometry: {
type: "Point",
coordinates: [parseFloat(map.longitude), parseFloat(map.latitude)],
},
}));
// get clustures
const { clustures } = useSupercluster({
points,
bounds,
zoom,
options: { radius: 100 , maxZoom: 20 },
});
console.log(points)
console.log(clustures)
i have consoled points and clusture both but there is data shown in points but not in clusture
below is my map component
<GoogleMapReact
bootstrapURLKeys={{ key: "process.env.REACT_APP_GOOGLE_KEY" }}
defaultCenter={{ lat: 20.582146, lng: 78.970778 }}
defaultZoom={10}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map }) => {
mapRef.current = map;
}}
onChange={({zoom , bounds})=>{
setZoom(zoom);
setBounds([
bounds.nw.lng,
bounds.se.lat,
bounds.se.lng,
bounds.nw.lat
])
}}
>
{pestMap.map((map) => (
<Marker key={map.id} lat={map.latitude} lng={map.longitude}>
<Button className="crime-marker">
<img src={faBus.icon} />
</Button>
</Marker>
))}
</GoogleMapReact>
can somebody help me with this