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 does not update if layer changed in Dynamic map service #340

Closed
TPLsmitty opened this issue Jan 5, 2015 · 6 comments · Fixed by #660
Closed

Legend does not update if layer changed in Dynamic map service #340

TPLsmitty opened this issue Jan 5, 2015 · 6 comments · Fixed by #660

Comments

@TPLsmitty
Copy link

This may be the same as issue #294.

So it looks like if a dynamic map service is in CMV, if you change a layer associated with the Dynamic map service, the legend widget does not update until the user zooms in or out of the map. If the layer is a feature layer it updates immediately.

This is replicable with the demo viewer.

Turn off meet up, San Fran or damage assessment layers and legend is updated,

Open Louisville map service and turn off layer, legend does not update until you zoom in or out.

@tmcgee
Copy link
Member

tmcgee commented Jan 6, 2015

@TPLsmitty This may be related to issue #294 - possibly at the JavaScript API level. The legend widget is an "out-of-the-box" widget from ESRI, not one developed by the CMV team. I'm not aware of any plans to create a CMV-specific legend widget though much of the effort may already have been done by @btfou in the layerControl widget - at least for the layers currently supported by the layerControl widget.

@TPLsmitty
Copy link
Author

@tmcgee @btfou First off, Thank you for all your help and effort in keeping CMV up to date.
I understand that the legend widget is out of the box and do not expect you to create a custom one. In it's current state, it seems like the legend widget is not refreshing after a change in the layer / sublayer visibility with a dynamic map service. From what I can tell, legend.refresh should be able to do this. Due to my novice capabilities with JS, I am uncertain as to where this should go. I am guessing that it would be needed somewhere in js/gis/dijit/LayerControl/Dynamic.js

I appreciate all of your help with this.

@tmcgee
Copy link
Member

tmcgee commented Jan 7, 2015

@TPLsmitty I'm not sure the layerControl widget would be a good candidate for this change. We cannot assume that one widget (layerControl) will be included in an application to send changes to the second widget (legend). Assuming the legend widget is the problem (I haven't done any research), here are few quick thoughts on possible approach:

  1. Change the existing legend widget. This would be an ESRI bug-fix or enhancement.
  2. Some cmv-er builds a widget extend the ESRI one. The extended widget would handle the necessary event(s) and update the legend accordingly.
  3. Make changes to the CMV Controller to handle the necessary event(s) and update the legend widget
  4. A new legend widget is built for CMV that completely replaces the out-of-the-box version.

There may be other approaches. These are just what come to mind. Capturing them here for future reference.

@carrbrpoa
Copy link

Hello,

Know about someone that advanced in this question?

Thanks

@tmcgee
Copy link
Member

tmcgee commented Jan 10, 2017

Possible solution proposed in #659

green3g added a commit to green3g/cmv-app that referenced this issue Jan 10, 2017
 - adds new gis/dijit/Legend widget from cmv#659
 - fixes cmv#340
 - fixes cmv#294
@tmcgee
Copy link
Member

tmcgee commented Jan 11, 2017

new core CMV Legend widget added in #660

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

Successfully merging a pull request may close this issue.

5 participants