Skip to content

Add identity function type - #3274

Merged
lucaswoj merged 7 commits into
masterfrom
identity-function
Oct 4, 2016
Merged

lucaswoj merged 7 commits into
masterfrom
identity-function

Conversation

@lucaswoj

@lucaswoj lucaswoj commented Sep 29, 2016 •

Copy link
Copy Markdown
Contributor

This PR updates the version of mapbox-gl-funciton in package.json to take advantage of the new identity function type added in mapbox/mapbox-gl-function#25

cc @mollymerp @jfirebaugh @mapsam @lbud

Launch Checklist

@mollymerp mollymerp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yay!

@lbud lbud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉

@lucaswoj

Copy link
Copy Markdown
Contributor Author

@mollymerp Found a bug when this is used with color properties. Creating a test case & investigating now.

@mollymerp mollymerp modified the milestones: Denver, Edinburgh Sep 30, 2016
@lucaswoj

lucaswoj commented Oct 3, 2016

Copy link
Copy Markdown
Contributor Author

@mollymerp @lbud this is ready for another pass of 👀 when you are!

@mollymerp

Copy link
Copy Markdown
Contributor

This LGTM and tested locally wfill-color + fill-opacity 🎉

However, when you reference a property that does not exist in the source's properties object, there is no error, the feature just doesn't show up. Not sure if that is something we want to address in this PR or not.

@lucaswoj

lucaswoj commented Oct 3, 2016

Copy link
Copy Markdown
Contributor Author

However, when you reference a property that does not exist in the source's properties object, there is no error, the feature just doesn't show up. Not sure if that is something we want to address in this PR or not.

Unfortunately there is no way to determine if a property exists on a set of features. Feature properties are weakly typed and there is no distinction between null and undefined values.

@lucaswoj

lucaswoj commented Oct 4, 2016

Copy link
Copy Markdown
Contributor Author

Ready to merge this on 🍏 !

@lucaswoj
lucaswoj merged commit 812d39d into master Oct 4, 2016
@lucaswoj
lucaswoj deleted the identity-function branch October 4, 2016 19:06
@ghost

ghost commented Oct 21, 2016 •

Copy link
Copy Markdown

@lucaswoj Not sure if this follows what @mollymerp brought up, but is it possible to have a "fallback" value in-case of illegal values, like "", NULL, or even wrong colour names for colour styling, etc? It would be ugly to burn the default value into the data instead of the style. Also would rather not have to specify it twice in style, once for data with illegal values, once for legal values

@lucaswoj

Copy link
Copy Markdown
Contributor Author

@stirringhalo see mapbox/mapbox-gl-style-spec#480

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