zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.12k stars 426 forks source link

Straight lines #239

Closed tskomudek closed 3 years ago

tskomudek commented 3 years ago

Hi,

i'm trying to connect markers with straight lines instead of curved ones, but with the current api i didn't manage to find any properties or other ways to get this done. Is the buildCurves - function still available ?

Thanks a lot Tilo

zimrick commented 3 years ago

Hi @tskomudek,

The Line component in react-simple-maps will always try to draw a geo-line, so it will be curved according to the projection you are using.

You can use this custom solution though, if you want to just draw a simple straight line between a set of geographic points on the map:

https://codesandbox.io/s/lines-connecting-dots-2xddh?file=/src/MapChart.js

Hope this helps with your specific case

tskomudek commented 3 years ago

Hi @zimrick,

this is exactly what i was hoping for. Thanks a lot and great work! T.