Code example for GoogleMap

Methods: getProjection

0
	@Override 
	public boolean dispatchTouchEvent(MotionEvent event) {
       	if (event.getAction() == MotionEvent.ACTION_DOWN) {
    	    long thisTime = System.currentTimeMillis();
    	    if (thisTime - mLastTouchTime < 250) {   	
    	    	VisibleRegion vr = mMap.getProjection().getVisibleRegion();
    	    	double left = vr.latLngBounds.southwest.longitude;
    	    	double top = vr.latLngBounds.northeast.latitude;
    	    	double right = vr.latLngBounds.northeast.longitude;
    	    	double bottom = vr.latLngBounds.southwest.latitude;
 
    	    	int minGridLong = (int)(left+180);
    	    	int maxGridLong = (int)(right+180);
    	    	int minGridLat  = (int)(bottom+90);
    	    	int maxGridLat  = (int)(top+90);
    	    	 
    	    	MapArea mapArea = new MapArea(minGridLat, maxGridLat, minGridLong, maxGridLong);
    	    	// Populate the map in asynchronous task, otherwise the rest of 
    	    	// the application will freeze while fetching data. 
    	    	new PopulateMapArea(this, mMap, mapArea).execute();
 
    	    	mLastTouchTime = -1;
    	    	 
    	    	return true; 
    		} else { 
Experience pair programming with AI  Get Codota for Java