I'm looking to create a heatmap using OpenLayers, which is possible using the ol.layer.Heatmap class. However, I want to limit the visualisation of the heatmap effect to span just the underlying vector polygons (so not a true heatmap).

So in the end the heatmap should only visible as overlay on existing vector features. The reason I want to do this is that I want to give the polygons a weighted gradient, which depends on the weight of the individual vertices of the polygon. There will only be one polygon at a time (in a pop-up), so the heatmap effect will be isolated automatically to just one polygon, it just needs to be clipped. Does anyone know if this can be realized in OpenLayers?

  • 1
    Hey, did you find the solution ??? Nov 5, 2019 at 13:42
  • You can limit the heatmap by adding a masking layer on top of the heatmap. That will at least visually clip the layer. As for the other part of my question, for adding extra weight to certain areas you can add extra vertices at certain spots. Nov 7, 2019 at 11:40
  • How did you accomplish this task of adding extra vertices can you please elaborate ? I want to extract boundary in the form of WKT. Nov 11, 2019 at 12:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.