【问题标题】:Is the location displayed on screen - google maps on android位置是否显示在屏幕上 - android 上的谷歌地图
【发布时间】:2015-01-14 15:01:13
【问题描述】:

我有一个位置及其纬度和经度。当用户更改相机位置或缩放时,我想检查这些位置是否显示在屏幕上。如果屏幕包含这个位置,我想得到真,否则假。能确定吗?

【问题讨论】:

    标签: android google-maps


    【解决方案1】:

    最好的方法是检查你的标记是否在地图可见区域的范围内。

    Marker myPosition;//get your marker
    LatLngBounds bounds = googleMap.getProjection().getVisibleRegion().latLngBounds;
    if(bounds.contains(myPosition.getPosition())){
      //point is visible
    }else{
      //not visible
    }
    

    【讨论】:

    • 这正是我所寻找的。谢谢你。 :)
    猜你喜欢
    • 1970-01-01
    • 2015-05-11
    • 1970-01-01
    • 2013-03-24
    • 2017-05-22
    • 2013-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多