-
Notifications
You must be signed in to change notification settings - Fork 91
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
No clusters or pins displayed when zoomed out #116
Comments
To recreate the issue I have attached a test project: Three buttons have been created to show the problem: Button: Tapping Load Data will load the data once the map is positioned (regardless of where you position). |
thanks for reporting this! I was able to reproduce this issue using your test project. The problem was in annotation tree that was not recognizing MKMapRect spanned over international dateline. Quick fix I have made just checks for this case and splits spanning map rect into two parts. Before fixing it in actual kingpin I want to know if my fix solves your original issue. https://github.com/stanislaw/Examples/tree/20160210-kingpin-international-dateline |
Thanks Stainislaw, great work! The changes do help it looks like the pins now appear however I noticed the clustering count value seems to be off (this may be related to state of the fix). For example taking a look at north america counts vs. counts you get when positioning over the date line. |
Maybe I am missing something on your screenshots but looks like it is expected behavior of kingpin -- when you press "Load Data" multiple times on the same screen (without moving/zooming it) you will always have the same clusters (positions and counts). But when you start doing small adjustments for kingpin clustering algorithm it means change of base point from which cluster grid is calculated (it is specific drawback of grid clustering algorithm). Real kingpin partially solves this visual inconsistency of changes in clusters positions by using normalization - every time you do panning (left-right-top-down without zooming) kingpin always uses base point from invisible grid of cluster size (one which is set using In this application with "Load Data" you recreate annotation from scratch every time that's why you see those fluctuations as it is base point for algorithm computation that changes. In real application you will only have to call I believe this sounds obscure, let me know if it somehow clarifies your confusion :) |
I may have caused the confusion by putting together the image and not adding enough detail. In total for the test project there are 115 annotations, which appear correctly if you load data from North America (not over the dateline). However if you load data from the dateline the counts for the clusters are about 390 annotations. The counts for the number of annotations look to double or triple up when you are over the international date line and are correct when you are not over the date line. Im looking into this more but annotationsInMapRect may be returning the same annotations for both the left and right annotation. [annotationsLeft arrayByAddingObjectsFromArray:annotationsRight] |
@smahmoodpbm thanks for reviewing this thoroughly. Indeed it was my quick fix based on what Kent Beck calls Obvious Implementation but without any tests :) Now I have made it to handle remaining edge cases correctly. Try the latest branch: 20160210-kingpin-international-dateline. |
If everything is fine, I'll add this proper implementation with tests to kingpin here. |
@stanislaw Thanks!! Everything looks good to add to the proper implementation. |
@smahmoodpbm, I have just released 0.3.2 having this fix. |
Issue: when viewing clusters over the international dateline clusters and pins disappear. This issue can be recreated with the following steps:
The text was updated successfully, but these errors were encountered: