How do I change the Start and End marker image in Google Maps v3 API for Directions

后端 未结 3 1747
渐次进展
渐次进展 2021-02-19 11:26

I have a route plotted fine on using DirectionsRender but I cannot find out how to replace the generic Google markers with my own.

I know and use this in a normal Google

3条回答
  •  独厮守ぢ
    2021-02-19 11:48

    The DirectionRender takes an option called markerOptions. Quoting from the API docs:

    All markers rendered by the DirectionsRenderer will use these options.

    So, if you want to set the markers use MarkerImage (as philar has indicated).

    Your other option is to pass suppressMarkers: true to the DirectionRender's options and then simply use your own markers.

提交回复
热议问题