Code example for PolygonOptions

0
			gps1.setLatitude(point.latitude); gps1.setLongitude(point.longitude);
			 
		}  
		 
		// If an area is selected, draw the rectangle 
		else { 
			// Get boundaries of the screen from the projection 
			VisibleRegion bounds = map.getProjection().getVisibleRegion();
				 
			drawRect(bounds.farLeft, bounds.farRight, bounds.nearRight, bounds.nearLeft);
			map.animateCamera(CameraUpdateFactory.zoomBy(ZOOM_OUT));
		} 
		 
		// Show a toast 
        Toast.makeText(this, "Location updated", Toast.LENGTH_SHORT).show();
	} 
	 
	private void drawRect(LatLng c1, LatLng c2, LatLng c3, LatLng c4) {
 
		// Remove previously drawn rect 
		if (rect != null) rect.remove();