Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function initialize() {
- var map = new google.maps.Map(document.getElementById('map_canvas'), {
- zoom: 8,
- center: new google.maps.LatLng(22.304634, 73.161070),
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }),
- directions = new google.maps.DirectionsService(),
- displayer = new google.maps.DirectionsRenderer({
- draggable: true
- });
- displayer.setMap(map);
- directions.route({
- origin: new google.maps.LatLng(22.304634, 73.161070),
- destination: new google.maps.LatLng(23.022242, 72.548844),
- travelMode: google.maps.DirectionsTravelMode.DRIVING
- }, function (result) {
- displayer.setDirections(result);
- });
- }
- google.maps.event.addDomListener(window, 'load', initialize);
- google.maps.event.addListener(displayer, 'directions_changed', some_method);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement