Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

101
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda