AnsweredAssumed Answered

jsapi 4.0 Legend: Layer titles with defintion expressions

Question asked by dcoley on Aug 4, 2016
Latest reply on Aug 5, 2016 by dcoley

Hi again -

In prep for the upcoming layer list widget, I am setting up a legend widget:

var legend = new Legend({
  view: view,
  layerInfos: [{
    layer: lyrEnvBnds,
    title: "Environmental"
  }, 
  {
  layer: lyrFacBnds,
    title: "Facilities"
  },
  {
  layer: lyrMobBnds,
    title: "Transportation"
  },
  {
  layer: lyrUtilBnds,
    title: "Utilities"
  }]
  });

very straighforward, except each layer in the array has been filtered with a defintion expression.  What happens is the title is then not honored, even though the consol log for the legend widget clearly shows the title in the array:

  1. layerInfos:Array[4]
    1. 0:Object
      1. layer:Object
      2. title:"Environmental"

something similar happened with the layer list at the 3.14 ( I think) release where the title param wasn't being passed to the dom node to display the title correctly in the layer list - ideas?

 

Thanks

David

Outcomes