2016-11-23 86 views
1

我在我的项目和Graphhopper服务器中使用Leaflet路由机器库路由。当在我的浏览器中检查网络时,库总是从参数“instructions”中得到来自graphhopper服务器的响应,但是我没有在我的项目中使用说明,我该如何禁用它?Graphhopper禁用指令

回答

0

我发现了一个解决方案,在我的代码中;在L.Routing.Control对象 的选项我说:

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

和它的正常工作

0

望着source code for the Graphhopper backend for Leaflet Routing Machine,我这样说的:

 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分解。