Select to view content in your preferred language

addBreak is not a function

662
1
05-18-2021 05:12 PM
alabanu
New Contributor

I am trying to add cluster layer in my Angular project using 

https://js.arcgis.com/3.36/

but I am getting this error

this.renderer.addBreak is not a function

Can you please let me know how to fix this?

 

this.defaultSym = new this.esriApi.SimpleMarkerSymbol().setSize(4);
    this.renderer = new this.esriApi.ClassBreaksRenderer(this.defaultSym, "clusterCount");
   
    this.renderer.addBreak(0, 25, new this.esriApi.SimpleFillSymbol().setColor(new this.esriApi.Color([56, 168, 0, 0.5])));
    this.renderer.addBreak(25, 75,new this.esriApi.SimpleFillSymbol().setColor(new this.esriApi.Color([139, 209, 0, 0.5])));
    this.renderer.addBreak(75, 175, new this.esriApi.SimpleFillSymbol().setColor(new this.esriApi.Color([255, 255, 0, 0.5])));
    this.renderer.addBreak(175, 400, new this.esriApi.SimpleFillSymbol().setColor(new this.esriApi.Color([255, 128, 0, 0.5])));
    this.renderer.addBreak(400, Infinity, new this.esriApi.SimpleFillSymbol().setColor(new this.esriApi.Color([255, 0, 0, 0.5])));
    
    this.clusterLayer.setRenderer(this.renderer);
    // this.clusterLayer.renderer = renderer; 
    this.map.addLayer(this.clusterLayer);

 

 

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

That error usually pops up when the imported module isn't matching up with its import name. How is that section of your code set up?

0 Kudos