|
|
@@ -45,11 +45,11 @@ DrawZdmAll.prototype.applyPainting = function (layer, dmxFile, zdmFile, ctrFile,
|
|
|
var text_width = 260;
|
|
|
addPolylinetoView([[startPoint[0] - text_width, startPoint[1]], endPoint], false, false, 0, this.frameColor);
|
|
|
var array = new Array();
|
|
|
- array.push({ name: "R", "space": 60, text: "竖曲线半径 (m)" });
|
|
|
+ array.push({ name: "R", "space": 100, text: "竖曲线半径 (m)" });
|
|
|
array.push({ name: "SJGC", "space": 100, text: "设计高程 (m)" });
|
|
|
array.push({ name: "DMGC", "space": 100, text: "地面高程 (m)" });
|
|
|
array.push({ name: "PDPC", "space": 100, text: "坡度 (%) 坡长 (m)" });
|
|
|
- array.push({ name: "BLZH", "space": 120, text: "百里桩号 (km)" });
|
|
|
+ array.push({ name: "BLZH", "space": 100, text: "百里桩号 (km)" });
|
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
var item = array[i];
|
|
|
var space = (item.space || 100);
|
|
|
@@ -102,6 +102,46 @@ DrawZdmAll.prototype.applyHeightMileage = function (arrayData, startPoint, space
|
|
|
}
|
|
|
}
|
|
|
DrawZdmAll.prototype.applyMileage = function (arrayData, startPoint, space) {
|
|
|
+ // 记录里程
|
|
|
+ var mileage = 0.0;
|
|
|
+ // 最小间距
|
|
|
+ var space_min = 30;
|
|
|
+ var y = startPoint[1] - space;
|
|
|
+ for (var i = 0; i < arrayData.length; i++) {
|
|
|
+ var x = arrayData[i][0];
|
|
|
+ var mileage_current = x;
|
|
|
+ if (i == 0) {
|
|
|
+ // 显示起始桩号
|
|
|
+ addSimpleTextToView(formatStake(mileage_current), [x, y + 10], 15, 90, "Standard", RS.VAlignTop, RS.HAlignLeft, false, false, 0);
|
|
|
+ addPolylinetoView([[x, y], [x, y + 5]], false, false, 0, new RColor(255, 255, 0));
|
|
|
+ mileage = mileage_current;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (mileage_current - mileage > space_min) {
|
|
|
+ // 绘画高程文本
|
|
|
+ addSimpleTextToView((round((mileage_current % 1000) * 1000) / 1000).toString(), [x, y + (space * 1 / 3) - 10], 15, 90, "Standard", RS.VAlignTop, RS.HAlignLeft, false, false, 0);
|
|
|
+ }
|
|
|
+ mileage = mileage_current;
|
|
|
+ }
|
|
|
+ // 绘制标准的百里标、千里表
|
|
|
+ var start = arrayData[0][0];
|
|
|
+ var end = arrayData[arrayData.length - 1][0];
|
|
|
+ // 下一个百里标的位置
|
|
|
+ var currentMiles = Math.ceil(start / 100) * 100;
|
|
|
+ // 循环打印百里和千里位置
|
|
|
+ while (currentMiles <= end) {
|
|
|
+ if (currentMiles % 1000 === 0) {
|
|
|
+ addSimpleTextToView("K" + Math.floor(currentMiles / 1000).toString(), [currentMiles, y + 10], 15, 90, "Standard", RS.VAlignTop, RS.HAlignLeft, false, false, 0);
|
|
|
+ addPolylinetoView([[currentMiles, y], [currentMiles, y + 5]], false, false, 0, new RColor(255, 255, 0));
|
|
|
+ } else if (currentMiles % 100 === 0) {
|
|
|
+ var text = currentMiles - (Math.floor(currentMiles / 1000) * 1000);
|
|
|
+ addSimpleTextToView(Math.floor(text / 100).toString(), [currentMiles, y + 10], 15, 90, "Standard", RS.VAlignTop, RS.HAlignLeft, false, false, 0);
|
|
|
+ addPolylinetoView([[currentMiles, y], [currentMiles, y + 5]], false, false, 0, new RColor(255, 255, 0));
|
|
|
+ }
|
|
|
+ currentMiles += 100;
|
|
|
+ }
|
|
|
+}
|
|
|
+DrawZdmAll.prototype.applyMileage_1010 = function (arrayData, startPoint, space) {
|
|
|
var spaceDistance = 0;
|
|
|
var bailiDistance = 0;
|
|
|
var tenBailiDistance = 0;
|