How to change strokeColor between points when using DirectionsRenderer

旧巷老猫 提交于 2019-12-04 21:04:48

In order access DirestionsRendererOptions right in component, you need to use options prop, like that:

<DirectionsRenderer
  directions={props.directions}
  options={{
      polylineOptions: {
          strokeOpacity: 0.5,
          strokeColor: '#FF0000',
      },

  }}
/>

Please see the documentation to find out more about the options you have access to: https://developers.google.com/maps/documentation/javascript/reference/3.exp/directions#DirectionsRendererOptions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!