Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
google-map-react Use super clusture

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!