Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legend always uses the legend service even if version is later than 10.01 #20

Open
GoogleCodeExporter opened this issue Mar 22, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. add a layer to the toc widget using code.
2. Load the application
3. Step through TOC.js _RootLayerTOC _getLegendInfo function

What is the expected output? What do you see instead?
Expected to load legend from the layer instead of the arcgis legend tools.

What version of the product are you using? On what operating system?
2.09, Windows 7.

Please provide any additional information below.
I updated the "postCreate" function to make sure the rootLayer is loaded before 
calling the _getLegendInfo function.

Here is the new code that fixes the bug in TOC.js line 620.
-------------------------------------------------------------
         // extenstion point called by framework
         postCreate: function () {
             if ((this.rootLayer instanceof (ArcGISDynamicMapServiceLayer) ||
            this.rootLayer instanceof (ArcGISTiledMapServiceLayer))) {
                 //check if the layer is loaded yet, if not, add a listener to wait
                 if (this.rootLayer.loaded) {
                     if (this._legendResponse) {
                         this._createRootLayerTOC();
                     } else {
                         this._getLegendInfo();
                     }
                 }
                 else {//layer not yet loaded, add listener
                     this.rootLayer.on("load", lang.hitch(this, this._getLegendInfo));
                 }
             } else { //not servicelayer
                 this._createRootLayerTOC();
             }
         },
-----------------------------------

Original issue reported on code.google.com by gref...@gmail.com on 10 Apr 2014 at 8:02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant