- SGBucket b = sgBucketOffset( lon, lat, x, y );
+ SGBucket b = sgBucketOffset( position.getLongitudeDeg(),
+ position.getLatitudeDeg(), x, y );
+ // Do not ask if it is just the next tile but way out of range.
+ if (max_dist2 < distSqr(cartPos, SGVec3d::fromGeod(b.get_center())))
+ continue;