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

How to turn off map events #45

Open
dmcd opened this issue Apr 17, 2018 · 4 comments
Open

How to turn off map events #45

dmcd opened this issue Apr 17, 2018 · 4 comments
Assignees

Comments

@dmcd
Copy link

dmcd commented Apr 17, 2018

Hi @ghettovoice,
Thanks for the great library.

Is there a way to make the subscription to open layers map events optional? I'm asking because there are so many events fired from the map that the Vue Devtools chrome extension crashes when set to record events. I realise this is really an issue with Vue Devtools but I'm just wondering if you have any thoughts on this? So many events also makes it difficult to debug other events in an app.

Cheers

@ghettovoice
Copy link
Owner

Hi, @dmcd,
thank you for your response!
You are right, mainly it is an issue with DevTool because it dig into vue components subscribes to each event vuejs/devtools#449.
Currently the only workaround is events filtering or disabling, I know it's not a best solution, but throttling some map events from vuelayers can lead to laggy animation and other artifacts.
I can try to add Object.freeze for each event before emit, I'll test this soon and write here.
Maybe someone knows better solution, I'm open for discuss.

@ghettovoice
Copy link
Owner

Object.freeze doesn't work.
Event object in Vue isn't reactive, so it doesn't facilitates DevTool life

@dmcd
Copy link
Author

dmcd commented Apr 19, 2018

Thanks for looking into this. Hopefully they'll resolve vuejs/vue-devtools#449.

FYI, the issue with devtools is exasperated in the vuelayers-demo because of the animating flag marker, to the point where I couldn't disable the events in devtools fast enough to avoid it crashing. Instead I had to first comment out the render in the demo App.vue, line 360.

    onMapPostCompose ({ vectorContext, frameState }) {
      ...

      // this.$refs.map.render()
    },

@stale
Copy link

stale bot commented May 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants