Leaflet Graphhopper禁用指令

Leaflet Graphhopper禁用指令,leaflet,graphhopper,leaflet-routing-machine,Leaflet,Graphhopper,Leaflet Routing Machine,在我的项目和Graphhopper服务器中,我正在使用传单路由机器库进行路由。在我的浏览器中检查网络时,库总是从graphhopper服务器收到一个响应,参数“instructions”为true,但我在项目中不使用指令,如何禁用它?查看,我读到: var computeInstructions = /* Instructions are always needed, since we do not have waypoin

在我的项目和Graphhopper服务器中,我正在使用传单路由机器库进行路由。在我的浏览器中检查网络时,库总是从graphhopper服务器收到一个响应,参数“instructions”为true,但我在项目中不使用指令,如何禁用它?

查看,我读到:

        var computeInstructions =
            /* Instructions are always needed, 
               since we do not have waypoint indices otherwise */
            true,

        ... 

        return baseUrl + L.Util.getParamString(L.extend({
               instructions: computeInstructions,
               ...
您可能希望获取该代码的本地副本,更改
computeInstructions
变量的值,并查看是否一切正常,或者是否一切(或至少航路点显示)都如源代码注释中所示@Liedman中断。

查看,我读到:

        var computeInstructions =
            /* Instructions are always needed, 
               since we do not have waypoint indices otherwise */
            true,

        ... 

        return baseUrl + L.Util.getParamString(L.extend({
               instructions: computeInstructions,
               ...

您可能希望获取该代码的本地副本,更改
computeInstructions
变量的值,并查看是否一切正常,或者是否一切(或至少航路点显示)都如源代码注释中所示@Liedman所示中断。

我在代码中找到了一个解决方案;在L.Routing.Control对象的选项中 我补充说:

router: L.Routing.graphHopper('', {
         urlParameters : {
             instructions : false
     }
})

它运行良好

我在代码中找到了一个解决方案;在L.Routing.Control对象的选项中 我补充说:

router: L.Routing.graphHopper('', {
         urlParameters : {
             instructions : false
     }
})
而且很好用