|
@@ -15,7 +15,7 @@ $(function () {
|
|
|
showRailList();
|
|
|
// 调整左边栏显示高度和宽度
|
|
|
var height = $(document).height() - headerHeight;
|
|
|
- $("#rail_items").css("height", height - 38);
|
|
|
+ $("#rail_items").css("height", height);
|
|
|
// 增加图例
|
|
|
addTuliDiv("railway");
|
|
|
});
|
|
@@ -48,6 +48,39 @@ function getRailLayerItems() {
|
|
|
initRailData();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/**
|
|
|
+ * 添加地图图层列表
|
|
|
+ * @param type 表示: 铁 水 公 空
|
|
|
+ */
|
|
|
+function getMapCheckItems() {
|
|
|
+ mapBasicType = [
|
|
|
+ {"id": "jtsn", "type": "railway", label: "交通枢纽", layer: jtsnMarkerlayer},
|
|
|
+ {"id": "ptzd", "type": "railway", label: "普通站点", layer: ptzdMarkerlayer}
|
|
|
+ ];
|
|
|
+ var htmltemplate = '<div class="field"><div class="layer ui checkbox" style="padding: 5px"><input id="{0}" type="checkbox" name="{1}"><label>{2}</label></div></div>';
|
|
|
+ var htmlDiv = "";
|
|
|
+ for (var i = 0; i < mapBasicType.length; i++) {
|
|
|
+ htmlDiv += $.formatString(htmltemplate, mapBasicType[i].id, mapBasicType[i].id, mapBasicType[i].label);
|
|
|
+ }
|
|
|
+ $("#divcheck").html(htmlDiv);
|
|
|
+ $('.layer.ui.checkbox').checkbox({
|
|
|
+ onChecked: function () {
|
|
|
+ initRailBasicInfoEvent(this.name);
|
|
|
+ },
|
|
|
+ onUnchecked: function () {
|
|
|
+ //关闭当前对应图层弹出的左下角信息框
|
|
|
+ closeUncheckTc(this.name);
|
|
|
+ var targetlayer = $.getBasicLayer(this.name, basicType);
|
|
|
+ targetlayer.clearMarkers();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 默认选中机场图层
|
|
|
+ $("#jtsn").attr("checked", true);
|
|
|
+ // 图层初始化
|
|
|
+ initRailData();
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 初始化基础数据
|
|
|
*
|
|
@@ -168,7 +201,9 @@ function initRail() {
|
|
|
{"id": tc_ptzd, "type": "railway", label: "普通站点", layer: ptzdMarkerlayer}
|
|
|
];
|
|
|
// 设置图层选中事件
|
|
|
- getRailLayerItems();
|
|
|
+ //getRailLayerItems();
|
|
|
+ // 添加地图上图层列表(两项)
|
|
|
+ getMapCheckItems();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -241,7 +276,7 @@ function showRailList() {
|
|
|
onUnchecked: function () {
|
|
|
}
|
|
|
});*/
|
|
|
- var name = $("#srchRailName").val();
|
|
|
+ var name = $.trim($("#srchContent").val());
|
|
|
$.get(basePath + "/basicInfo", {type: tc_rail_js, "name":name}, function (result) {
|
|
|
var len = result.length;
|
|
|
var htmltemplate = '<div style="float:left;text-algin:center;width:209px;height:30px;cursor:pointer;" onclick="showStaCenter({0});">' +
|
|
@@ -407,11 +442,25 @@ function railwaySearch() {
|
|
|
|
|
|
//铁路
|
|
|
function searchRailway() {
|
|
|
- setSearchStyle();
|
|
|
var sid = "#srchContent";
|
|
|
- var content = $(sid).val();
|
|
|
- if("" != $.trim(content)) {
|
|
|
- showTrainTimes('',content);
|
|
|
+ var content = $.trim($(sid).val());
|
|
|
+ var displayFlg = false;
|
|
|
+ if($(sid).css("display") == "inline-block") {
|
|
|
+ displayFlg = true;
|
|
|
+ }
|
|
|
+ setSearchStyle();
|
|
|
+ // 判断是否为汉子,如果是则查询车站
|
|
|
+ var cFlg = isChineseChar(content);
|
|
|
+ if(cFlg) {
|
|
|
+ showRailList();
|
|
|
+ } else {
|
|
|
+ if("" != content) {
|
|
|
+ showTrainTimes('',content);
|
|
|
+ } else {
|
|
|
+ if(displayFlg == true) {
|
|
|
+ showRailList();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|