Please, help!!! I read - How to get all visible markers at the current zoom level , but I have more than 2000 markers on the map, and my application is very slow.
Is there any other solution?
code -
public boolean isVisibleArea(final Marker marker) { final LatLngBounds.Builder bld = new LatLngBounds.Builder(); final VisibleRegion visibleRegion = mMap.getProjection().getVisibleRegion(); bld.include(visibleRegion.farLeft) .include(visibleRegion.farRight) .include(visibleRegion.nearLeft) .include(visibleRegion.nearRight); return bld.build().contains(marker.getPosition());
}
I'm not sure if this is really faster, but this code is definitely clean:
public boolean isVisibleOnMap(LatLng latLng) { VisibleRegion vr = mMap.getProjection().getVisibleRegion(); return vr.latLngBounds.contains(latLng); }
Source: https://habr.com/ru/post/1500666/More articles:Accessing relationships from templates using ember-data 1.0.0 beta - ember.jsHow to properly handle resources in AngularJS 1.2? - angularjsto choose dispersed diffusers from points distributed in the plane - optimizationno postgresql username specified in starter pack - javato prevent an error when the target database is in recovery mode (sql preparation) - sqlCan jenkins tell history with jUnit and nUnit test results in one project - junitloop excel sheets and rows in Python - pythonSQL LIKE% NOT SEARCHING - c #Is it better to use jpeg_write_scanlines with multiple scan lines at once? - cWikidata API: check if Wikivoyage article is related to Wikidata - mediawikiAll Articles