而我在做路径分析时,需要为用户展示详细的路径信息,由于我希望展示给用户的路径信息是中文的,具体路径分析代码如下:
public void ExcuteRouteTask()
{
if (stopsGraphicsLayer != null)
{
if (stopsGraphicsLayer.Graphics.Count > 1)
{
if (routeTask.IsBusy)
{
routeTask.CancelAsync();
stopsGraphicsLayer.Graphics.RemoveAt(stopsGraphicsLayer.Graphics.Count - 1);
}
routeTask.SolveAsync(new RouteParameters()
{
Stops = stopsGraphicsLayer,
Barriers = myBarriarGraphicsLayer,
ReturnDirections = true,
DirectionsLanguage = new System.Globalization.CultureInfo("zh-cn"),
//尽管我已经设置返回路径信息是中文,但是返回的路径信息仍然是英文的
DirectionsLengthUnits=esriUnits.esriMeters,
UseTimeWindows = false,
OutSpatialReference = MyMap.SpatialReference
});
}
}
}
下面是解决方案:
问题解答:
将zh-CN 文件夹 从
C:Program Files (x86)ArcGISDesktop10.1NetworkAnalystDirections
考到
C:Program FilesArcGISServerNetworkAnalystDirections
Rest请求时,Directions Language 属性设置为zh-CN即可