Code example for Marker

Methods: equalsgetPosition

	public void onMarkerDragEnd(Marker marker) {
		LatLng p1 = marker.getPosition();
		LatLng p2 = null;
		if (marker.equals(m1)) {
			p2 = m3.getPosition();
		} else if (marker.equals(m2)) {
			p2 = m4.getPosition();
		} else if (marker.equals(m3)) {
			p2 = m1.getPosition();
		} else if (marker.equals(m4)) {
			p2 = m2.getPosition();
		// Make sure the top left corner is the maximum latitude and minimum longitude, etc 
		drawRect(new LatLng(Math.max(p1.latitude, p2.latitude), Math.min(p1.longitude, p2.longitude)), 
				new LatLng(Math.max(p1.latitude, p2.latitude), Math.max(p1.longitude, p2.longitude)), 
Stop searching for code, let great code find you!  Add Codota to your java IDE