# How to reproduce geodesic transformation in Google Maps API

I need to show points on country map of Russia, but not in Mercator projection, it should be in usual view, be more real (like we see it everywhere every day). Trying to figure out different projections, transformations and etc, I've created a test page with Google Maps and deogesic polygon with geojson points of the country, move it to equator and got usual form of Russia, that suits me. Google Maps performs all transformations for me, I just need to mark this poligon as geodesic. But problem is there is no API to convert coortinates in the same way and I don't know how to recalculate coords of particular point, which I pick on Mercator map, to get that point be in right place on transformed map.

After some googling I found project http://bramus.github.io/mercator-puzzle-redux/. Author created a function to move poligon with geodesic transformation. The algorythm looks pretty simple: find center of polygon, evaluate heading and distance of each point of paths, get new coordinates according to new center using spherical geometry functions. But calculations isn't precise (and author admits it): when I move country to point (0,0) and return it back, borders doesn't match (screenshots). Even center point of origin country doesn't match with same geographical point on transformed map. Here is an example - https://jsfiddle.net/unnamed777/rg7tp4zL/ . When I drag Russia, Maps API performs all transitions. Green point is center of geojson poligon (calculated by the same algorhitm as Bramus' function moveTo() via center point, heading and distance). And when I move country, new center of that poligon doesn't match with real coordinates of surface.

So, my question is what algorythm do I need to use to transform points from classic Mercator projection to that with minimal distorsion as if Russia is placed on equator? Actually, I want to end up with svg/png image of country with highlighted regions and function, that receives point picked on google maps and translates it relatively to pixels of my image (https://i.imgur.com/3xqB3Sa.png). But for the beginning I want to understand how to translate coordinates as google does with poligons.

• I'm struggling with this as well ... did you ever discover a solution? – kmurph79 Jul 22 '18 at 21:26