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

clustering groups changes frequently #118

Open
3 tasks done
wasimshigri opened this issue Sep 3, 2019 · 5 comments
Open
3 tasks done

clustering groups changes frequently #118

wasimshigri opened this issue Sep 3, 2019 · 5 comments

Comments

@wasimshigri
Copy link

With a minimum interaction it re-clusters the spots. also the groups are different each time when the map comes back to same location and same zoom level. it should always do the same groupings.

  1. There should be a variable for sensitivity which should control the clustering sensitivity on zoom change.
  2. algorithm should be updated so that it should do groups same each time for same location and same zoom level.

New Issue Checklist

Issue Description

Environment

  • iOS Version: [INSERT iOS VERSION HERE]
  • Device(s): [INSERT DEVICE(S) HERE]
@matopeto
Copy link

matopeto commented Jan 12, 2021

I have same issue, i think it is caused by: #130 when for every different zoom/region/positon of map are different anotations :(

@matopeto
Copy link

I make video:

RPReplay_Final1610634992.mov

There should be always 34 annotations. mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) is called correctly, with correct clusters and annotations, but on map is not some clusters rendered

Also each minimal map zoom changes regroups all clusters

@rnkyr
Copy link

rnkyr commented Feb 15, 2021

It caused by the fact that mapRects() method builds a list of rects dependant on a viewport

so, if you zoom to a level N, then zoom to a level N + m and then get back to the level N you won't get the same rect, hence you'll get different clusters/pins

is there any suggestion on how to improve this behavior?

@rnkyr
Copy link

rnkyr commented Feb 16, 2021

ok, I was able to improve the overall picture by rounding the scale factor (

let scaleFactor = zoomScale / cellSize(for: zoomLevel)
) to the nearest non-zero digit. the function that does that can be found at https://stackoverflow.com/a/32194113/5247504

@matopeto
Copy link

matopeto commented Feb 16, 2021

But one thing is cluster changing another is non rendered culusers :(

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

3 participants