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

getCurrentViewPortBox should not use canvas height / width, breaks supercluster #54

Closed
raysuelzer opened this issue Aug 14, 2018 · 1 comment

Comments

@raysuelzer
Copy link
Contributor

raysuelzer commented Aug 14, 2018

When changing the zoom level in the browser, the canvas height / width no longer accurately describes the accurate viewport box of what objects should be visible.

See: https://github.com/stepankuzmin/mapbox-gl-js/blob/master/src/ui/map.js#L1523

The result of this is that when markers or clusters are added to the maps, if the user changes the zoom level of the browser, then markers disappear from the map when they should still be visible.

For example, go to the demo here:
https://wykks.github.io/ngx-mapbox-gl/demo/ngx-marker-cluster
and set the zoom on the browser to 50%, you will see half the of the clusters completely disappear.

In order to get an accurate representation of the viewport box, the style property should be used to get the viewport box.

https://github.com/Wykks/ngx-mapbox-gl/blob/master/projects/ngx-mapbox-gl/src/lib/map/map.service.ts#L476-L477

@Wykks
Copy link
Owner

Wykks commented Aug 16, 2018

Indeed! I'll fix that asap :)

@Wykks Wykks closed this as completed in a864d3f Sep 9, 2018
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