Waypoint Style with the Google Maps API

I created an application that displays waypoints on Google Maps, and then using the API, I show the root and navigation for each waypoint.

But I want to stylize every waypoint ... specifically give everyone a unique name. This can be done when you add a marker, but I do not see to do this using a waypoint.

Are there any workarounds or am I missing something?

+4
source share
1 answer

You can't seem to style them. My solution was to disable route markers for waypoints by setting supressMarkers: true to google.maps.DirectionsRenderer :

 var directionsDisplay = new google.maps.DirectionsRenderer({ suppressInfoWindows: true, suppressMarkers: true, map: map }); 

Then loop over your waypoints and marker for each, in the style you like.

+3
source

Source: https://habr.com/ru/post/1444062/


All Articles