|
@@ -310,29 +310,34 @@ export default {
|
|
|
this.clearMap();
|
|
|
switch (fl) {
|
|
|
case 0 :
|
|
|
- var xhr = new XMLHttpRequest()
|
|
|
- xhr.open("get", '/getxflrdata?deptbm=' + this.xfxzqhid+"&level=3", false);
|
|
|
- xhr.setRequestHeader("Content-Type","application/json;charset=utf-8");
|
|
|
- xhr.send();
|
|
|
- // return JSON.parse(xhr.responseText);
|
|
|
- this.querydata=JSON.parse(xhr.responseText).data;
|
|
|
- if (this.deptcurrlevel<3)
|
|
|
- this.setClusterMarker(this.querydata,fl);
|
|
|
- else
|
|
|
- this.map.add(this.setMarker(this.querydata,fl));
|
|
|
- if(this.pattern==1)
|
|
|
- {
|
|
|
- this.clearMap();
|
|
|
- this.setheat();
|
|
|
- }
|
|
|
- if(this.pattern==2)
|
|
|
- {
|
|
|
- this.setTimeCircle();
|
|
|
- }
|
|
|
- if(this.pattern==3)
|
|
|
- {
|
|
|
- this.clearMap();
|
|
|
+ var xhr = new XMLHttpRequest();
|
|
|
+ xhr.open('GET', '/getxflrdata?deptbm=' + this.xfxzqhid+"&level=3", true);
|
|
|
+ xhr.setRequestHeader("Content-Type","application/json;charset=utf-8");
|
|
|
+ xhr.onreadystatechange = function() {
|
|
|
+ if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
|
|
|
+ this.querydata=JSON.parse(xhr.responseText).data;
|
|
|
+ if (this.deptcurrlevel<3)
|
|
|
+ this.setClusterMarker(this.querydata,fl);
|
|
|
+ else
|
|
|
+ this.map.add(this.setMarker(this.querydata,fl));
|
|
|
+ if(this.pattern==1)
|
|
|
+ {
|
|
|
+ this.clearMap();
|
|
|
+ this.setheat();
|
|
|
+ }
|
|
|
+ if(this.pattern==2)
|
|
|
+ {
|
|
|
+ this.setTimeCircle();
|
|
|
+ }
|
|
|
+ if(this.pattern==3)
|
|
|
+ {
|
|
|
+ this.clearMap();
|
|
|
+ }
|
|
|
}
|
|
|
+ }.bind(this);
|
|
|
+ xhr.send();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
break
|
|
|
case 2 :
|