0

これを使用して、クラウドモードとリーフレットを使用して2点間のルートを見つけることができます。 https://gis.stackexchange.com/questions/49608/cloudmade-routing-with-leaflet-route-is-not-displayed/

しかし、最初のポイントから最後のポイントまでの移動にかかる距離と時間も知りたいです。

4

2 に答える 2

0

この関数を参照します... 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());

}

于 2013-03-20T11:09:35.937 に答える
0

field を持つcallback getRouteparameterを参照してください。これは fieldを持ちますが、それは直接距離だと思います。したがって、サブルート距離に等しい項目 (id )を持つフィールドもあります (要約すると、実際の距離でなければなりません)。ドキュメントを参照してください: http://developers.cloudmade.com/wiki/routing-http-api/Response_structureresponseroute_summarytotal_distanceresponceroute_instructionslength1

于 2013-03-18T15:52:48.243 に答える