Skip to content

Conversation

@neveldo
Copy link
Owner

@neveldo neveldo commented Oct 23, 2017

1 - The option "display" should be checked before checking the existence of a container with a class 'cssClass' (otherwise, users are forced to add a legend container even if just want to display a choropleth without displaying the related legend)

2 - I think that, even if the option 'display' is set to true, we shouldn't rise an error if the container doesn't exist. In fact, some user define their own default options along with some default ones for the legend (in order to customize fonts, colors, etc), and they extend their default options object in order to display both legended and non-legended maps. As the 'display' option is set to true by default within mapael, it will raise an error for the non-legended maps in this case.

@neveldo neveldo requested a review from Indigo744 October 23, 2017 08:58
@neveldo
Copy link
Owner Author

neveldo commented Oct 23, 2017

Hmm, I will check ASAP why my pull-request broke the unit tests pass (don't know if it's related with my update)

}
if (legendsOptions[j].display === true && $.isArray(legendsOptions[j].slices) && legendsOptions[j].slices.length > 0) {
if (legendsOptions[j].display === true && $.isArray(legendsOptions[j].slices) && legendsOptions[j].slices.length > 0
&& legendsOptions[j].cssClass !== "" && $("." + legendsOptions[j].cssClass, self.$container).length !== 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue is here: the && should not after a line break but before.

@neveldo
Copy link
Owner Author

neveldo commented Oct 25, 2017

Hi @Indigo744 ,

You are right, thanks, I just saw it in the travis log. It's now fixed (I also fixed the conflict)

@Indigo744
Copy link
Collaborator

It is a good fix :) I'll go ahead and squash it to master.

@Indigo744 Indigo744 merged commit d5c1d6e into master Oct 26, 2017
@neveldo neveldo deleted the feature/improve-margin-option-for-text-position branch November 11, 2017 20:28
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