The following passage is from the book The Early Mapping of Hawai'i by Gary L. Fitzpatrick. There is an open-access but poorly formatted copy of the book on ulukau.org.
Could the Spanish have sailed in the neighborhood of Hawaiʻi for two hundred years without sighting the islands? One possible explanation is illustrated in a map frequently referred to as the “Spanish Chart” captured by Captain George Anson, a British commander sent to harrass Spanish commerce in the Pacific in the early 1740s (Ill. 81). The narrative of included a map entitled “A Chart of the Pacific Ocean from the Equinoctial to the Latitude of 39½d. No.” The map was based on a chart he found on the Spanish galleon Nostra Seigniora de Cabadonga captured off Cape Espiritu Santo in the Philippines on June 20, 1743. The ship had been one of two sent that year from Acapulco to Manila. Her track, as depicted on Ansonʻs chart, is indicative of the route taken by all Spanish ships on these runs. To take advantage of steady trade winds, the Manila-bound ships ran west at about ten degrees above the Equator, well below the latitude of Hawaiʻi. Acapulco-bound ships headed north out of the Philippines to the mid-thirties and kept that latitude until close to the California coast.
To the east of Hawaiʻi on this map are several islands with Spanish names. These had appeared on earlier maps in approximately the location of Hawaiʻi. When subsequent explorations proved these islands to be fictitious, several navigators speculated that they represented Hawaiʻi and assumed that the Spanish had discovered Hawaiʻi before Cook.
One explanation that appears frequently in the literature of why the Spanish could have missed seeing Hawaiʻi is that they were under strict orders to keep to the prescribed track across the Pacific. There is every reason to believe, however, that the Spanish would have been happy to have a major group like Hawaiʻi to call at on those voyages. A several month expedition exhausted the food and water supplies of even the largest ships; the health of the crew would have been improved by the resources of Hawaiʻi. Ansonʻs narrative explicitly remarks on the lack of any reference in the captured Spanish documents to a port between Manila and Acapulco.
Taking this story before the time of Anson involves much conjecture. Numerous maps have been cited by various scholars to support or reject the argument that the Spanish had indeed discovered the islands of Hawaiʻi. Dahlgren, for instance, examined dozens of historic maps and stated unequivocably that Cook was the first European to see Hawaiʻi, but Yzendoorn viewed many of the same maps and came to the opposite conclusion.
Did the Spanish have knowledge of Hawaiʻi before Cookʻs time? We may never know for sure. This much seems certain, however. If the Spanish did discover Hawaiʻi, they certainly did not mark its location accurately enough to find it again, and they apparently did not make use of the information during their numerous voyages across the Pacific.
Fitzpatrick's caption on the illustration also mentions: "Most scholars have rejected Spanish discovery, but at least one has argued strongly in favor of Spanish primacy."