Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am implementating some built in features of google map in my custom map such as direction service as following
JavaScript
var menu =[{item:"Direction from Here",from:{},to:{},getDirection:function(){
                            var directionsDisplay;
                            var directionsService = new google.maps.DirectionsService();
                             directionsDisplay = new google.maps.DirectionsRenderer();
                             directionsDisplay.setMap(map);
                        var request = {
                        origin: this.from,
                        destination: this.to,
                        travelMode: google.maps.TravelMode.WALKING
                      };
                      directionsService.route(request, function(result, status) {
                        if (status == google.maps.DirectionsStatus.OK) {
                          directionsDisplay.setDirections(result);
                        } else {
                          alert("couldn't get directions:" + status);
                        }
                      });    
                }}];


I want to know how to implement Measure distane service with splittable polyline ruler that can be available in maps.google.com as in following figure
http://i.stack.imgur.com/iuIbD.png[^]

Please Help me.

What I have tried:

I am currently implementing poly line between markers on map. But I want to use built in google service.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900