The art of map making took a giant leap in 1569, when Mercator created his first world map. Precise navigation had become an important problem. Seafarers not only had no GPS, they didn’t even have accurate clocks that would allow them to determine their longitude. One of the few reliable tools was, sadly, the compass. Therefore, a safe way to travel was to head in a direction of constant bearing, like say 20 degrees west of North.
The problem, then, is: If you do that, where do you end up? On a sphere, the curves that make constant angle with the meridians, are called loxodromes. Mercator’s accomplishment was to find a map of the earth where all these loxodromes become straight lines. So, when you wanted to travel from A to B, you just had to find A and B on Mercator’s map, and measure the angle that the line through A and B makes with a longitude.
This is equivalent to finding a map projection that preserves angles and where all longitudes are vertical lines. The Greeks (and maybe civilizations before) knew the cylindrical projection which is totally amazing because it preserves area, but it does not preserve angles.
In fact, when you draw the loxodromes centered at a point on the equator on the rectangular map, you get curves that are clearly not straight (which is ok).
Nobody knows how Mercator came up with his map. It is believed that he just stretched the cylindrical projection so that the loxodromes became straight. But we don’t really know, and the reason is that the tools from calculus that are necessary to really construct this miraculous map were only developed centuries later.
There is another projection of the sphere, the stereographic projection, that was known to the Greeks. They at least knew that circles on the sphere would be mapped to circles or lines in the plane. It also preserves angles, which the Greeks could have known, because it is rather elementary. Apparently the first written proof is due to Edmond Halley in 1695 (using calculus).
The stereographic projection maps the loxodromes to logarithmic spirals (up above we use the loxodromes that connect west pole with east pole, for prettiness and later use). While the Greeks did study a few transcendental curves, the logarithmic spiral is first discussed by René Descartes in 1638 (in precisely the context of finding curves that intersect radii at constant angles), and a little later by the Bernoulli brothers, with analysis emerging.
Therefore it no surprise that the link between Mercator’s map and the stereographic projection is the (complex) exponential function (or logarithm). Today we know that it is angle preserving as one of the key features of complex analytic functions, but I don’t know who first realized this for the complex exponential function or the logarithm. Certainly Leonhard Euler deserves credit here. I doubt if it was earlier than the 18th century, even though the foundations were set by Mercator (possibly only by approximation) and Descartes centuries earlier. It is astonishing how long it takes to develop insights we now consider to be fundamental.