Search code examples
google-mapsreact-native-maps

Polyline and Overlay bearing features together


I'm using react-native-maps and I need to use the Polyline feature and the Overlay component's bearing option together. But so far I couldn't find a library version with the both features. I have tried some versions of the library,

version 0.27.1

✅ Can show the root path using the Polyline

❌ Cannot rotate the Overlay using the bearing prop


Versions 0.28.0 and 0.29.0

✅ Can rotate the Overlay using the bearing prop

❌ It throws an error when using Polyline. (Throws this error)

Anyone can help?


Solution

  • I solved it by using react-native-maps@0.29.0.

    And setting the lineDashPattern as below,

    <Polyline
      ...
      lineDashPattern={[1]}
    />
    

    Now both Polyline and bearing in Overlay are working fine together