How to get all visible markers on current zoom level

前端 未结 6 1789
情深已故
情深已故 2020-12-04 08:05

Here are some points:

  1. I have some markers on the map and records associated with it on the right panel besides the map. They are connected via numeric id, whic
6条回答
  •  独厮守ぢ
    2020-12-04 08:38

    My code snippet

    private boolean isAnyMarkerVisible(LatLng ll) {
        if(gMap != null && markersData != null) {
            final LatLngBounds latLongBounds = LatLngBounds.builder().include(ll).build();
            for (Store store : markersData) {
                if (latLongBounds.contains(store.getLatLng())) {
                    return true;
                }
            }
        }
        return false;
    }
    

提交回复
热议问题