Quellcode durchsuchen

取消地图下钻

miaofuhao vor 6 Jahren
Ursprung
Commit
83914ffa54
1 geänderte Dateien mit 32 neuen und 2 gelöschten Zeilen
  1. 32 2
      WebChart/js/map.js

+ 32 - 2
WebChart/js/map.js

@@ -30,7 +30,7 @@ window.onload = function() {
30 30
 	//市区选择控件
31 31
 	$('.map_click').click(function(obj) {
32 32
 		mapAdree=$(this).attr("index")
33
-		earth();
33
+		//earth();
34 34
 	});
35 35
 
36 36
 	//初始化方法
@@ -74,13 +74,43 @@ window.onload = function() {
74 74
 					map.centerAndZoom(point, 12);
75 75
 					//删除选点
76 76
 					map.clearOverlays();
77
+					throungh();
77 78
 				} else {
78 79
 					// alert("您选择地址没有解析到结果!");
79 80
 				}
80 81
 			}, city);
81 82
 		}
82 83
 	}
83
-
84
+	function throungh() {
85
+		$.ajax({
86
+			type: "get",
87
+			url: huayi.config.callcenter_url + "WorkOrderReport/GetHotspotMap",
88
+			async: false,
89
+			dataType: 'json',
90
+			data: {
91
+				token: $.cookie("token"),
92
+				start:$('#starttime').val() && $('#starttime').val().split(' ~ ')[0], //=开始时间
93
+				end:$('#starttime').val() && $('#starttime').val().split(' ~ ')[1], //=结束时间
94
+				deptid: $("#Dpment").val(),
95
+				sourcearea:$('#sourceAreas').val(),
96
+			},
97
+			success: function(result) {
98
+				if(result.state.toLowerCase() == "success") {
99
+					json_data = result.data;
100
+					for(var i = 0; i < json_data.length; i++) {
101
+						var marker = new BMap.Marker(new BMap.Point(json_data[i][0], json_data[i][1])); // 创建点
102
+						map.addOverlay(marker); //增加点
103
+						pointArray[i] = new BMap.Point(json_data[i][0], json_data[i][1]);
104
+						var content = json_data[i][2];
105
+						addClickHandler(content, marker);
106
+						//让所有点在视野范围内
107
+						map.setViewport(pointArray);
108
+					}
109
+					console.log(json_data)
110
+				}
111
+			}
112
+		})
113
+	}
84 114
 	function Autocomplete() {
85 115
 		//建立一个自动完成的对象
86 116
 		var ac = new BMap.Autocomplete({