| | |
| | | { "name": "底图", "type": "tdt", "layer": "vec_d", "key": ["51915011aa0997aa2ddd7e38504fa8bc"] } |
| | | ], |
| | | "zIndex": 0 |
| | | }, |
| | | { |
| | | "pid": 10, |
| | | "name": "黑色底图", |
| | | "icon": "/img/basemaps/bd-c-dark.png", |
| | | "type": "tencent", |
| | | "layer": "custom", |
| | | "style": "4" |
| | | } |
| | | ], |
| | | "layers": [ |
| | |
| | | "bottom": 30, |
| | | "right": 5 |
| | | } |
| | | } |
| | | }, |
| | | "autoDisable":false |
| | | }, |
| | | |
| | | { |
| | |
| | | } |
| | | var tiandituArr = ['51915011aa0997aa2ddd7e38504fa8bc', '51915011aa0997aa2ddd7e38504fa8bc'] |
| | | // http://112.74.77.127:8090/ http://223.167.111.168:7002/ |
| | | var default_system_params = { geoserver_url_predix: 'http://223.167.111.168:7001/', nodejs_url_predix: 'http://223.167.111.168:7002/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://223.167.111.168:8016/PollutionData/loginpage.aspx?returnurl=http://223.167.111.168:8004/shanghai/index.html',regionCode:2}; |
| | | var default_system_params = { geoserver_url_predix: 'http://223.167.111.168:7001/', nodejs_url_predix: 'http://223.167.111.168:7002/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://223.167.111.168:8016/PollutionData/loginpage.aspx?returnurl=http://223.167.111.168:8004/shanghai/index.html',regionCode:0}; |
| | | var default_grid_camerview = {grid5000:{"lat":30.367931,"lng":121.518409,"alt":128482,"heading":2,"pitch":-57},grid3000:{"lat":30.902475,"lng":121.487751,"alt":38716,"heading":2,"pitch":-57},grid1000:{"lat":31.066346,"lng":121.462529,"alt":10026,"heading":2,"pitch":-57},grid500:{"lat":31.112561,"lng":121.458433,"alt":2483,"heading":2,"pitch":-57}}; |
| | | |
| | | function bindPopupFunction(event) { |
| | | |
| | | let layerid = event.layer.options.id; |
| | | let item = event.graphic?.attr; |
| | | let qindex = event.layer.options.style_selected; |
| | | console.log(item["datatime"],"poup.item") |
| | | // console.log(event) |
| | | if (!item) { |
| | | return ""; |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item); |
| | | let item_time = item["datatime"].split(" ") |
| | | console.log(item_time,"poup.item") |
| | | if(item_time[1] === "00:00:00"){ |
| | | item["datatime"] = item_time[0] |
| | | } |
| | | console.log(item["datatime"],"after") |
| | | if (layerid == 1001) { |
| | | return "站点编号:" + |
| | | item["code"] + |
| | |
| | | |
| | | function mask_selection(regionCode){ |
| | | if(regionCode == 0){ |
| | | return |
| | | geoJsonLayer = new mars3d.layer.GeoJsonLayer({ |
| | | id:9999, |
| | | url: "./data/shanghai.json", |
| | | mask: true, //标识为遮罩层【重点参数】 |
| | | symbol: { |
| | | styleOptions: { |
| | | fill: true, |
| | | color: "rgb(2,26,79)", |
| | | outline: true, |
| | | outlineColor: "#39E09B", |
| | | outlineWidth: 3, |
| | | outlineOpacity: 0.8, |
| | | arcType: Cesium.ArcType.GEODESIC, |
| | | clampToGround: true, |
| | | }, |
| | | } |
| | | }); |
| | | map.addLayer(geoJsonLayer); |
| | | // return |
| | | }else{ |
| | | //geojson 各行政区边界线 |
| | | geoJsonLayer = new mars3d.layer.GeoJsonLayer({ |
| | | id:9999, |
| | | url: "./data/"+regionCode+".geojson", |
| | | mask: true, //标识为遮罩层【重点参数】 |
| | | symbol: { |
| | | styleOptions: { |
| | | fill: true, |
| | | color: "rgb(2,26,79)", |
| | | outline: true, |
| | | outlineColor: "#39E09B", |
| | | outlineWidth: 3, |
| | | outlineOpacity: 0.5, |
| | | arcType: Cesium.ArcType.GEODESIC, |
| | | clampToGround: true, |
| | | }, |
| | | }, |
| | | }); |
| | | map.addLayer(geoJsonLayer); |
| | | } |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | //geojson 各行政区边界线 |
| | | geoJsonLayer = new mars3d.layer.GeoJsonLayer({ |
| | |
| | | }, |
| | | }); |
| | | map.addLayer(geoJsonLayer); |
| | | ======= |
| | | |
| | | >>>>>>> 165c834d414f2c5f56ad6d259b5f18c26921cc94 |
| | | } |
| | | |
| | |
| | | var taxi_layer; |
| | | |
| | | |
| | | function addTaxiLayer(item) { |
| | | var polygon_Points; |
| | | |
| | | |
| | | |
| | | |
| | | function addTaxiLayer(item) { |
| | | taxi_layer = new mars3d.layer.GraphicLayer({ |
| | | id: item.id, |
| | | name: item.name, |
| | |
| | | } |
| | | } |
| | | |
| | | function getTaxiPathFromServerbySN(taxi_mn, target_layer) { |
| | | |
| | | |
| | | // 判断一个点是否在一个区域内方法 |
| | | function isInPolygon(checkPoint, polygonPoints) { |
| | | var counter = 0; |
| | | var i; |
| | | var xinters; |
| | | var p1, p2; |
| | | var pointCount = polygonPoints.length; |
| | | p1 = polygonPoints[0]; |
| | | |
| | | for (i = 1; i <= pointCount; i++) { |
| | | p2 = polygonPoints[i % pointCount]; |
| | | if ( |
| | | checkPoint[0] > Math.min(p1[0], p2[0]) && |
| | | checkPoint[0] <= Math.max(p1[0], p2[0]) |
| | | ) { |
| | | if (checkPoint[1] <= Math.max(p1[1], p2[1])) { |
| | | if (p1[0] != p2[0]) { |
| | | xinters = |
| | | (checkPoint[0] - p1[0]) * |
| | | (p2[1] - p1[1]) / |
| | | (p2[0] - p1[0]) + |
| | | p1[1]; |
| | | if (p1[1] == p2[1] || checkPoint[1] <= xinters) { |
| | | counter++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | p1 = p2; |
| | | } |
| | | if (counter % 2 == 0) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | function getTaxiPathFromServerbySN(taxi_mn, target_layer) { |
| | | $.getJSON(mars3d.global_variables.nodejs_url_predix + "dataapi/Bdata?bid=get_1004_single_path&siteid=" + taxi_mn["code"], { |
| | | datatime1: mars3d.global_variables.queryDataTStartTaxi, |
| | | datatime2: mars3d.global_variables.queryDataTEnd |
| | |
| | | // 保存临时数据,为后续替换颜色做准备。 |
| | | data_list_1004_paths.set(result.data.result[0].code, result.data.result); |
| | | var tmpPositionProperty = new Cesium.SampledPositionProperty(); |
| | | for (var i = 0, len = result.data.result.length; i < len; i++) { |
| | | let item = result.data.result[i]; |
| | | //console.log(item); |
| | | tmpPositionProperty.addSample(Cesium.JulianDate.fromDate(new Date(item["datatime"])), Cesium.Cartesian3.fromDegrees(item["lon"], item["lat"], 0.2)) |
| | | |
| | | if(regionCode == 0){ |
| | | $.getJSON("./data/shanghai.json", (result2) => { |
| | | polygon_Points = result2.features[0].geometry.coordinates[0][0] |
| | | for (var i = 0, len = result.data.result.length; i < len; i++) { |
| | | let item = result.data.result[i]; |
| | | let isIn = isInPolygon([item.lon,item.lat],polygon_Points) |
| | | if(isIn){ |
| | | tmpPositionProperty.addSample(Cesium.JulianDate.fromDate(new Date(item["datatime"])), Cesium.Cartesian3.fromDegrees(item["lon"], item["lat"], 0.2)) |
| | | } |
| | | } |
| | | |
| | | }) |
| | | }else{ |
| | | $.getJSON("./data/"+regionCode+".geojson", (result2) => { |
| | | polygon_Points = result2.features[0].geometry.coordinates[0][0] |
| | | for (var i = 0, len = result.data.result.length; i < len; i++) { |
| | | let item = result.data.result[i]; |
| | | console.log(item.lon,item.lat,polygon_Points) |
| | | let isIn = isInPolygon([item.lon,item.lat],polygon_Points) |
| | | if(isIn){ |
| | | console.log("进来了") |
| | | tmpPositionProperty.addSample(Cesium.JulianDate.fromDate(new Date(item["datatime"])), Cesium.Cartesian3.fromDegrees(item["lon"], item["lat"], 0.2)) |
| | | } |
| | | // mpPositionProperty.addSample(Cesium.JulianDate.fromDate(new Date(item["datatime"])), Cesium.Cartesian3.fromDegrees(item["lon"], item["lat"], 0.2)) |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | let graphic = new mars3d.graphic.ModelEntity({ |
| | |
| | | request = $.extend(request, haoutil.system.getRequest(window.top)); |
| | | } |
| | | |
| | | // try { |
| | | // var jwtstr = request.JWT; |
| | | // var strs_ = jwtstr.split('.'); |
| | | // var jwt_header_ = new buffer.Buffer(strs_[0].toString('base64'), 'base64').toString(); |
| | | // var jwt_payload_ = new buffer.Buffer(strs_[1].toString('base64'), 'base64').toString(); |
| | | // var payload_ = JSON.parse(jwt_payload_); |
| | | // mars3d.global_variables.userid = payload_.userid; |
| | | // mars3d.global_variables.regionCode = payload_.divcode; |
| | | // var hash = CryptoJS.HmacSHA256(strs_[0] + '.' + strs_[1], "sxyd"); |
| | | // var hashInBase64 = base64UrlEncode(hash); |
| | | try { |
| | | var jwtstr = request.JWT; |
| | | var strs_ = jwtstr.split('.'); |
| | | var jwt_header_ = new buffer.Buffer(strs_[0].toString('base64'), 'base64').toString(); |
| | | var jwt_payload_ = new buffer.Buffer(strs_[1].toString('base64'), 'base64').toString(); |
| | | var payload_ = JSON.parse(jwt_payload_); |
| | | mars3d.global_variables.userid = payload_.userid; |
| | | mars3d.global_variables.regionCode = payload_.divcode; |
| | | var hash = CryptoJS.HmacSHA256(strs_[0] + '.' + strs_[1], "sxyd"); |
| | | var hashInBase64 = base64UrlEncode(hash); |
| | | |
| | | // var reg = RegExp(strs_[2]); |
| | | // if (!reg.exec(hashInBase64)) { |
| | | // // verification failed, go back |
| | | // window.top.location = mars3d.global_variables.un_authorization_url; |
| | | // } |
| | | // payload_ = JSON.parse(jwt_payload_); |
| | | // if (!payload_ || !payload_.expires) { |
| | | // // verification error ,go back |
| | | // window.top.location = mars3d.global_variables.un_authorization_url; |
| | | // } |
| | | // var date1 = new Date(payload_.expires); |
| | | // var date2 = new Date(); |
| | | // if (date1 < date2) { |
| | | // // expire, go back |
| | | // window.top.location = mars3d.global_variables.un_authorization_url; |
| | | // } |
| | | // } |
| | | // catch (err) { |
| | | // window.top.location = mars3d.global_variables.un_authorization_url; |
| | | // } |
| | | var reg = RegExp(strs_[2]); |
| | | if (!reg.exec(hashInBase64)) { |
| | | // verification failed, go back |
| | | window.top.location = mars3d.global_variables.un_authorization_url; |
| | | } |
| | | payload_ = JSON.parse(jwt_payload_); |
| | | if (!payload_ || !payload_.expires) { |
| | | // verification error ,go back |
| | | window.top.location = mars3d.global_variables.un_authorization_url; |
| | | } |
| | | var date1 = new Date(payload_.expires); |
| | | var date2 = new Date(); |
| | | if (date1 < date2) { |
| | | // expire, go back |
| | | window.top.location = mars3d.global_variables.un_authorization_url; |
| | | } |
| | | } |
| | | catch (err) { |
| | | window.top.location = mars3d.global_variables.un_authorization_url; |
| | | } |
| | | |
| | | mars3d.global_variables.userid = request?.userid || 2; |
| | | regionCode = mars3d.global_variables.regionCode |
| | |
| | | //创建三维地球场景 |
| | | map = new mars3d.Map("mars3dContainer", mapOptions); |
| | | |
| | | //上海边界遮罩 |
| | | geoJsonLayer = new mars3d.layer.GeoJsonLayer({ |
| | | url: "data/shanghai.json", |
| | | mask: true, //标识为遮罩层【重点参数】 |
| | | symbol: { |
| | | styleOptions: { |
| | | fill: true, |
| | | color: "rgb(2,26,79)", |
| | | outline: true, |
| | | outlineColor: "#39E09B", |
| | | outlineWidth: 8, |
| | | outlineOpacity: 0.8, |
| | | arcType: Cesium.ArcType.GEODESIC, |
| | | clampToGround: true, |
| | | }, |
| | | }, |
| | | zIndex: 99999999999, |
| | | }); |
| | | map.addLayer(geoJsonLayer); |
| | | |
| | | //构造widget |
| | | initWidget(map); |
| | |
| | | "use script"; //开发环境建议开启严格模式 |
| | | "use script"; //开发环境建议开启严格模式 |
| | | |
| | | //对应widget.js中MyWidget实例化后的对象 |
| | | var thisWidget; |
| | |
| | | } |
| | | |
| | | var item = layer.options; |
| | | console.log(item,"item") |
| | | |
| | | if (!item.name || item.name == "") { |
| | | if (!item.name || item.name == "" || item.id == 9999) { |
| | | console.log("未命名图层不加入图层管理", layer); |
| | | return; |
| | | } |
| | |
| | | |
| | | //开始查询轨迹 |
| | | $("#startQueryTaxiData").click(function () { |
| | | console.log(thisWidget.taxi_sn,"汽车编号") |
| | | haoutil.loading.show(); |
| | | thisWidget.appDateHourStart = $("#appDateHourStart").val() |
| | | thisWidget.appDateHourEnd = $("#appDateHourEnd").val() |
| | | if(!$("#taxisn").val() || $("#taxisn").val()=='') {$("#taxisn").val(thisWidget.taxi_sn)} |
| | | let str = $("#taxisn").val() |
| | | let time_1 = thisWidget.appDateHourStart |
| | | let time_2 = thisWidget.appDateHourEnd |
| | | console.log(str,time_1,time_2,"参数") |
| | | $.getJSON(thisWidget.nodejs_url_predix + "dataapi/Bdata?bid=get_1004_single_path&siteid=" + $("#taxisn").val(), { |
| | | // $.getJSON(thisWidget.nodejs_url_predix + "dataapi/Bdata?bid=get_1004_single_path&siteid=" + thisWidget.taxi_sn, { |
| | | datatime1: thisWidget.appDateHourStart, |
| | | datatime2: thisWidget.appDateHourEnd |
| | | }, (result) => { |
| | | console.log(result,"result") |
| | | haoutil.loading.hide(); |
| | | thisWidget.clearReplayLayers(); |
| | | if (result.data.result.length > 0) { |
| | |
| | | } |
| | | |
| | | function resetStartQueryTaxiDataText(taxi) { |
| | | $("#startQueryTaxiDataText").text("轨迹查询(" + taxi + ")"); |
| | | console.log(taxi,"taxi编号") |
| | | $("#taxisn").val(taxi) |
| | | // $("#startQueryTaxiDataText").text("轨迹查询(" + taxi + ")"); |
| | | |
| | | $("#route_box").hide(); |
| | | } |
| | | |
| | |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | |
| | | reloadData(new_taxi_sn) { |
| | | // this.viewWindow.resetStartQueryTaxiDataText(new_taxi_sn); |
| | | console.log(new_taxi_sn,"reload") |
| | | |
| | | this.viewWindow.resetStartQueryTaxiDataText(new_taxi_sn); |
| | | this.taxi_sn = new_taxi_sn; |
| | | |
| | | |
| | | if (this.startGraphic) { |
| | | this.startGraphic.remove(); |
| | | this.startGraphic = null; |
| | |
| | | } |
| | | this.routeLayer.clear(); |
| | | } |
| | | |
| | | |
| | | clearReplayLayers() { |
| | | this.pointLayer.clear(); |
| | | this.routeLayer.clear(); |
| | | } |
| | | |
| | | |
| | | addTaxiReplayGraphic(points) { |
| | | |
| | | |
| | | this.startGraphic = new mars3d.graphic.BillboardEntity({ |
| | | position: points[0], |
| | | style: { |
| | |
| | | }, |
| | | }); |
| | | this.pointLayer.addGraphic(this.startGraphic); |
| | | |
| | | |
| | | this.endGraphic = new mars3d.graphic.BillboardEntity({ |
| | | position: points[points.length - 1], |
| | | style: { |
| | |
| | | }); |
| | | this.pointLayer.addGraphic(this.endGraphic); |
| | | |
| | | var Pointsdata = mars3d.global_variables.singleTaxiReplayData |
| | | for (var i = 0, len = Pointsdata.length; i < len; i++) { |
| | | var item = Pointsdata[i]; |
| | | var lng = Number(item["lon"]); //经度 |
| | | var lat = Number(item["lat"]); //纬度 |
| | | var position = null; |
| | | if (lng && lat) { |
| | | position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | |
| | | |
| | | let Pointsdata = mars3d.global_variables.singleTaxiReplayData |
| | | for (var i = 0, len = Pointsdata.length; i < len-1; i++) { |
| | | var item = Pointsdata[i]; |
| | | var item2 = Pointsdata[i+1]; |
| | | var lng = Number(item["lon"]); //经度 |
| | | var lat = Number(item["lat"]); //纬度 |
| | | var lng2 = Number(item2["lon"]); //经度 |
| | | var lat2 = Number(item2["lat"]); //纬度 |
| | | var position = null; |
| | | var position2 = null; |
| | | if (lng && lat&&lng2&&lat2) { |
| | | position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | // console.log(item,"路线item",item[this.qindex]) |
| | | let graphic = new mars3d.graphic.PolylineEntity({ |
| | | positions: points, |
| | | positions: [position,position2], |
| | | style: { |
| | | width: 10, |
| | | material: new mars3d.material.LineFlowMaterialProperty({ |
| | | color:this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex]), |
| | | image: "./img/textures/arrow2.png", |
| | | repeat: new Cesium.Cartesian2(30, 1), |
| | | speed: 30, //速度,建议取值范围1-100 |
| | | repeat: new Cesium.Cartesian2(1, 1), |
| | | speed: 40, //速度,建议取值范围1-100 |
| | | }) |
| | | }, |
| | | }); |
| | | this.routeLayer.addGraphic(graphic); |
| | | } |
| | | // console.log(items,"items") |
| | | // let graphic = new mars3d.graphic.PolylineEntity({ |
| | | // positions: points, |
| | | // style: { |
| | | // width: 10, |
| | | // material: new mars3d.material.LineFlowMaterialProperty({ |
| | | // color: Cesium.Color.AQUA, |
| | | // image: "./img/textures/arrow2.png", |
| | | // repeat: new Cesium.Cartesian2(50, 1), |
| | | // speed: 40, //速度,建议取值范围1-100 |
| | | // }) |
| | | // }, |
| | | // }); |
| | | // this.routeLayer.addGraphic(graphic); |
| | | this.routeLayer.flyTo(); |
| | | }} |
| | | |
| | | } |
| | | |
| | | addTaxiPointInfoGraphic() { |
| | | var Pointsdata = mars3d.global_variables.singleTaxiReplayData; |
| | | var points = []; |
| | | for (var i = 0, len = Pointsdata.length; i < len; i++) { |
| | | for (var i = 0, len = Pointsdata.length; i < len-1; i++) { |
| | | // var item = Pointsdata[i]; |
| | | // // var lng = Number(item["lon"]); //经度 |
| | | // // var lat = Number(item["lat"]); //纬度 |
| | | // // var position = null; |
| | | // // if (lng && lat) { |
| | | // // position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | // // } |
| | | // let keys = ["lon","lat"] |
| | | // let array = [] |
| | | // Pointsdata.map(item => { |
| | | // array.push(keys.reduce((result, key) => ({ ...result, [key]: item[key] }), {})) |
| | | // }) |
| | | // let points = [] |
| | | // array.map(item => { |
| | | // points.push(Object.values(item)) |
| | | // }) |
| | | // item = changeNullAndundefinedToEmpty(item) |
| | | var item = Pointsdata[i]; |
| | | var item2 = Pointsdata[i+1]; |
| | | var lng = Number(item["lon"]); //经度 |
| | | var lat = Number(item["lat"]); //纬度 |
| | | // var position = null; |
| | | // if (lng && lat) { |
| | | // //position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | // } |
| | | points[Pointsdata.length] = [lng, lat]; |
| | | |
| | | var lng2 = Number(item2["lon"]); //经度 |
| | | var lat2 = Number(item2["lat"]); //纬度 |
| | | var position = null; |
| | | var position2 = null; |
| | | if (lng && lat&&lng2&&lat2) { |
| | | position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | var CorridorPrimitive = new mars3d.graphic.CorridorPrimitive({ |
| | | position: points, |
| | | let color_value = this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex]); |
| | | //points[Pointsdata.length] = [lon,lat] |
| | | var CorridorPrimitive = new mars3d.graphic.CorridorEntity({ |
| | | positions: [position,position2], |
| | | style: { |
| | | with: 50, |
| | | height: 0, |
| | | diffHeight: this.qindex == "co" ? 1000 * item[this.qindex] : item[this.qindex] || item[qindex] == "/" ? 3000 : item[qindex], //高度 |
| | | color:this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex]), |
| | | opacity: 0.5, |
| | | // length: 60.0, |
| | | width: 10.0, |
| | | height: 0, |
| | | cornerType: Cesium.CornerType.BEVELED, |
| | | // radius: 8.0, |
| | | diffHeight: this.qindex == "co" ? 100 * item[this.qindex] : 10*item[this.qindex], //高度 |
| | | color:color_value, |
| | | opacity: 1, |
| | | // rotationDegree: 45, |
| | | highlight: { |
| | | opacity: 1 |
| | | opacity: 1 |
| | | } |
| | | }, |
| | | item: item, |
| | |
| | | } |
| | | this.routeLayer.flyTo(); |
| | | } |
| | | |
| | | |
| | | setSingleTaxiReplayData(datas) { |
| | | mars3d.global_variables.singleTaxiReplayData = datas; |
| | | } |
| | | |
| | | |
| | | refreshDetailTable(tmpattr) { |
| | | this.viewWindow.refreshDetailTable(tmpattr); |
| | | } |
| | | |
| | | |
| | | //初始化[仅执行1次] |
| | | create() { |
| | | |
| | | |
| | | this.gaodeRoute = new mars3d.query.GaodeRoute({ |
| | | // key: ['ae29a37307840c7ae4a785ac905927e0'], |
| | | }); |
| | | this.gaodePOI = new mars3d.query.GaodePOI({ |
| | | // key: ['ae29a37307840c7ae4a785ac905927e0'], |
| | | }); |
| | | |
| | | |
| | | //图层管理使用的分组 |
| | | this.groupLayer = new mars3d.layer.GroupLayer({ |
| | | name: this.config.name, |
| | | pid: 50, //图层管理 中使用,父节点id |
| | | }); |
| | | |
| | | |
| | | //创建矢量数据图层 |
| | | this.pointLayer = new mars3d.layer.GraphicLayer({ |
| | | name: this.config.name + "-起止点", |
| | | }); |
| | | this.groupLayer.addLayer(this.pointLayer); //加入分组 |
| | | |
| | | |
| | | this.routeLayer = new mars3d.layer.GraphicLayer({ |
| | | name: this.config.name + "-路线", |
| | | }); |
| | |
| | | //每个窗口创建完成后调用 |
| | | winCreateOK(opt, result) { |
| | | this.viewWindow = result; |
| | | console.log(this.config.params,"this.taxi_sn") |
| | | this.appDateHourStart = mars3d.global_variables.queryDataTStartTaxi; |
| | | this.appDateHourEnd = mars3d.global_variables.queryDataTEnd; |
| | | this.nodejs_url_predix = mars3d.global_variables.nodejs_url_predix; |
| | | this.taxi_sn = this.config.params; |
| | | // this.viewWindow.resetStartQueryTaxiDataText(this.taxi_sn); |
| | | this.viewWindow.resetStartQueryTaxiDataText(this.taxi_sn); |
| | | |
| | | } |
| | | //打开激活 |
| | |
| | | this.map.clock.stopTime = this.old_map_clock_stopTime; |
| | | this.map.clock.multiplier = this.old_map_clock_multiplier; |
| | | mars3d.global_variables.is_single_taxi_replaying = false; |
| | | |
| | | |
| | | if (this.startGraphic) { |
| | | this.startGraphic.remove(); |
| | | this.startGraphic = null; |
| | |
| | | this.endGraphic = null; |
| | | } |
| | | this.map.removeLayer(this.groupLayer); |
| | | |
| | | |
| | | } |
| | | |
| | | //漫游自动结束 或点击 停止导航按钮 后,重置界面和操作 |
| | |
| | | // 暂停回放 |
| | | this.map.clock.shouldAnimate = false; |
| | | } |
| | | |
| | | |
| | | ContinueReplay() { |
| | | // 继续回放 |
| | | this.map.clock.shouldAnimate = true; |
| | | } |
| | | |
| | | |
| | | //取消当前的视角跟随 |
| | | removeTrack() { |
| | | if (this.nowFline) { |
| | |
| | | this.map.clock.currentTime = Cesium.JulianDate.fromDate(new Date(this.appDateHourStart)); |
| | | this.map.clock.stopTime = Cesium.JulianDate.fromDate(new Date(this.appDateHourEnd)); |
| | | this.map.clock.multiplier = 2.0; |
| | | |
| | | |
| | | } |
| | | //============开始视角跟随============= |
| | | startGS() { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //注册到widget管理器中。 |
| | | mars3d.widget.bindClass(MyWidget); |
| | | |
| | | |
| | | //每个widet之间都是直接引入到index.html中,会存在彼此命名冲突,所以闭包处理下。 |
| | | })(window, mars3d); |
| | | })(window, mars3d); |
| | |
| | | for (var i = 0; length = tableData.length, i < length; i++) { |
| | | var j = i + 1; |
| | | var topObj = tableData[i]; |
| | | let end_time = topObj.posttime.split(" "); |
| | | if(end_time[1] === "00:00:00"){ |
| | | topObj.posttime = end_time[0] |
| | | } |
| | | topObj = changeNullAndundefinedToEmpty(topObj); |
| | | var _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" +topObj.name+"</td><td>" + topObj.posttime + "</td><td>" + topObj.pm25 + "</td><td>" + topObj.pm10 + "</td><td>" + topObj.no + "</td><td>" + topObj.nox + "</td><td>" + topObj.no2 + "</td><td>" + topObj.co + "</td></tr>" |
| | | $("#indexTb").append(_tr); |
| | |
| | | } |
| | | |
| | | addPathToMap(layerid, qindex, positions, attr) { |
| | | var road = new mars3d.graphic.CorridorPrimitive({ |
| | | var road = new mars3d.graphic.PolylineEntity({ |
| | | positions: positions, |
| | | style: { |
| | | width: 80, |
| | | opacity: 0.75, |
| | | width: 8, |
| | | opacity: 1, |
| | | //closure: true, |
| | | height: 0, |
| | | cornerType: Cesium.CornerType.MITERED, |
| | | diffHeight: qindex == "co" ? 1000 * attr[qindex] : attr[qindex] || attr[qindex] == "/" ? 3000 : attr[qindex], //高度 |
| | | diffHeight: qindex == "co" ? 500 * attr[qindex] : 20*attr[qindex], //高度 |
| | | color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex] || "#C0C0C0"), |
| | | // material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | // //动画线材质 |
| | | // image: "img/textures/fence.png", |
| | | // axisY: true, |
| | | // color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex] || "#C0C0C0"), |
| | | // speed: 10, //速度,建议取值范围1-100 |
| | | // }), |
| | | }, |
| | | attr: attr |
| | | }); |
| | |
| | | } |
| | | |
| | | addPathToMap(layerid, qindex, positions, attr) { |
| | | var road = new mars3d.graphic.CorridorPrimitive({ |
| | | var road = new mars3d.graphic.PolylineEntity({ |
| | | positions: positions, |
| | | style: { |
| | | width: 80, |
| | | opacity: 0.75, |
| | | width: 8, |
| | | opacity: 1, |
| | | //closure: true, |
| | | height: 0, |
| | | cornerType: Cesium.CornerType.MITERED, |
| | | diffHeight: qindex == "co" ? 1000 * attr[qindex] : attr[qindex] || attr[qindex] == "/" ? 3000 : attr[qindex],//高度 |
| | | diffHeight: qindex == "co" ? 500 * attr[qindex] : 20 * attr[qindex],//高度 |
| | | color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]), |
| | | // material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | // //动画线材质 |
| | | // image: "img/textures/fence.png", |
| | | // axisY: true, |
| | | // color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]), |
| | | // speed: 10, //速度,建议取值范围1-100 |
| | | // }), |
| | | }, |
| | | attr: attr |
| | | }); |