0

This is the code I use. I produce alternate roots and paint in different colors. But the screen does not work.

Which part is wrong. If you set the response to direction, it draws a single path.

https://stackblitz.com/edit/react-alonzm?embed=1&file=index.js

  • When I run your app in stackblitz, I get the error: "Cannot read property 'maps' of undefined." – Iavor Apr 11 '18 at 13:46
  • I do not know the reason for the error, but you can correct the error by deleting ; on line 43. – Ahmet Kuşlular Apr 12 '18 at 14:48
  • Have you tried rendering each route with a separate DirectionsRenderer? Check [this question and answer](https://stackoverflow.com/questions/17909399/display-multiple-routes-on-google-map) out. – Iavor Apr 12 '18 at 15:00
  • That's not exactly what I want. I want to show all of the alternate routes generated on the render map at the same time. like this [link](https://stackoverflow.com/a/39268344/8404390) – Ahmet Kuşlular Apr 12 '18 at 15:16

0 Answers0