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

Some interactions not working when map contains WebGLPointsLayer with hit detection disabled #607

Closed
jyrkka opened this issue May 25, 2021 · 1 comment
Labels

Comments

@jyrkka
Copy link

jyrkka commented May 25, 2021

When map contains WebGLPointsLaye with hit detection disabled we get lots of exception in the console such as this:

Uncaught AssertionError: Assertion failed. See https://openlayers.org/en/v6.5.0/doc/errors/#66 for details. at new AssertionError (webpack-internal:///./node_modules/ol/AssertionError.js:38:24) at assert (webpack-internal:///./node_modules/ol/asserts.js:14:15) at WebGLPointsLayerRenderer.forEachFeatureAtCoordinate (webpack-internal:///./node_modules/ol/renderer/webgl/PointsLayer.js:520:68) at CompositeMapRenderer.MapRenderer.forEachFeatureAtCoordinate (webpack-internal:///./node_modules/ol/renderer/Map.js:135:48) at Map.PluggableMap.forEachFeatureAtPixel (webpack-internal:///./node_modules/ol/PluggableMap.js:507:31)

When using EdiBar-component at least Offset, Transform and Select (when clicking map point where there is not feature), above exception is thrown. Also Hover interaction throws the same.

With the Hover-component I tried using the layers-option to filter out all other layers but it didn't seem to have any effect on the result. What is interesting is that with the OpenLayers Select-interactions I get the same, but when using the layers-option the problem goes away.

Comparing the Openlayers Select and your Hover components i can see one difference that could cause this.

In here (https://github.com/Viglino/ol-ext/blob/master/src/interaction/Hover.js) line 120, when calling forEachFeatureAtPixel-function of the map, should the options also contain layerFilter-value?

Code example: https://codesandbox.io/s/openlayers-webglpointlayer-hitdetection-9gjib?file=/index.js

@Viglino
Copy link
Owner

Viglino commented May 25, 2021

You're right. The test layer function is at the wrong place....
I fixed it in the last commit.

@Viglino Viglino added the bug label May 31, 2021
@Viglino Viglino closed this as completed Jun 15, 2021
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