> Add a listener for the load event of your directions object; in the
> handler function, change the second map. Assuming you have one route,
> centre your second map at
>   gdir.getRoutes(0).getEndLatLng()

Well, i am not a pro in java-programming...

I tried this code:

<script type="text/javascript">
    var map;
    var end;
    var directionsPanel;
    var directions;

    function initialize() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(5.289191,4.568451), 10);
      directionsPanel = document.getElementById("route");
      directions = new GDirections(map, directionsPanel);

      directions.load("from: New York to: $arg1 $arg2", {locale:
"en_US"});
      end = new GMap2(document.getElementById("map_end"));
      end.setCenter(gdir.getRoutes(0).getEndLatLng(), 10);
    }
    </script>
  </head>
<body onload="initialize()">
    <td valign="top"><div id="map_canvas" style="width: 300px; height:
400px"></div>
    <div id="map_end" style="width: 300px; height: 400px"></div></td>
    <td valign="top"><div id="route" style="width: 600px"></div></td>
</body>
</html>


But is doesn´t work. If I change " end.setCenter(gdir.getRoutes
(0).getEndLatLng(), 10); "
to "end.setCenter(new GLatLng(5.289191,4.568451), 10);" the second map
is shown correct....

So, what have I to change?

Thanks

Tobi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to