mephinet commented on issue #10253: URL: https://github.com/apache/echarts/issues/10253#issuecomment-996765580
I checked what Python's geopandas is doing, and copied their algorithm cf https://github.com/geopandas/geopandas/blob/v0.10.2/geopandas/plotting.py#L390 - and now my map is perfectly shaped. 1. you need the bounding box of the GeoJSON. If it's not contained in the file, you'll need to calculate it manually 2. calculate the correct aspectScale using this algorithm: ```ts const y_coord = (bounds[1] + bounds[3]) / 2; const aspect = Math.cos(y_coord * Math.PI / 180); ``` 3. add this property to your series: ```ts {type: "map", aspectScale: aspect, ...} ``` @mathiasleroy Maybe you can validate my solution? If so, I could try to make a pull request out of it... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
