如何确定地理点是否显示在当前可见区域? [英] How can I determine if a geopoint is displayed in currently viewable area?

查看:31
本文介绍了如何确定地理点是否显示在当前可见区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的 Android 应用中有地图视图控件.如果我知道某个地标存在于某个纬度和经度,我如何确定该地标当前是否可以在用户屏幕上查看?有没有获取可见区域左上角和右下角坐标的方法?

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?

推荐答案

可以将 GeoPoint 投影到 Point 并检查是否为 box (0, screen width) by (0, screen height)

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

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

这篇关于如何确定地理点是否显示在当前可见区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆