DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Annotations not correctly inserted into quad tree

Open hwiesmann opened this issue 12 years ago • 0 comments

The insertion algorithm of annotations into the quad tree does not take rounding errors (especially when converting from floats to doubles) into account and therefore fails to insert annotations. This in turn leads to the effect that some annotations remain invisible. Especially all annotations are effected that have the same locations as a quad tree's quad or have only points on the edges of the quad.

As an example you might try to add a rectangle (polygon) to a map view with the coordinates

planetBounds.origin; planetBounds.origin+0.5f_(planetBounds.size.width;0); planetBounds.origin+0.5f_(planetBounds.size.width;planetBounds.size.height); planetBounds.origin+0.5f*(0;planetBounds.size.height).

To overcome this issue the test rectangles of the quad tree (north-west, north-east etc.) have to be slightly enlarged for annotation intersection testing.

hwiesmann avatar Aug 25 '13 08:08 hwiesmann