| | |
| | | tdmm: "管理员", |
| | | gpsnum: "", |
| | | }; |
| | | let markers = []; |
| | | let addedCarIds = new Set(); |
| | | let gaddedCarIds = new Set(); |
| | | var map; |
| | | var markerg; |
| | | var labelg; |
| | |
| | | phone: localStorage.getItem("phone"), |
| | | }; |
| | | alldevice(params).then((response) => { |
| | | console.log(111111111); |
| | | |
| | | console.log(response); |
| | | |
| | | this.initMap( |
| | | response.data.gbList, |
| | | response.data.dataList, |
| | |
| | | }, |
| | | methods: { |
| | | change(e) { |
| | | console.log(333333333); |
| | | |
| | | console.log(e); |
| | | var state = ""; |
| | | if (e == true) { |
| | | state = "ON"; |
| | |
| | | const params = { status: state, tagid: this.tagid }; |
| | | |
| | | startorstop(params).then((response) => { |
| | | console.log(111111111); |
| | | |
| | | console.log(response); |
| | | |
| | | // this.initMap(response.data.gbList, response.data.dataList, response.data.view, response.data.shijiao) |
| | | }); |
| | | }, |
| | |
| | | guangbopoint(gaungbo) { |
| | | let zxguangbo = new BMapGL.Icon(zguangbo, new BMapGL.Size(30, 30)); |
| | | let lxguangbo = new BMapGL.Icon(lguangbo, new BMapGL.Size(30, 30)); |
| | | // let onliezhan = new BMapGL.Icon(onlie, new BMapGL.Size(30, 30)) |
| | | this.removePreviousMarkers(); |
| | | for (let i = 0; i < gaungbo.length; i++) { |
| | | if (gaungbo[i].center != null && gaungbo[i].center != "") { |
| | | |
| | | if ( |
| | | gaungbo[i].center.split(";")[0].toString().length > 5 && |
| | | gaungbo[i].center.split(";")[0].toString().length > 4 |
| | |
| | | labelg = new BMapGL.Label(gaungbo[i].name + " " + gaungbo[i].tagid, { |
| | | offset: new BMapGL.Size(0, -40), |
| | | }); |
| | | console.log(222222222); |
| | | |
| | | console.log(gaungbo[i]); |
| | | console.log(444444444); |
| | | if (gaungbo[i].state == 1) { |
| | | // var rr = c.WGS2BD09({ |
| | | // lng: new Number(ToDigital(gaungbo[i].center.split(";")[0].substring(0, 3), gaungbo[i].center.split(";")[0].substring(3, 5), gaungbo[i].center.split(";")[0].substring(5))), |
| | |
| | | }); |
| | | markerg.setLabel(labelg); |
| | | map.addOverlay(markerg); |
| | | gaddedCarIds.add(gaungbo[i].id); |
| | | markers.push(markerg); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | phone: localStorage.getItem("phone"), |
| | | }; |
| | | alldevice(params).then((response) => { |
| | | console.log(111111111); |
| | | |
| | | console.log(response); |
| | | this.guangbopoint(response.data.gbList); |
| | | // this.initMap(response.data.gbList, response.data.dataList, response.data.view, response.data.shijiao) |
| | | }); |
| | | }, 5000); |
| | | }, |
| | | |
| | | // 存储所有添加到地图上的标记物 |
| | | |
| | | |
| | | // 删除上一次添加的所有标记物 |
| | | removePreviousMarkers() { |
| | | markers.forEach(marker => { |
| | | map.removeOverlay(marker); |
| | | map.removeOverlay(markerg); |
| | | }); |
| | | markers = []; |
| | | }, |
| | | pointdata(tags) { |
| | | let jizhunzhan = new BMapGL.Icon(jizhun, new BMapGL.Size(30, 30)); |
| | | let jiancezhan = new BMapGL.Icon(jiance, new BMapGL.Size(30, 30)); |
| | | let onliezhan = new BMapGL.Icon(onlie, new BMapGL.Size(30, 30)); |
| | | let gjimg = new BMapGL.Icon(gjimage, new BMapGL.Size(30, 30)); |
| | | |
| | | this.removePreviousMarkers(); |
| | | for (let i = 0; i < tags.length; i++) { |
| | | if ( |
| | | tags[i].lon != null && |
| | |
| | | ) { |
| | | if (tags[i].lon.toString().length > 5 && tags[i].lat.toString().length > 4) { |
| | | marker; |
| | | |
| | | label = new BMapGL.Label(tags[i].anchorname + " " + tags[i].tagid, { |
| | | offset: new BMapGL.Size(0, -40), |
| | | }); |
| | | console.log(tags[i]); |
| | | |
| | | if (tags[i].type == 0) { |
| | | if (tags[i].onlie == 1 || tags[i].onlie == 4) { |
| | |
| | | }); |
| | | var pt = new BMapGL.Point(rr.lng, rr.lat); |
| | | marker = new BMapGL.Marker(pt, { |
| | | icon: gjimg |
| | | icon: gjimg, |
| | | }); |
| | | label.setStyle({ |
| | | color: "#fff", |
| | |
| | | }); |
| | | marker.setLabel(label); |
| | | map.addOverlay(marker); |
| | | addedCarIds.add(tags[i].id); |
| | | markers.push(marker); |
| | | } |
| | | } |
| | | } |
| | |
| | | phone: localStorage.getItem("phone"), |
| | | }; |
| | | alldevice(params).then((response) => { |
| | | console.log(111111111); |
| | | |
| | | console.log(response); |
| | | this.pointdata(response.data.dataList); |
| | | // this.initMap(response.data.gbList, response.data.dataList, response.data.view, response.data.shijiao) |
| | | }); |
| | |
| | | }, |
| | | |
| | | initMap(gaungbo, tags, view, shijiao) { |
| | | console.log(shijiao); |
| | | |
| | | // $(window).scrollTop(0); |
| | | // window.scroll(0, 0); |
| | | var c = new Convertor(); |