The entire process is quite a bit more complex than the question, so let me briefly describe it:
An SVG overlay of map features is parsed.
Each path is converted to WKT using SVG-to-WKT and then parsed into a GeoJSON Polygon by Terraformer.
The coordinates of that Polygon are each converted from pixel values to latitude and longitude using the below function pixelToLatLng
(I forgot which article I derived that from). The pixel size was completely arbitrary and I don't particularly like that solution, especially as I haven't tested with other SVGs.
function pixelToLatLng(coords) {
var pixelSize = 0.00002;
var upperLeftCoord = [151.3358, -32.6615]; // Reference point for SVG viewbox
var x = upperLeftCoord[0] + (parseFloat(coords[0]) * pixelSize);
var y = upperLeftCoord[1] + (parseFloat(coords[1]) * pixelSize);
return [x, y];
}
These values are used to create a Feature and in turn a FeatureCollection which is then added to a Google Maps data layer.
The issue is that the drawn data layers are slightly stretched vertically. I realise this is due to the mercator projection, but I'm having trouble determining what I need to convert and at what point I should do it.