I need to create heatmap based on length property from a LineString GeoJSON file.

I have tried to use Leaflet.heat plug-in, but this tool accepts points not lines.

here is my code:

   var locations = data.features.map(function(rat) {
    var location = [rat.geometry.coordinates[0], rat.geometry.coordinates[0]];
    return location;

  var heat = L.heatLayer(locations, { radius: 35 });

Am i need to create an array that contains [startY, startX, endY, endX, length]?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.