• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

147
Views
Why don't heatmap colors appear on the map?

I want to ask i.e. Why is the heatmap color not showing on the map? and I use from API and GeoJSON is there anything wrong with my own coding? Is there any part of const position = response.features? Link 1 and Link 2

The following example does not show the heatmap color but it comes out like a box and it says marker. enter image description here

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

                    const FeatureCollection = {
                        type: "FeatureCollection",
                        features: array,
                    };
                    if (geoJsonLayer.current) {
                        geoJsonLayer.current.clearLayers().addData(FeatureCollection);
                    }

                    const position = response.features
                        ? response.features.forEach((element) => {
                            return [element["geometry"]["x"], element["geometry"]["y"]];
                        })
                        : [];

                    if (geoJsonLayer.current) {
                        L.heatLayer(position).addTo(FeatureCollection);
                    }

                    setData(FeatureCollection);


                })
                .catch((err) => console.log(err))
                .finally(() => setIsLoading(false));
        };

        fetchData();
    }, [bounds, setIsLoading, tokenArcgis]);
over 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error