Git Product home page Git Product logo

Comments (1)

jasperfirecai2 avatar jasperfirecai2 commented on May 5, 2024

I personally don't seem to have this issue. this is what defines my data (it's slightly more complicated than what you need but nonetheless this works):

GeoJSON = GeoJSONlist[dataindex]; //update the requested featurelist
                                    initdropdown(true); //important to make a comparison later
                                    for (var i = 0; i !== GeoJSON.features.length; i++) {
                                        var feature = GeoJSON.features[i]; //get a singular feature
                                        if (feature.properties.competence === select.options[parseInt(selected)].textContent) {
                                            //IF the feature is from the competence we want to see, add it to the data that will be displayed
                                            Data.push({lat: feature.geometry.coordinates[0], lng: feature.geometry.coordinates[1], mag: feature.properties.mag / 10});
                                            // the three relevant items
                                        }
                                    }

Most relevant line:

Data.push({lat: feature.geometry.coordinates[0], lng: feature.geometry.coordinates[1], mag: feature.properties.mag / 10});

followed by

heat.setData(data);

I can even draw data on in case you'd like to test that:

// draw with mouse
                            mymap.on({
                                movestart: function () {
                                },
                                moveend: function () {
                                },
                                mousemove: function (e) {
                                    if (draw) {
                                        heat.addData(e.latlng);
                                    }
                                },
                                'click': onMapClick
                            });

(where draw is determined by a button)

from heatmap.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.