Changing the infoWindow when using google directions

后端 未结 1 1565
广开言路
广开言路 2020-12-19 11:52

I am currently using googles directions API, it works fine, and plots 8 waypoints onto my map with the route using this line of code:

    directionsDisplay.s         


        
相关标签:
1条回答
  • 2020-12-19 12:21

    Use the {suppressInfoWindows: true} option to the DirectionsRenderer, add a click listener to the map to display what you want in an InfoWindow. You may want to use {suppressMarkers:true} and create your own Markers so you can attach the click listener to the marker.

    Example with custom markers (more complicated than you need, but it shows how to create custom markers with infowindows)

    Example with custom markers and a waypoint

    0 讨论(0)
提交回复
热议问题