Search code examples
androidandroid-mapview

How can I determine if a geopoint is displayed in currently viewable area?


Say I have mapview control in my Android app. If I know a landmark exists at a certain latitude and longitude, how can I determine if that landmark is currently viewable on the user's screen? Is there a method for getting the coordinates for the top left and bottom right corners of the visible area?


Solution

  • You can project GeoPoint to Point and check if it is box (0, screen width) by (0, screen height)

    See: https://developer.android.com/reference/com/google/android/gms/maps/Projection.html