Luser_k
Luser_k

Reputation: 534

Android Maps Projection fromScreenLocation returns wrong geo position

The Google Map provides over its projection a method, which converts Point to Geo Position.

If I pass e.x. Point p = new Point(-1000,1000), I get a position like -89.3425,140.0345. The point is outside the visible region but I could not found any information if that method has a limitation to the current visible region.

Has someone a source code or more information about that ?

Upvotes: 0

Views: 501

Answers (1)

Pedro Oliveira
Pedro Oliveira

Reputation: 20500

Create a Rect with the size of your MapView and use Rect.contains(x,y) to check if the given point is inside the MapView

Remember:

The screen location is specified in screen pixels (not display pixels) relative to the top left of the map (not the top left of the whole screen).

Upvotes: 3

Related Questions