0

I am able to find route between two points using cloud mode & leaflet using this. https://gis.stackexchange.com/questions/49608/cloudmade-routing-with-leaflet-route-is-not-displayed/

But I also want to find distance & time taken to travel from first point to last point.

Community
  • 1
  • 1
vaibhav shah
  • 4,939
  • 19
  • 58
  • 96

2 Answers2

0

See callback getRoute parameter response, that have field route_summary, that have field total_distance, but I think it's direct distance. So responce also have route_instructions field, that have length item (id 1), that equal to subroute distance (in summary it must be real distance). See documentation: http://developers.cloudmade.com/wiki/routing-http-api/Response_structure.

tbicr
  • 24,790
  • 12
  • 81
  • 106
0

you refer this function ... function mapload() {

            var APIKEY = '63ea548e228e44efa4cbe2cc1d82b62d';
            var map = new CM.Map('innerContainer', new CM.Tiles.CloudMade.Web({key: APIKEY}));
            screenSize();
            window.onresize = function(event) {
            screenSize();
            var resize = new CM.Size(document.getElementById('innerContainer').style.width,document.getElementById('innerContainer').style.height);
                    map.checkResize();
        map.setCenter(new CM.LatLng(11.590423, 77.817961), 15);


            }
        map.setCenter(new CM.LatLng(11.590423, 77.817961), 15);
        var directions = new CM.Directions(map, 'panel', '63ea548e228e44efa4cbe2cc1d82b62d');

        var waypoints = [new CM.LatLng(11.590423, 77.817961), new CM.LatLng(11.570621,78.745298)];
        directions.loadFromWaypoints(waypoints);
                    var topRight = new CM.ControlPosition(CM.TOP_RIGHT, new CM.Size(50, 20));
                    map.addControl(new CM.SmallMapControl(), topRight);
                    map.addControl(new CM.LargeMapControl());
                    map.addControl(new CM.ScaleControl());
                    map.addControl(new CM.OverviewMapControl());

}

tamilmani
  • 591
  • 6
  • 13