Rightpoint / BentoMap

Map Clustering for Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug on result rootRect

Alex293 opened this issue · comments

Hi

It seems like there is a bug on the calculation of the rootRect returned by the quadTree. It's visible if you use less pins on the map the click on a cluster. It will zoom on the rect defined by the first pin not the rect defined by the group of pins. I don't know if i'm clear tho. I will investigate more and try to provide you a simple way to detect it.

Hi Alex,

What version are you using?

This is happening with both develop/master with last versions (downloaded from GitHub and tested 2 minutes ago). It's easy to reproduce in the demo with changing the sample data amount by 5. Sometimes it works as expected sometimes it doesn't work (let's say 1 for 4).

simulator screen shot 21 nov 2016 18 17 17

when clusterized and then unclusterized gives :
simulator screen shot 21 nov 2016 18 18 37

This is the two pins missing just below :
simulator screen shot 21 nov 2016 18 18 54

Sry for huge images :)

@Alex293 I think I nailed down the source of the bug and have a hotfix in pull request waiting for CI and code review

The bug is still present, same test 5 pins on demo project

I've found that the bug is that the rect is the good size but always shifted in south direction. IE you always need to scroll down to see the missing pins. This means that the bug come from the min/max rect position.

I'm gonna investigate this a bit

I made some changes to the sample app, in particular using mapView.mapRectThatFits(mapData.bentoBox.root, edgePadding: type(of: self).mapInsets) to calculate the maprect to display, then zooming to that. I've been testing the sample app with 6 points and have had fewer issues with pins now showing up. Let me know if it has similar results for you.

It's better but there are still case where it does not work. It's always shifted to bottom so I think there is an issue with some minimal coordinate calculations. When calculating the minimal coordinate of a cluster it use the origin coordinate but this is centred with cluster It could came from this

I just caught what was probably a copy/paste error in the coordinate lookup code, I'm testing it now but I think this may have been the root of all of the other issues

Works like a charm now !

Read those line like 20 times didn't reacted :/

Thank you for this great lib and your reactivity !