Skip to content

Fix repeated val case in scattermapbox convert step #747

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

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

etpinard
Copy link
Contributor

In brief

The mapbox-gl API for arrayOk attributes (they call it data-driven 😃 ) links values in the features geojson properties field to a set of stops. These stops map the geojson properties values to mapbox-gl paint settings per feature (as opposed to a source-wide setting). Note that the stop values must be unique.

@etpinard etpinard added bug something broken status: reviewable labels Jul 15, 2016
@@ -184,7 +184,7 @@ function makeCircleGeoJSON(calcTrace, hash) {
// Translate vals in trace arrayOk containers
// into a val-to-index hash object
function translate(props, key, val, index) {
if(!hash[key][val]) hash[key][val] = index;
if(hash[key][val] === undefined) hash[key][val] = index;
Copy link
Contributor Author

@etpinard etpinard Jul 15, 2016

Choose a reason for hiding this comment

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

Here hash[key][val] store indices in of arrayOk attribute. This check ⏫ was failing if a repeated value was found in the first marker.size or marker.color item as 0 is falsy.

@theengineear
Copy link
Contributor

Thanks for jumping on this so fast! 💃!

@etpinard etpinard merged commit 7ae437b into master Jul 15, 2016
@etpinard etpinard deleted the mapbox-repeated-vals branch July 15, 2016 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants