Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
Is there a way to use the heatmap GeoJSON API in react?

I am trying to use leaflet.heat and GeoJSON in reactJS. I have already made leaflet library to work with react hooks but unfortunately I can't use leaflet.heat in react. I import the module like:

import { GeoJSON } from "react-leaflet";
import "leaflet.heat";

When I run the react app I do not get any errors but the leaflet heatmap is not displayed

Here's an example of my coding for a heatmap:

setIsLoading(true);
            getHome(body)
                .then((response) => {
                    const array = [];
                    response.features.forEach((element) => {
                        array.push({
                            type: "Feature",
                            properties: element["attributes"],
                            geometry: {
                                type: "Point",
                                coordinates: [
                                    element["geometry"]["lat"],
                                    element["geometry"]["lng"],
                                ],
                            },
                        });
                    });

                    const FeatureCollection = {
                        type: "FeatureCollection",
                        features: array,
                    };
                    if (geoJsonLayer.current) {
                        geoJsonLayer.current.clearLayers().addData(FeatureCollection);
                    }
                    setData(FeatureCollection);
                })
                .catch((err) => console.log(err))
                .finally(() => setIsLoading(false));

and from the coding section of getHome it's data API:

export const getNonAPC = async (params) => {
  try {
    const body = FormDataCustom(params);
    const result = await instanceArcgis.post(
      "/rest/Home/MapServer/5/query",
      body,
    );

    return await result?.data;
  } catch (error) {
    return error?.response?.data;
  }
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda