0

I am having a problem rendering a heatmap. I am sure the heatmap is created but it doesnt display when I replace or add a renderer.

  var TF = new FeatureLayer({
    url:"https://services3.arcgis.com/1pxU2hJU9ZszJDcX/ArcGIS/rest/services/Young_Adult_Treatment_Facilities/FeatureServer/0",
  })


  //apply HM to layer      
  function apply(result){
    console.log("applying")
   TF.renderer = result.renderer;
   };


  var heatmapParams = {
    layer: TF,
    basemap: map.basemap
  };


document.getElementById("butt").addEventListener("click", heatmapRendererCreator.createRenderer(heatmapParams).then(apply)); 

Whenever I call the apply function to create a renderer the point layer disappears.

Here's a codepen:

https://codepen.io/segev-salman/pen/eaEbRv

0

You must pass the view object to the heatmapParams:

var heatmapParams = {
  layer: TF,
  view: view
};

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.