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

add in-place source addition support in addLayer #3857 #3861

Merged
merged 2 commits into from
Jan 5, 2017

Conversation

stepankuzmin
Copy link
Contributor

Hi there, @mourner and @lucaswoj! Is this a correct approach to #3857?

@mollymerp
Copy link
Contributor

Thanks for your contribution @stepankuzmin!! This looks good to me, but I will let @mourner @lucaswoj give it some 👀 before ✅

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

I like this. The only potential concern is that the passed layerObject is edited in place, which might be unexpected by users.

@stepankuzmin
Copy link
Contributor Author

stepankuzmin commented Jan 5, 2017

Another approach is to support source as an object in the layer. Would it be a better solution?

@lucaswoj
Copy link
Contributor

lucaswoj commented Jan 5, 2017

@mourner Just added a commit which clones rather than mutates layerObject. Planning to 🚢 on pass.

@stepankuzmin
Copy link
Contributor Author

Great! Thanks!

@lucaswoj
Copy link
Contributor

lucaswoj commented Jan 5, 2017

TY @stepankuzmin 😄

@lucaswoj lucaswoj merged commit ddbab04 into mapbox:master Jan 5, 2017
@lucaswoj
Copy link
Contributor

lucaswoj commented Jan 5, 2017

I've identified a some follow-ups which I'll ticket out separately:

  • add support for this syntax in the validator
  • port this feature to GL native
  • migrate GL JS examples to use this feature when it reduces boilerplate
  • write documentation about this feature
  • write code to deduplicate identical sources internally

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.

4 participants