{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\map\\MapTest.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\map\\MapTest.vue","mtime":1715019225577},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.search\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport req from '@/request.js';\nvar yhxt = window.context.yhxt;\nvar marker,\n lineArr = [[116.478935, 39.997761], [116.478939, 39.997825], [116.478912, 39.998549], [116.478912, 39.998549], [116.478998, 39.998555], [116.478998, 39.998555], [116.479282, 39.99856], [116.479658, 39.998528], [116.480151, 39.998453], [116.480784, 39.998302], [116.480784, 39.998302], [116.481149, 39.998184], [116.481573, 39.997997], [116.481863, 39.997846], [116.482072, 39.997718], [116.482362, 39.997718], [116.483633, 39.998935], [116.48367, 39.998968], [116.484648, 39.999861]];\nexport default {\n data: function data() {\n return {\n culData: [],\n slopeData: [],\n brigeData: [],\n tunData: [],\n yanData: [],\n Bmarkers: [],\n mapvalue: '',\n map: '',\n markers: '',\n Cmarkers: [],\n Smarkers: [],\n Tmarkers: [],\n Ymarkers: [],\n lnglatvalue: [106.545034, 29.549649],\n drawer: false,\n direction: 'rtl',\n start: true,\n startShow: false,\n cities: ['桥梁', '隧道', '涵洞', '边坡', '沿线设施'],\n checkboxGroup1: ['桥梁']\n };\n },\n methods: {\n handleClose: function handleClose(done) {\n done();\n },\n //初始化地图\n // initMap() {\n // let map = new AMap.Map('container', {\n // resizeEnable: true,\n // mapStyle: 'amap://styles/darkblue',\n // // center: [106.544857, 29.549371],\n // zoom: 17,\n // })\n // // map.on('click', (e) => {\n // // console.log(e)\n // // this.lnglatvalue = [e.lnglat.getLng(), e.lnglat.getLat()]\n // // this.addMaker(this.lnglatvalue)\n // // })\n // this.map = map\n // },\n //定位\n location: function location() {\n var map = this.map;\n this.startShow = false;\n AMap.plugin('AMap.Geolocation', function () {\n var geolocation = new AMap.Geolocation({\n enableHighAccuracy: true,\n //是否使用高精度定位,默认:true\n timeout: 10000,\n //超过10秒后停止定位,默认:5s\n buttonPosition: 'RB',\n //定位按钮的停靠位置\n buttonOffset: new AMap.Pixel(10, 20),\n //定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)\n zoomToAccuracy: true //定位成功后是否自动调整地图视野到定位点\n });\n\n map.addControl(geolocation);\n });\n },\n //轨迹回放\n Animamap: function Animamap() {\n this.drawer = false;\n this.startShow = true;\n this.map.clearMap();\n var map = this.map;\n marker = new AMap.Marker({\n map: map,\n position: [116.478935, 39.997761],\n icon: 'https://webapi.amap.com/images/car.png',\n offset: new AMap.Pixel(-26, -13),\n autoRotation: true,\n angle: -90\n });\n //为走过\n var polyline = new AMap.Polyline({\n map: map,\n path: lineArr,\n showDir: true,\n strokeColor: '#28F',\n //线颜色\n // strokeOpacity: 1, //线透明度\n strokeWeight: 6 //线宽\n // strokeStyle: \"solid\" //线样式\n });\n //走过\n var passedPolyline = new AMap.Polyline({\n map: map,\n // path: lineArr,\n strokeColor: '#AF5',\n //线颜色\n // strokeOpacity: 1, //线透明度\n strokeWeight: 6 //线宽\n // strokeStyle: \"solid\" //线样式\n });\n\n marker.on('moving', function (e) {\n passedPolyline.setPath(e.passedPath);\n });\n this.markers = marker;\n map.setFitView();\n },\n startAnimation: function startAnimation() {\n this.start = true;\n this.stopAnimation();\n marker.moveAlong(lineArr, 200);\n },\n pauseAnimation: function pauseAnimation() {\n this.start = !this.start;\n marker.pauseMove();\n },\n resumeAnimation: function resumeAnimation() {\n this.start = !this.start;\n marker.resumeMove();\n },\n stopAnimation: function stopAnimation() {\n marker.stopMove();\n },\n removemaker: function removemaker() {\n this.map.remove(this.markers);\n },\n getmap: function getmap() {\n this.map.clearMap();\n var map = this.map;\n console.log(this.mapvalue);\n var mapvalue = this.mapvalue;\n var that = this;\n AMap.plugin('AMap.PlaceSearch', function () {\n var autoOptions = {\n city: '全国'\n };\n var placeSearch = new AMap.PlaceSearch(autoOptions);\n if (mapvalue) {\n placeSearch.search(mapvalue, function (status, result) {\n // 查询成功时,result即对应匹配的POI信息\n console.log(result);\n var pois = result.poiList.pois;\n for (var i = 0; i < pois.length; i++) {\n var poi = pois[i];\n var _marker = [];\n _marker[i] = new AMap.Marker({\n position: poi.location,\n // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]\n title: poi.name\n });\n // 将创建的点标记添加到已有的地图实例:\n map.add(_marker[i]);\n console.log(_marker[i]);\n }\n map.setFitView();\n });\n } else {\n that.$message.error('请输入关键字');\n }\n });\n },\n //地图点击标点\n // addMaker(lnglatvalue) {\n // this.map.clearMap()\n // let map = this.map\n // let icon = new AMap.Icon({\n // size: new AMap.Size(25, 34),\n // image:\n // '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',\n // imageSize: new AMap.Size(135, 40),\n // imageOffset: new AMap.Pixel(-95, -3),\n // })\n // let marker = new AMap.Marker({\n // icon: icon,\n // position: lnglatvalue,\n // offset: new AMap.Pixel(-13, -30),\n // })\n // marker.setMap(map)\n // // 设置鼠标划过点标记显示的文字提示\n // marker.setTitle('我是marker的title')\n // // 设置label标签\n // // label默认蓝框白底左上角显示,样式className为:amap-marker-label\n // marker.setLabel({\n // offset: new AMap.Pixel(20, 20), //设置文本标注偏移量\n // content: mapvalue, //设置文本标注内容\n // direction: 'right', //设置文本标注方位\n // })\n // },\n //点聚合\n pointAggregation: function pointAggregation() {\n var _this = this;\n var icon = new AMap.Icon({\n size: new AMap.Size(48, 48),\n image: require(\"../../assets/img/\\u5927\\u6865.png\")\n });\n var icon2 = new AMap.Icon({\n size: new AMap.Size(48, 48),\n image: require(\"../../assets/img/\\u96A7\\u9053.png\")\n });\n var icon3 = new AMap.Icon({\n size: new AMap.Size(48, 48),\n image: require(\"../../assets/img/\\u8FB9\\u5761.png\")\n });\n var icon4 = new AMap.Icon({\n size: new AMap.Size(48, 48),\n image: require(\"../../assets/img/\\u6DB5\\u6D1E.png\")\n });\n var icon5 = new AMap.Icon({\n size: new AMap.Size(48, 48),\n image: require(\"../../assets/img/yanxiansheshi.png\")\n });\n //点聚合\n this.brigeData.forEach(function (item) {\n var Bmarker = new AMap.Marker({\n position: [item.lng, item.lat],\n offset: new AMap.Pixel(-15, -15),\n icon: icon,\n size: new AMap.Size(30, 37),\n //图标大小\n imageSize: new AMap.Size(30, 37),\n extData: item\n });\n _this.Bmarkers.push(Bmarker);\n });\n this.tunData.forEach(function (item) {\n var Tmarker = new AMap.Marker({\n position: [item.lng, item.lat],\n offset: new AMap.Pixel(-15, -15),\n icon: icon2,\n size: new AMap.Size(30, 37),\n //图标大小\n imageSize: new AMap.Size(30, 37),\n extData: item\n });\n _this.Tmarkers.push(Tmarker);\n });\n this.slopeData.forEach(function (item) {\n var Smarker = new AMap.Marker({\n position: [item.lng, item.lat],\n offset: new AMap.Pixel(-15, -15),\n icon: icon3,\n size: new AMap.Size(30, 37),\n //图标大小\n imageSize: new AMap.Size(30, 37),\n extData: item\n });\n _this.Smarkers.push(Smarker);\n });\n this.culData.forEach(function (item) {\n var Cmarker = new AMap.Marker({\n position: [item.lng, item.lat],\n offset: new AMap.Pixel(-15, -15),\n icon: icon4,\n size: new AMap.Size(30, 37),\n //图标大小\n imageSize: new AMap.Size(30, 37),\n extData: item\n });\n _this.Cmarkers.push(Cmarker);\n });\n this.yanData.forEach(function (item) {\n var Ymarker = new AMap.Marker({\n position: [item.lng, item.lat],\n offset: new AMap.Pixel(-15, -15),\n icon: icon5,\n size: new AMap.Size(30, 37),\n //图标大小\n imageSize: new AMap.Size(30, 37),\n extData: item\n });\n _this.Ymarkers.push(Ymarker);\n });\n //信息窗体\n var infoWindow = new AMap.InfoWindow({\n offset: new AMap.Pixel(0, -30)\n });\n this.Bmarkers.forEach(function (item) {\n item.on('click', function (e) {\n var obj = item.getExtData();\n item.content = \"

桥梁名称 : \" + obj.name + '

' + \"

所在路段 : \" + obj.roadSegmentName + '

' + \"

横坐标 : \" + obj.lng + '

' + \"

纵坐标 : \" + obj.lat + '

';\n infoWindow.setContent(item.content);\n infoWindow.open(_this.map, e.target.getPosition());\n });\n });\n this.Tmarkers.forEach(function (item) {\n item.on('click', function (e) {\n var obj = item.getExtData();\n item.content = \"

隧道名称 : \" + obj.name + '

' + \"

所在路段 : \" + obj.roadSegmentName + '

' + \"

横坐标 : \" + obj.lng + '

' + \"

纵坐标 : \" + obj.lat + '

';\n infoWindow.setContent(item.content);\n infoWindow.open(_this.map, e.target.getPosition());\n });\n });\n this.Smarkers.forEach(function (item) {\n item.on('click', function (e) {\n var obj = item.getExtData();\n item.content = \"

边坡编号 : \" + obj.number + '

' + \"

所在路段 : \" + obj.roadSegmentName + '

' + \"

横坐标 : \" + obj.lng + '

' + \"

纵坐标 : \" + obj.lat + '

';\n infoWindow.setContent(item.content);\n infoWindow.open(_this.map, e.target.getPosition());\n });\n });\n this.Cmarkers.forEach(function (item) {\n item.on('click', function (e) {\n var obj = item.getExtData();\n item.content = \"

涵洞编号 : \" + obj.number + '

' + \"

所在路段 : \" + obj.roadSegmentName + '

' + \"

横坐标 : \" + obj.lng + '

' + \"

纵坐标 : \" + obj.lat + '

';\n infoWindow.setContent(item.content);\n infoWindow.open(_this.map, e.target.getPosition());\n });\n });\n this.Ymarkers.forEach(function (item) {\n item.on('click', function (e) {\n var obj = item.getExtData();\n item.content = \"

沿线设施 : \" + obj.name + '

' + \"

所在路段 : \" + obj.roadSegmentName + '

' + \"

横坐标 : \" + obj.lng + '

' + \"

纵坐标 : \" + obj.lat + '

';\n infoWindow.setContent(item.content);\n infoWindow.open(_this.map, e.target.getPosition());\n });\n });\n this.map.plugin(['AMap.MarkerClusterer'], function () {\n _this.cluster = new AMap.MarkerClusterer(_this.map, _this.Bmarkers, {\n gridSize: 60,\n minClusterSize: 6\n });\n });\n },\n checkChange: function checkChange(val) {\n var _this2 = this;\n this.cluster.clearMarkers();\n val.forEach(function (item) {\n if (item == '桥梁') {\n _this2.cluster.addMarkers(_this2.Bmarkers);\n } else if (item == '隧道') {\n _this2.cluster.addMarkers(_this2.Tmarkers);\n } else if (item == '边坡') {\n _this2.cluster.addMarkers(_this2.Smarkers);\n } else if (item == '涵洞') {\n _this2.cluster.addMarkers(_this2.Cmarkers);\n } else if (item == '沿线设施') {\n _this2.cluster.addMarkers(_this2.Ymarkers);\n }\n });\n },\n //获取五个设施基本数据\n allDate: function allDate() {\n var _this3 = this;\n var data = {\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n }\n };\n this.getData('/bizBridgeInformation/v1/getJson', data).then(function (res) {\n res.rows.forEach(function (item) {\n _this3.brigeData.push(item);\n });\n setTimeout(function () {\n _this3.initMap();\n _this3.location();\n _this3.pointAggregation();\n _this3.startShow = false;\n }, 1000);\n });\n this.getData('/bizTunnelInformation/v1/getJson', data).then(function (res) {\n res.rows.forEach(function (item) {\n _this3.tunData.push(item);\n });\n });\n this.getData('/bizSideSlopeInformation/v1/getJson', data).then(function (res) {\n res.rows.forEach(function (item) {\n _this3.slopeData.push(item);\n });\n });\n this.getData('/bizCulvertInformation/bizCulvertInformationmanager/v1/getJson', data).then(function (res) {\n res.rows.forEach(function (item) {\n _this3.culData.push(item);\n });\n });\n this.getData('/bizRoadsideFacilities/bizRoadsideFacilitiesManager/v1/getJson', data).then(function (res) {\n res.rows.forEach(function (item) {\n _this3.yanData.push(item);\n });\n });\n },\n //获取数据\n getData: function getData(url, data) {\n return new Promise(function (resolve, reject) {\n req.post(yhxt + \"\".concat(url), data).then(function (resp) {\n resolve(resp.data);\n }, function (error) {\n reject(error);\n });\n });\n }\n },\n mounted: function mounted() {\n this.allDate();\n }\n};",null]}