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

Question on how to manage events on layers components #185

Closed
t-rosa opened this issue Sep 15, 2023 · 2 comments
Closed

Question on how to manage events on layers components #185

t-rosa opened this issue Sep 15, 2023 · 2 comments

Comments

@t-rosa
Copy link

t-rosa commented Sep 15, 2023

Hello!

I'm learning to use open layers with rlayers and wanted to know the right way to use the "once" and "on" events.

For example I could easily use "onPostRender" on a "RLayerVectorImage" component but there is no props for "oncePostRender" where with the basic open layers api I could have done something like this: "layer.once('postrender', () => {})".

I've also noticed that some events aren't referenced in the props for certain components, for example "onPostRender" doesn't exist for the "ROSM" component, is this normal? I wondered if it was relevant to my case to extend rlayers for this kind of thing.

At the moment I'm using the rlayers components with events if they're available at the props level and if not I'm making a nested component to use the open layers api with "useOL", which results in a bit of a weird mix.

I haven't gone through the docs and the rlayers api very much yet, so if you have any suggestions on how to go about it, I'd love to hear from you!

@mmomtchev
Copy link
Owner

If you feel that you need them, you can add them. But be aware that unit testing of this feature won't be simple.

@t-rosa
Copy link
Author

t-rosa commented Sep 15, 2023

I'd rather avoid extending rlayers if possible, I think I'll manage without it.
Thanks for the quick reply

@t-rosa t-rosa closed this as completed Sep 15, 2023
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

No branches or pull requests

2 participants