构建折线,显示行驶过的路线,并显示每段路线的距离。
注意事项
注意创建线型点位数据的组织方式,该方法在API文档的位置是在Creator属性中,如果你只在下拉列表中找是找不到的,要点击到该对象上才看得到。。。
需求分解
创建线型点位数据
创建颜色
创建折线
计算两点的中点并创建标签
方法说明
SGWorld66.Creator.GeometryCreator.CreateLineStringGeometry(Vertices);
创建线型字符串数组数据,详见API,下面写出两种方式
SGWorld66.Creator.CreateColor(Red,Green,Blue,Alpha);
创建颜色
SGWorld66.Creator.CreatePolyline(Geometry,LineColor,AltitudeType,GroupID,Description);
创建折线
SGWorld66.CoordServices.GetDistance(X1,Y1,X2,Y2);
获取两个点位之间的水平距离
Jsp源码
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
/**
* 初始化
*/
function Init()