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');
}
...
Solved! Go to Solution.
David,
Give these changes a try. Basically you where refreshing and trying to recreate the legend before the new renderer was applied.
Perfect, thank you.
- David Treering, GISP
Don’t forget to mark your question as answered.
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.
David,
Have you tried a layer refresh?
I have, and the layer does refresh on the map:
this.map.getLayer("tracts").refresh();
But the legend does not refresh.
David,
I think you attached the wrong Widget.js. That one you attached is for Google Earth or something.
I edited that post now with the correct attachments, sorry!
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!