0

I try to display information from road on mouseOver, same as infoWindow for Marker.

my code for road drawing using gmaps.js

<script type="text/javascript">
var map;
$(document).ready(function () {
        var map = new GMaps({
        div: '#map',
        lat: 33.764610, 
        lng: -78.973307, 
        });

        map.drawRoute({
        origin: [33.764471, -78.973162],
        destination: [33.771615, -78.979610],
        travelMode: 'driving',
        strokeColor: '#0F0',
        strokeOpacity: 0.6,
        strokeWeight: 10
        /* mouseover: function(e) {
                alert('You clicked in this marker');
                }  */
        });
}); 

1 Answers1

0

You need to add a listener

google.maps.event.addListener(map, 'mouseover', function()

 //Add what you want to do
 )

Then add this at the end:

google.maps.event.addDomListener(window, 'load', initialize);

The addDomListener() method binds to the window object of the browser and allows the API to communicate with objects outside of the API's normal domain.

You can read more about events here

Verma
  • 8,199
  • 2
  • 15
  • 17
  • i have already try it, but it dosen't work, and I am limited by time in my graduation project so I put a marker in each route that displays the informations. thank you anyway. – Oualid BOUTERBIAT May 05 '15 at 00:02