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

Expose legend model in layer views #480

Merged
merged 4 commits into from
May 19, 2015

Conversation

alonsogarciapablo
Copy link
Contributor

This is part of #101. It exposes a legend model on layers/sublayers so that users can do some custom things, such us:

  • Changing the template of the legend.
  • Customizing the title of the legend.
  • Showing/hiding the title of the legend.
  • Getting/Setting the items that are displayed in the legend.
  • Showing/hiding the legend.

@javisantana what do you think?

@javisantana
Copy link
Contributor

🇪🇸

@knownasilya
Copy link
Contributor

Sweet 👍

@knownasilya
Copy link
Contributor

How would this be used to create the default legend?

Something like this?

var legend = new cdb.geo.ui.Legend({ model: layer.legend })

alonsogarciapablo added a commit that referenced this pull request May 19, 2015
@alonsogarciapablo alonsogarciapablo merged commit 7cd9f98 into develop May 19, 2015
@alonsogarciapablo alonsogarciapablo deleted the 101-expose-infowindows-and-legends branch May 19, 2015 13:18
@alonsogarciapablo
Copy link
Contributor Author

@knownasilya You can basically manipulate the legend models (layer.legend) to customize your legends. Once this is relased, you will be able to get/set the items, customize the template, show/hide a legend, etc.

@knownasilya
Copy link
Contributor

Would love an example of this being used

@knownasilya
Copy link
Contributor

Do I have to use createVis, or can this be accessed from createLayer as well?

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

Successfully merging this pull request may close these issues.

3 participants