  The Erd\H{o}s-Anning theorem states that every point set in the Euclidean
plane with integer distances must be either collinear or finite. More strongly,
for any (non-degenerate) triangle of diameter $\delta$, at most $O(\delta^2)$
points can have integer distances from all three triangle vertices. We prove
the same results for any strictly convex distance function on the plane, and
analogous results for every two-dimensional complete Riemannian manifold of
bounded genus and for geodesic distance on the boundary of every
three-dimensional Euclidean convex set. As a consequence, we resolve a 1983
question of Richard Guy on the equilateral dimension of Riemannian manifolds.
Our proofs are based on the properties of additively weighted Voronoi diagrams
of these distances.
