Skip to content

feat: add editor#removeControl#266

Merged
oterral merged 1 commit into
geops:masterfrom
megawac:remove-control
May 10, 2024
Merged

feat: add editor#removeControl#266
oterral merged 1 commit into
geops:masterfrom
megawac:remove-control

Conversation

@megawac
Copy link
Copy Markdown
Contributor

@megawac megawac commented Aug 9, 2023

Add editor#removeControl as an inverse to #addControl. This method will remove the control from the editor and map; it will also unregister all the events that will have been subscribed to.

Others

  • It's not a hack or at least an unauthorized hack :).
  • Everything in ticket description has been fixed.
  • The author of the MR has made its own review before assigning the reviewer.
  • The title is formatted as a conventional-commit message.
  • Tests added.

IMPORTANT: Squash commits before or on merge to prevent every small commit being written into the change log. The Pull Request title will be written as message for the new commit containing the squashed commits and there fore needs to be in conventional-commit format

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openlayers-editor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2023 4:37pm

@cvargas-xbrein
Copy link
Copy Markdown

PLS ADD

Comment thread src/editor.js
* @private
*/
activeStateChange(ctrl) {
activeStateChange = (e) => {
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.

bind the function in constrcuto. I will make it on master after the merge

Copy link
Copy Markdown
Contributor

@oterral oterral left a comment

Choose a reason for hiding this comment

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

Makes also sense, I will add the coding style after the merge and use this new function in the remove function of the editor.

@oterral oterral merged commit cd4c777 into geops:master May 10, 2024
Comment thread src/editor.js
* @param {ole.Control} control The control.
*/
removeControl(control) {
control.deactivate(true);
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.

Is there any reason to use the silent mode. I suppose you want that the listneer is triggered so other page elements can react of the deactivation ?

megawac pushed a commit to megawac/openlayers-editor that referenced this pull request Jun 21, 2024
* github/master: (35 commits)
  chore: at least make sure the demo can draw a point
  chore: fix use of custom layer
  chore: fix demo
  chore: fix changelog
  chore(release): 2.4.2
  chore(release): 2.4.2-beta.1
  fix: listen only when possible
  chore(release): 2.4.2-beta.0
  fix: unlisten only when possible
  chore(release): 2.4.1
  fix: fix editor.remove and add a test
  chore: updates peer depedencies
  chore: updates readme
  chore: updates readme
  chore(release): 2.4.0
  feat: add extentFilter property  in CAD control
  test: add test for editor
  chore: we are not responsible of bad input of the user
  chore: we are not responsible of bad input of the user
  feat: add editor#removeControl (geops#266)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants