Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var directionsService = new google.maps.DirectionsService();
- var directionsDisplay = new google.maps.DirectionsRenderer();
- var myOptions = {
- zoom:7,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }
- var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
- directionsDisplay.setMap(map);
- var request = {
- origin: '<?php echo $orgcitname; ?>',
- destination: '<?php echo $descitname; ?>',
- travelMode: google.maps.DirectionsTravelMode.DRIVING
- };
- directionsService.route(request, function(response, status) {
- if (status == google.maps.DirectionsStatus.OK) {
- directionsDisplay.setDirections(response);
- }
- });
- directionsDisplay.setMap();
- var myOptions = {
- zoom:7,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }
- var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement