<p>似乎它们正在传递原始位置(current=action['current'])、目标目的地(desired=action['desired'])和语言(lang=action['lang'])。你知道吗</p>
<p>这几乎肯定会被传递给中的<a href="http://resources.arcgis.com/en/help/arcgis-rest-api/02r3/02r300000054000000.htm" rel="nofollow">ArcGIS routing REST service</a>索引.php. 基本上,它是和X,Y对以及WGS84坐标中的另一个X,Y对作为输入。WGS84坐标只是一种表达传统GPS经纬度的奇特方式。但是要特别注意这个顺序,经度(X)然后纬度(Y),因为这会让很多人感到困惑。你知道吗</p>
<p>如果你想的话,在不调用任何外部脚本(例如。索引.php). 如果使用的是请求,则端点URL为:</p>
<p><a href="http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve" rel="nofollow">http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve</a>?你知道吗</p>
<p>如果需要以下参数作为请求参数:</p>
<ul>
<li>directionsLanguage=语言</li>
<li>returnDirections=真</li>
<li>停止=x1,y1,x2,y2</li>
<li>token=在此处插入您的\u ARCGIS \u标记\u</li>
<li>f=json</li>
</ul>
<p>从当前(x1,y1)和所需(x2,y2)得到的停止坐标。令牌将来自您的<a href="http://developers.arcgis.com" rel="nofollow">ArcGIS Developer account</a>。f=json只是将返回格式设置为json而不是HTML。你知道吗</p>
<p>您的代码最终可能会如下所示:</p>
<pre><code>payload= {'stops':str(current[0],current[1],desired[0],desired[1]),
'directionsLanguage':lang, 'returnDirections': "true",
'f':'json','token': VAR_WITH_ARCGIS_TOKEN }
url= 'http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?'
</code></pre>
<p>你需要把你的答案和你的答案连接起来。您可以通过从响应体获取<em>方向</em>数组,然后遍历features数组,连接attributes对象的<em>文本</em>属性来访问这些属性。你知道吗</p>
<p>希望这能澄清。如果有问题,请留言</p>