-
Notifications
You must be signed in to change notification settings - Fork 300
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
getClusters returns 0 or 1 points when given 2 #165
Comments
Can you provide a minimal live test case (e.g. on JSFiddle) for this? |
It also seems getCluster returns an empty array when given a single point |
I think that I'm running into this issue as well, but it seems to work in production. @AsnelChristian were you able to resolve your issue? |
Nope @mikeslinkman , I wasn't able to get a fix for this. and had to switch to a different lib. |
I have had a similar problem. I was not receiving points on a lower zoom level but I was receiving them on a higher one. I changed my radius to a higher number and that fixed the problem for me. Points that where before excluded are now part of the same cluster. |
@AsnelChristian: Regarding your JSFiddle:
This code hits a numerical precision issue. To see this, change your one line Although the LatLngBounds.extend() method tells us it will
which would seem to indicate the LatLngBounds object would always be mutated to be inclusive of the points, the JSFiddle shows it's not so. One guess would be that the search bounds test goes wrong by one or two least-significant bits of a floating-point abscissa. A workaround is to subtract or add some small epsilon to all the corners of the search box. My p.s. I tried updating the JSFiddle's use of mapbox-gl-js/v1.11.0 to the latest v2.1.1, but saw the same failure. |
what is the library? |
I havent switched libraries for this if I remember correctly. So supercluster and mapbox |
@mikeslinkman sorry, why can't a cluster with a zoom of 5-6 display clusters? I logged the whole tree and there is clusters on these zooms, but on the bbox that I give it - it cannot display the clusters... |
|
Like I've just said, I haven't switched libraries. Still using the ones mentioned above. In regard to your question about the zoom levels I would not know either since I'm pretty sure I don't have that issue |
@AsnelChristian what is the library? |
sorry , accidentally pinged the wrong person 2 times |
I am trying to represent random points on a map using superclusters and mapbox.
I ran into an issue while testing for the two points:
[ -60.44, -1.77]
and[-55.44, -5.77]
; runninggetClusters
with a supercluster instance set up as follows:Returns a single point (not cluster of 2) at zoom > 5
The text was updated successfully, but these errors were encountered: