The first ideal for a Canal via Panama came in 1529 from the Spaniard Alvaro de Saavedra.
In the meantime they sailed up the Chagres River which empties into the Caribbean Sea. They said ships could sail up the Chagres for 12 leagues. But chances are the ships did not go all that way since there were sandbars and other obstacles. So journey would continue by canoe. Once they could not go further with the canoes they would go overland to the Pacific.
The following map show the Chagres river plus the Panamanian Railroad that was built in the mid 19 century:
In Spain by royal decree in March 12 1534 it was commanded that the governor Francisco de Barrionuevo find experts who would decide if it was feasible to build a Canal to the Southern Sea (Pacific) via Panama using the Chagre river. He also had to give the Cost and time for completion. The governor reported back saying that they should improve the Chagres river and then sail ship up river. Then go overland via carts. And he did not think the two oceans at that time should be connected until defensive structures were built. Without defensive structure the door could possibly be open for the Portuguese and French.
Seems the overland route was no fun. It was very hard. Francis drake found out when he invaded Panama by crossing the isthmus.
Found out conditions on the Caribbean ports in Panama were not that good due to tropical diseases. A Spanish military Juan Antonelli thought it would be better to transport the richess of South America via Honduras Gulf of Fonseca on the Pacific and overland to the Port of Cortez on the Caribbean. Port of Cortez even today is Central Americas only deep water port.
It seem the Spanish Crown was more interested in building a Canal Via Nicaragua. In 1567 the Spanish Crown ordered a study to see the feasibility of a canal across Nicaragua. Plenty of plans were drawn up over the years but because of political decisions, wars or not enough money nothing was done.
Got most of the information from a virtual library source from Argentina. It is really informative but in Spanish:
http://bibliotecavirtual.clacso.org.ar/ar/libros/panama/cela/tareas/tar123/02arauz.pdf