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 a 'condition' option to ol.interaction.Modify #5320

Merged
merged 1 commit into from May 11, 2016

Conversation

fredj
Copy link
Member

@fredj fredj commented May 9, 2016

No description provided.

@fredj fredj force-pushed the modify_condition branch 3 times, most recently from 0359852 to afb2084 Compare May 10, 2016 14:13
@fredj
Copy link
Member Author

fredj commented May 10, 2016

FYI, I need this new option to not add a vertex to a linestring when the right click is used:

new ol.interaction.Modify({
  condition: ol.events.condition.mouseActionButton,
  ...
});

Thanks for any review

@ahocevar
Copy link
Member

Wouldn't ol.events.condition.mouseActionButton be a better default than what we currently have? Also, the docs could be a bit more verbose, e.g. 'Condition that determines whether the event will be considered to add a vertex to the sketch.'.

@fredj
Copy link
Member Author

fredj commented May 10, 2016

Wouldn't ol.events.condition.mouseActionButton be a better default than what we currently have?

I suspect that ol.events.condition.mouseActionButton will break the edition on touch devices (I will check)

Also, the docs could be a bit more verbose, e.g. 'Condition that determines whether the event will be considered to add a vertex to the sketch.'.

Yes, good suggestion

@fredj
Copy link
Member Author

fredj commented May 10, 2016

That it: ol.events.condition.mouseActionButton always returns false on touch devices

@ahocevar
Copy link
Member

Ok, thanks for investigating. So let's keep the default as it is.

@fredj
Copy link
Member Author

fredj commented May 10, 2016

I've updated the code and added a ol.events.condition.primaryAction condition that works with all the devices.

@fredj fredj changed the title Add a 'condition' option to ol.interaction.Modify [wip] Add a 'condition' option to ol.interaction.Modify May 10, 2016
@fredj fredj changed the title [wip] Add a 'condition' option to ol.interaction.Modify Add a 'condition' option to ol.interaction.Modify May 11, 2016
@fredj
Copy link
Member Author

fredj commented May 11, 2016

ready for review, thanks

@ahocevar
Copy link
Member

Very nice. Please merge.

@fredj
Copy link
Member Author

fredj commented May 11, 2016

Thanks for the review

@fredj fredj merged commit d0e5b1e into openlayers:master May 11, 2016
@fredj fredj deleted the modify_condition branch May 11, 2016 15:15
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

2 participants