How to get rid of `Google Map direction service

2019-03-07 09:55发布

问题:

The Google map Direction Service Api has two "side effects",

1- it adds Markers automatically to origin and destination.

2- it adds two InfoWindow to the new Markers, containing their addresses.

Any idea how to get rid of theese Markers and their infoBubble?

回答1:

Add suppressMarkers: true to the DirectionsRendererOptions

suppressMarkers | boolean |Suppress the rendering of markers.