| | |
| | | this.abc += 1 |
| | | const that = this |
| | | if (!res) { |
| | | that.map = new BMapGL.Map('map_container') |
| | | that.map = new BMap.Map('map_container') |
| | | console.log('BMap', BMap) |
| | | console.log('BMapGL', BMapGL) |
| | | console.log('window', window.BMapGL) |
| | |
| | | // lat = GPS.bd_encrypt(lat, lng).lat |
| | | // lng = GPS.bd_decrypt(lat, lng).lon |
| | | // lat = GPS.bd_decrypt(lat, lng).lat |
| | | var point = new BMapGL.Point(lng, lat) |
| | | var point = new BMap.Point(lng, lat) |
| | | point.a34004 = parseInt(value.a34004) |
| | | point.a34002 = parseInt(value.a34002) |
| | | point.a21026 = parseInt(value.a21026) |
| | |
| | | var data = point[sensor] |
| | | // 根据因子浓度变换方块颜色 |
| | | var color = getColorAndLevel(sensor, data).color |
| | | var polygon = new BMapGL.Polygon( |
| | | var polygon = new BMap.Polygon( |
| | | [ |
| | | new BMapGL.Point(sw.lng, sw.lat), // 左下角 |
| | | new BMapGL.Point(ne.lng, sw.lat), // 左上角 |
| | | new BMapGL.Point(ne.lng, ne.lat), // 右上角 |
| | | new BMapGL.Point(sw.lng, ne.lat) // 右下角 |
| | | new BMap.Point(sw.lng, sw.lat), // 左下角 |
| | | new BMap.Point(ne.lng, sw.lat), // 左上角 |
| | | new BMap.Point(ne.lng, ne.lat), // 右上角 |
| | | new BMap.Point(sw.lng, ne.lat) // 右下角 |
| | | ], |
| | | { |
| | | strokeWeight: 0.1, // 边框线的宽度,以像素为单位 |
| | |
| | | |
| | | // 起点和终点标注 |
| | | function drawStartAndEnd() { |
| | | var startIcon = new BMapGL.Icon( |
| | | var startIcon = new BMap.Icon( |
| | | require('@/assets/images/start.png'), |
| | | new BMapGL.Size(48, 48) |
| | | new BMap.Size(48, 48) |
| | | ) |
| | | var startMark = new BMapGL.Marker(that.showPoints[0], { |
| | | var startMark = new BMap.Marker(that.showPoints[0], { |
| | | icon: startIcon, |
| | | offset: new BMapGL.Size(0, -20) |
| | | offset: new BMap.Size(0, -20) |
| | | }) |
| | | that.map.addOverlay(startMark) |
| | | var endIcon = new BMapGL.Icon( |
| | | var endIcon = new BMap.Icon( |
| | | require('@/assets/images/end.png'), |
| | | new BMapGL.Size(48, 48) |
| | | new BMap.Size(48, 48) |
| | | ) |
| | | var endMark = new BMapGL.Marker( |
| | | var endMark = new BMap.Marker( |
| | | that.showPoints[that.showPoints.length - 1], |
| | | { |
| | | icon: endIcon, |
| | | offset: new BMapGL.Size(0, -20) |
| | | offset: new BMap.Size(0, -20) |
| | | } |
| | | ) |
| | | that.map.addOverlay(endMark) |
| | |
| | | lng = (lng * 180) / Math.PI |
| | | lat = (lat * 180) / Math.PI |
| | | // console.log(lng, lat) |
| | | return new BMapGL.Point(lng, lat) |
| | | return new BMap.Point(lng, lat) |
| | | } |
| | | |
| | | function getGrading(sensor, type, carMac) { |
| | |
| | | |
| | | // point上添加label文本 |
| | | function setLabelStyle(content, point) { |
| | | var label = new BMapGL.Label( |
| | | var label = new BMap.Label( |
| | | "<span class='my-maptip'>" + content + '<br /><span>', // 为lable填写内容 |
| | | { |
| | | offset: new BMapGL.Size(-8, -10), // label的偏移量,为了让label的中心显示在点上 |
| | | offset: new BMap.Size(-8, -10), // label的偏移量,为了让label的中心显示在点上 |
| | | position: point |
| | | } // label的位置 |
| | | ) |
| | | var offsetSize = new BMapGL.Size(0, 0) |
| | | var offsetSize = new BMap.Size(0, 0) |
| | | var size = '10px' |
| | | if (that.map.getZoom() <= 15.5) { |
| | | size = '0px' |