Code example for CameraPosition

0
 
	private ClusteringStrategy strategy;
 
	@Before 
	public void init() { 
		Mockito.when(map.getCameraPosition()).thenReturn(new CameraPosition(new LatLng(0, 0), 8, 0, 0));
		Mockito.when(map.getProjection()).thenReturn(projection);
		Mockito.when(projection.getVisibleRegion()).thenReturn(new VisibleRegion(new LatLng(-1,-1), new LatLng(-1,1), new LatLng(1,-1), new LatLng(1,1), new LatLngBounds(new LatLng(-1,-1), new LatLng(1,1))));
 
		Mockito.when(marker1.isVisible()).thenReturn(true);
		Mockito.when(marker1.getPosition()).thenReturn(new LatLng(0, 0));
 
		Mockito.when(marker2.isVisible()).thenReturn(true);
		Mockito.when(marker2.getPosition()).thenReturn(new LatLng(50, 50));
 
		Mockito.when(marker3.isVisible()).thenReturn(true);
		Mockito.when(marker3.getPosition()).thenReturn(new LatLng(0.1, 0.1));
 
		ClusteringSettings settings = new ClusteringSettings().addMarkersDynamically(true);
		strategy = new GridClusteringStrategy(settings, map, new ArrayList<DelegatingMarker>(), refresher);
	}