SAN FRANCISCO—The U.S. Navy agreed in a settlement approved Tuesday to limit where it operates certain sonar systems criticized by environmentalists as a threat to whales and other marine mammals. The settlement approved Tuesday by a federal judge in San Francisco restricts the Navy's use of low-frequency sonar to specific military training areas near Hawaii and in the western Pacific Ocean.