Well, aside from taking a land route, current electric cargo ships are practical at about 930 miles, with future versions projected to be economical at about 3000 miles. Currently, delivery by ship from Costa Rica to Florida is bit over 1000 miles, so a stop would be required for a battery swap. That would require a battery swap station along the route. Technically the ideal location would probably actually be in Cuba geographically speaking, but there are obvious issues there. So somewhere on the Yucatan would make sense. Maybe Cozumel or Morelos. A slightly longer route that goes East of Cuba instead would also be practical with current electric cargo ships with a battery swap stop in Jamaica. Of course, the practical range extensions for longer routes are coming, so going from Costa Rica directly to, for example, Tampa will soon be quite practical. After that, trucking typically takes over.
For other ports, like San Diego or northern ports on the East Coast, up and coming 3000 mile range ships would be able to handle any of those ports. Even without that range though, stopping at multiple ports for battery swaps is a perfectly manageable system.
There is of course the question of the source of power. Some of the stops like Jamaica currently rely pretty heavily on imported fossil fuels for power generation. However, they have started to realize how vulnerable oil dependence makes them and how expensive it is and have been expanding renewables and are on track to rapidly transition away from fossil fuels.