Re: Legend with Class Break Renderer normalization

183
12
Jump to solution
02-06-2018 07:37 AM
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

  See if this helps:

...
        classDef.breakCount = 5;
        classDef.classificationMethod = "quantile";
        classDef.type = "classBreaksDef";
        if(this.selectNorm.get('value')){
          classDef.normalizationType = "field"
          classDef.normalizationField = this.selectNorm.get('value');
        }
...
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

   Give these changes a try. Basically you where refreshing and trying to recreate the legend before the new renderer was applied.

View solution in original post

12 Replies
DavidTreering2
New Contributor III

Perfect, thank you.

- David Treering, GISP

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Don’t forget to mark your question as answered.

0 Kudos
DavidTreering2
New Contributor III

I can't figure out why the legend will not refresh until I change the view or navigate.

startup: function() {
   this.own(on(this.selectField, "change", lang.hitch(this, this.onFieldChange, this.legendRefresh)));

.......

legendRefresh: function(evt){
   this.legend.refresh();
},

I tried to add this.legend.refresh(); to the end of onFieldChange, but it doesn't make sense having to call legend.refresh() right after legend.startup() runs within the createLegend function.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

   Have you tried a layer refresh?

0 Kudos
DavidTreering2
New Contributor III

I have, and the layer does refresh on the map:

this.map.getLayer("tracts").refresh();

But the legend does not refresh.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

  I think you attached the wrong Widget.js. That one you attached is for Google Earth or something.

0 Kudos
DavidTreering2
New Contributor III

I edited that post now with the correct attachments, sorry!

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

   Give these changes a try. Basically you where refreshing and trying to recreate the legend before the new renderer was applied.

View solution in original post

DavidTreering2
New Contributor III

Very helpful.  It won't let me mark this as the answer, maybe because I branched the discussion from one of your posts?  Anyway, if you ever get to Chicago, I need to buy you a drink!

0 Kudos