Skip to content

Conversation

@robintw
Copy link

@robintw robintw commented Jun 12, 2019

This is a small change adding the ability to specify the limits to use in the options, rather than having them calculated directly from the data.

I've simply added an if statement to choose whether to do the limits calculation (if the limits weren't passed), and changed a few other bits to refer to the right limits values.

I've also done a small change to the styling logic. Previously it used if(!isNaN(featureValue)) but I had problems with this as data loaded from a GeoJSON doesn't tend to have NaN values in it, but instead has null values. It turns out that just if(featureValue) will exclude NaN, null, and undefined - which is probably the best option.

I should note here that I'm not an experienced Javascript programmer - so please let me know if things need improving or changing.

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.

1 participant