diff --git a/demo/main-bundle.js b/demo/main-bundle.js index e432af3..3d63a04 100644 --- a/demo/main-bundle.js +++ b/demo/main-bundle.js @@ -801,7 +801,7 @@ function svgPointToCoordinate(point, svgMeta, options, svgTransform) { point1 = new Vector2_1.default(transformedPoint.x, transformedPoint.y); } var aspect = svgMeta.width / svgMeta.height; - var outputPoint = new Vector2_1.default((point1.x - svgMeta.x) / (svgMeta.width * aspect), (point1.y - svgMeta.y) / svgMeta.height); + var outputPoint = new Vector2_1.default((point1.x - svgMeta.x) / svgMeta.width, (point1.y - svgMeta.y) / (svgMeta.height * aspect)); var scale = options.width / constants_1.EARTH_CIRCUMFERENCE; var centerPoint = (0, projections_1.mercator)({ lon: options.center.longitude, lat: options.center.latitude }); outputPoint = outputPoint diff --git a/dist/utils.js b/dist/utils.js index ac8f7d1..b42799a 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -38,7 +38,7 @@ function svgPointToCoordinate(point, svgMeta, options, svgTransform) { point1 = new Vector2_1.default(transformedPoint.x, transformedPoint.y); } var aspect = svgMeta.width / svgMeta.height; - var outputPoint = new Vector2_1.default((point1.x - svgMeta.x) / (svgMeta.width * aspect), (point1.y - svgMeta.y) / svgMeta.height); + var outputPoint = new Vector2_1.default((point1.x - svgMeta.x) / svgMeta.width, (point1.y - svgMeta.y) / (svgMeta.height * aspect)); var scale = options.width / constants_1.EARTH_CIRCUMFERENCE; var centerPoint = (0, projections_1.mercator)({ lon: options.center.longitude, lat: options.center.latitude }); outputPoint = outputPoint diff --git a/dist/utils.js.map b/dist/utils.js.map index 5077e2f..0d3ff2e 100644 --- a/dist/utils.js.map +++ b/dist/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,qDAAuD;AAEvD,qCAAgC;AAChC,2CAAgD;AAChD,yCAAkD;AAElD,SAAgB,aAAa,CAC3B,QAA0B,EAC1B,EAA0B,EAC1B,UAAqC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AAG,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CACxE,CAAC;KACH;IAED,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,WAAsB,CAAC,CAAC;IAEtD,WAAW,GAAG,IAAI,iBAAO,CACvB,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC1B,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAC3B,CAAC;IAEF,IAAM,cAAc,GAAG,IAAA,sBAAQ,EAAC,WAAW,CAAC,CAAC;IAC7C,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AA3CD,oDA2CC"} \ No newline at end of file diff --git a/docs/functions/convertSVG.html b/docs/functions/convertSVG.html index 0401dcc..ec7205c 100644 --- a/docs/functions/convertSVG.html +++ b/docs/functions/convertSVG.html @@ -1 +1 @@ -