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

DragOverlay bug #985

Closed
jsb04 opened this issue Aug 12, 2023 · 1 comment
Closed

DragOverlay bug #985

jsb04 opened this issue Aug 12, 2023 · 1 comment
Labels

Comments

@jsb04
Copy link

jsb04 commented Aug 12, 2023

Hi,
I think there may be a bug on line 84 of DragOverlay.js:

    if (!(options.overlays instanceof Array)) options.overlays = [options.overlays];
    options.overlays.forEach(this.addOverlay.bind(this));

I think [options.overlays] should in fact be [option.overlay] as currently I get an exception:
TypeError: Cannot read properties of undefined (reading 'element')
at olinteractionDragOverlay.addOverlay (DragOverlay.js:96:1)

I think this is because the addOverlay call on line 85 is receiving an undefined value due to bug in line 84.
I have not been able to find a workaround or any other cause for the issue.

Any confirmation or help would be appreciated.

Viglino added a commit that referenced this issue Aug 16, 2023
@Viglino
Copy link
Owner

Viglino commented Aug 16, 2023

Are you sure you pass an ol/Overlay or an array of ol/Overlay when you create the DragOverlay interaction?
Do you have an online example ?

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

No branches or pull requests

2 participants