Question

I'm using Google Map API to display my route. I have an array of way points. Because I need to use optimizeWaypoints, so all stopover of all markers have to be set to true. By doing that, Google Map automatically creates a marker at each way point, with click event to show info window.

My question is, how can I customize those auto generated markers? For example, if I want to change the content of those info windows, what should I do?

Thanks a lot for your help :)

No correct solution

OTHER TIPS

There is no implemented option to customize these markers.

The content of the infoWindow may be modified by using a custom infoWindow(via the infoWindow-option of the DirectionsRenderer ), listen to the domready-event of the InfoWindow and modify the content....but this InfoWindow will also be used by the origin/destination-markers, there is no way to differentiate these markers from waypoint-markers.

The best you can do is to use the suppressMarkers-option to hide the automatically generated markers, and create the markers on your own based on the DirectionsResult.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top