How do I modify my legend for an additional layer?

3907
4
Jump to solution
04-30-2015 02:53 PM
ChrisSergent
Regular Contributor III

I want to define another legend layer, but my legend is currently the following:

app.legend = new Legend({
            map: app.map,
            layerInfos: [{
                title: app.supportLayer.name,
                    layer: app.supportLayer


            }]
        }, "legend");
        app.legend.startup();

my other layer name that I want to add is called: signLayer

How would I add another layer and title so I can see a list of both layers?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Chris,

  Then it would look something like this:

        app.legend = new Legend({  
            map: app.map,  
            layerInfos: [{  
                title: app.supportLayer.name,  
                layer: app.supportLayer
            }, {
                title: app.supportLayer2.name,  
                layer: app.supportLayer2
            }]

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Chris,

  After the legend is already created or at creation time?

ChrisSergent
Regular Contributor III

I want to load the sign layer at the same time I load the support layer so that both display as soon as the application displays.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Chris,

  Then it would look something like this:

        app.legend = new Legend({  
            map: app.map,  
            layerInfos: [{  
                title: app.supportLayer.name,  
                layer: app.supportLayer
            }, {
                title: app.supportLayer2.name,  
                layer: app.supportLayer2
            }]
ChrisSergent
Regular Contributor III

Awesome! Thanks again Robert Scheitlin, GISP

0 Kudos