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

Dispatch an 'updatefeature' from the vector source #2742

Merged
merged 1 commit into from
Sep 25, 2014

Conversation

fredj
Copy link
Member

@fredj fredj commented Sep 23, 2014

Comments welcome

@fredj
Copy link
Member Author

fredj commented Sep 23, 2014

If we now have a updatefeatureevent does it make sense to keep the change event ?

@elemoine
Copy link
Member

The source emits a change event when a feature is changed, but also when a feature is added to the source or removed from the source. And the whole rendering process relies on change events right now, so, yes, without a major refactoring, we still need the change event type.

@gberaudo
Copy link
Member

Working great thanks @fredj.

@ahocevar
Copy link
Member

Nice, please merge!

fredj added a commit that referenced this pull request Sep 25, 2014
Dispatch an 'updatefeature' from the vector source
@fredj fredj merged commit aafe50c into openlayers:master Sep 25, 2014
@fredj fredj deleted the updatefeature branch September 25, 2014 07:20
@elemoine
Copy link
Member

I agree with this change.

Making vector sources emit updatefeature events is a convenience, as a same could be achieved by listening to addfeature and removefeature on the source, and change on the individual features. But that definitely makes things easier for people.

One small thing though: wouldn't changefeature be a better name than updatefeature? By "better" I mean more consistent with our use of change everywhere else. Features emit change events so it makes sense to me that the source emits changefeature events. This is minor, but I thought I could still mention it.

@fredj
Copy link
Member Author

fredj commented Sep 25, 2014

@elemoine yes changefeature is a better name

@elemoine
Copy link
Member

Thanks @fredj. @ahocevar if you agree as well I'll create a PR.

@ahocevar
Copy link
Member

No strong opinion on the name, whatever sounds better to you guys.

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.

None yet

4 participants