Thanks great share

On Thursday, March 9, 2017 at 8:43:11 PM UTC+4, Fabiano Santos wrote:
>
>
> I found this code and it solves my problem.
>
>   var location1 = new google.maps.LatLng(34.04429454929703, 
> -118.22793351693724);
>       var location2 = new google.maps.LatLng(33.688522885631706, 
> -116.15151750131224);
>
>       var location3 = new google.maps.LatLng(32.69561555501597, 
> -117.06338273568724);
>       var location4 = new google.maps.LatLng(34.525395303965354, 
> -117.27212297006224);
>
>       var map;
>       var mapOptions = { center: new google.maps.LatLng(42.5584308, 
> -70.8597732), zoom: 3,
>         mapTypeId: google.maps.MapTypeId.ROADMAP };
>
>       function initialize() {
>         map = new google.maps.Map(document.getElementById("map_canvas"), 
> mapOptions);
>         directionsService = new google.maps.DirectionsService();
>         directionsDisplay = new google.maps.DirectionsRenderer({
>           suppressMarkers: false,
>           suppressInfoWindows: true
>         });
>         directionsDisplay.setMap(map);
>
>         var request = {
>           origin: location1, 
>           destination: location2,
>           travelMode: google.maps.DirectionsTravelMode.DRIVING
>         };
>         directionsService.route(request, function(response, status) {
>           if (status == google.maps.DirectionsStatus.OK) {
>             directionsDisplay.setDirections(response);
>           }
>         });
>
>
>         //directionsService = new google.maps.DirectionsService();
>         directionsDisplay2 = new google.maps.DirectionsRenderer({
>           suppressMarkers: false,
>           suppressInfoWindows: true
>         });
>         directionsDisplay2.setMap(map);
>
>         var request = {
>           origin: location3, 
>           destination: location4,
>           travelMode: google.maps.DirectionsTravelMode.DRIVING
>         };
>         directionsService.route(request, function(response, status) {
>           if (status == google.maps.DirectionsStatus.OK) {
>             directionsDisplay2.setDirections(response);
>           }
>         });
>       }
>       google.maps.event.addDomListener(window, 'load', initialize);
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-maps-js-api-v3+unsubscr...@googlegroups.com.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
Visit this group at https://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.

Reply via email to