[android] #3276 - add event listener on REGION_IS_CHANGING to determine the annotations in bounds of the viewport.

This commit is contained in:
Tobrun
2016-04-27 11:33:59 +02:00
parent 028ef7a323
commit 1d912a409a

View File

@@ -446,6 +446,13 @@ public class MapView extends FrameLayout {
iterator.remove();
}
}
} else if (change == REGION_IS_CHANGING) {
LatLngBounds bounds = mMapboxMap.getProjection().getVisibleRegion().latLngBounds;
long[] ids = mNativeMapView.getAnnotationsInBounds(bounds);
Log.v(MapboxConstants.TAG, "Region is changing ane we are seeing: "+ids.length+ " point annotations");
// for (long id : ids) {
// Log.v(MapboxConstants.TAG, "Marker: "+id);
// }
}
}
});
@@ -1318,6 +1325,8 @@ public class MapView extends FrameLayout {
return;
}
Log.v(MapboxConstants.TAG, "SurfaceTexture has been updated");
mCompassView.update(getDirection());
mMyLocationView.update();