How to get the event on changing the selected route displaying in a google render container?

前端 未结 2 1359
我在风中等你
我在风中等你 2020-12-21 20:53

Here is the code :

var map = new google.maps.Map(document.getElementById(\"map_canvas\"), $scope.map_options);
var dirService= new google.maps.DirectionsServ         


        
相关标签:
2条回答
  • 2020-12-21 21:17

    UPDATE

    from this post in the v3 API group

    There is no event. There is a feature request to add that to the API:

    https://code.google.com/p/gmaps-api-issues/issues/detail?id=3565

    There should be a routeIndex_changed event, but that doesn't seem to work (and isn't documented). routeindex_changed does work, but I don't see it in the documentation.

    http://www.geocodezip.com/v3_SO_simpleMap_directions_changed.html

    0 讨论(0)
  • 2020-12-21 21:23

    Here is the event :

    google.maps.event.addListener(dirRenderer, 'routeindex_changed', 
                        function() { 
                    alert(dirRenderer.getRouteIndex());
                });
    
    0 讨论(0)
提交回复
热议问题