station-positions-function.js
6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/**
* 函数
*/
var PositionsPublicFunctions = function () {
var PubFun = {
initStationInfo : function(id) {
PositionsPublicFunctions.getStationRouteInfo(id,function(station) {
StationPositionsWorldsBMap.clearMarkAndOverlays();
var centerPointWkt = station.centerPointWkt;
if (centerPointWkt.indexOf('POINT(') > -1) {
centerPointWkt = centerPointWkt.substring(6, centerPointWkt.length - 1);
}
var coordindates = centerPointWkt.split(' ');
station.point = new BMap.Point(coordindates[0], coordindates[1]);
PositionsStationObj.setAddStation(station);
var html = new Array();
html.push('<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>');
html.push('<span style="color:#DDD;font-size: 15px;">站点名称:');html.push(station.stationName ? station.stationName : '');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">途经线路:');html.push(station.passLines ? station.passLines : '');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">行业编码:');html.push(station.standardStationCode ? station.standardStationCode : '');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">东西向:');html.push(station.ewDirection === undefined ? '' : station.ewDirection == 0 ? '东->西' : '西->东');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">南北向:');html.push(station.snDirection === undefined ? '' : station.snDirection == 0 ? '南->北' : '北->南');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">路段编码:');html.push(station.roadCoding ? station.roadCoding : '');html.push('</span>');
html.push('<span class="help-block" style="color:#DDD;font-size: 15px;">地址:');html.push(station.address);html.push('</span>');
html.push('<button class="info_win_btn" onclick="StationPositionsWorldsBMap.editStation(');html.push(station.id);html.push(');">修改站点信息</button>');
html.push('<button class="info_win_btn" onclick="StationPositionsWorldsBMap.setDragEnable(true);">移动中心点</button>');
// 信息窗口参数属性
var opts = {
// 信息窗口宽度
width : 200,
// 信息窗口高度
height : 350,
// 信息窗位置偏移值。
offset: new BMap.Size(0, 0),
//标题
title : '<h4 style="color:#FFFFFF">' + station.stationName + '站详情</h4>',
//设置不允许信窗发送短息
enableMessage : false,
//是否开启点击地图关闭信息窗口
enableCloseOnClick : true,
// 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
enableAutoPan:true
};
StationPositionsWorldsBMap.position(station, html.join(''), opts);
});
},
setFormValue : function(station) {
$('#edit_station_form input,select,textarea').each(function() {
$(this).val(eval('station.' + this.name));
});
},
setListEditFrom : function(stationObj) {
// WGS坐标点图形集合
var stationBPolyonGrid = null;
if(stationObj.stationBPolyonGrid)
stationBPolyonGrid = stationObj.stationBPolyonGrid.substring(9, stationObj.stationBPolyonGrid.length -2);
$('#bPolygonGridInput').val(stationBPolyonGrid);
// 百度地图经纬度坐标中心点
$('#bJwpointsInput').val(stationObj.stationJwpoints);
// 城建坐标x
$('#xInput').val(stationObj.stationGlonx);
// 城建坐标y
$('#yInput').val(stationObj.stationGlony);
// 获取图形类型元素,并添加值
$('#shapesTypeSelect').val(stationObj.stationShapesType);
// 获取半径元素,并添加值
$('#radiusInput').val(stationObj.stationRadius);
// 线路ID
$('#stationRouteLineInput').val(stationObj.stationRouteLine);
// 站点编码
$('#stationCodInput').val(stationObj.stationCode);
// 线路编码
$('#lineCodeInput').val(stationObj.stationRouteLIneCode);
// 站点ID
$('#StationCodeInput').val(stationObj.stationRouteStation);
// 站点路由ID
$('#stationRouteIdInput').val(stationObj.stationRouteId);
// 站点名称
$('#zdmcInput').val(stationObj.zdmc);
// 站点路由线路名称
$('#stationNameInput').val(stationObj.stationRouteName);
// 获取站点类型元素设值
$('#stationMarkSelect').val(stationObj.stationRouteStationMark);
// 获取站点方向元素设值
$('#stationdirSelect').val(stationObj.stationRoutedirections);
// 获取站点道路编码元素设值
$('#roadCodingCodInput').val(stationObj.stationRoadCoding);
// 是否撤销
$('#destroySelect').val(stationObj.stationRouteDestroy);
// 到站时间
$('#toTimeInput').val(stationObj.stationRouteToTime);
// 到站距离
$('#distancesInput').val(stationObj.stationRouteDistances);
// 版本号
$('#versionsInput').val(stationObj.stationRouteVersions);
// 描述/说明
$('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
// 行业编码
$('#industryCodeInput').val(stationObj.industryCode);
},
// 获取站点路由.
getzdlyInfo : function(params,callback) {
$get('/stationroute/all',params,function(result) {
callback && callback(result);
});
},
// 方向代码转名称.
dirdmToName : function(value){
var srStr = '';
if(value=='0')
srStr = '上行';
else if(value=='1')
srStr = '下行';
return srStr;
},
findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
$get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
callback && callback(result);
});
},
getStationRouteInfo : function(stationId,callback){
$get('/station/' + stationId, {}, function(r) {
callback && callback(r);
});
},
// 站点更新
stationUpdate : function(station,callback) {
$post('/station/modify', station, function(data) {
callback && callback(data);
});
},
getstationObjData : function(){
return stationObj;
},
getStationIdValue : function() {
return stationId;
},
setStationNameValue : function(editStationName) {
stationObj[0].stationName = editStationName;
return stationObj;
},
getPolygonObj : function() {
return polygon;
},
getMarkerObj : function() {
return marker;
},
getCircleObj : function() {
return circle;
}
}
return PubFun ;
}();