Select to view content in your preferred language

jsapi 4.0 Legend: Layer titles with defintion expressions

1235
2
Jump to solution
08-04-2016 12:44 PM
DavidColey
Honored Contributor

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

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

It is a known issue at 4.0. Should not be a problem at 4.1.

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

It is a known issue at 4.0. Should not be a problem at 4.1.

0 Kudos
DavidColey
Honored Contributor

Thanks Undral-

0 Kudos