| | |
| | | "geocoder": false, |
| | | "geocoderConfig": { "key": ["ae29a37307840c7ae4a785ac905927e0"] }, |
| | | "selectionIndicator": false, |
| | | |
| | | "defaultContextMenu": true, |
| | | "mouseDownView": true, |
| | | "compass": { "bottom": "270px", "right": "5px" }, |
| | |
| | | "icon": "img/basemaps/tdt_vec.png", |
| | | "type": "group", |
| | | "layers": [ |
| | | { "name": "底图", "type": "tdt", "layer": "vec_d", "key": ["51915011aa0997aa2ddd7e38504fa8bc"] } |
| | | { |
| | | "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" |
| | | "icon": "img/basemaps/bd-c-dark.png", |
| | | "type": "group", |
| | | "layers": [ |
| | | { |
| | | "name": "底图", |
| | | "type": "tdt", |
| | | "layer": "vec_d", |
| | | "brightness": 0.3, |
| | | "contrast": 1.8, |
| | | "gamma": 1, |
| | | "hue": 0, |
| | | "saturation": 0, |
| | | "key": ["51915011aa0997aa2ddd7e38504fa8bc"] |
| | | } |
| | | ], |
| | | "zIndex": 0 |
| | | } |
| | | ], |
| | | "layers": [ |
| | |
| | | "layer": "time", |
| | | "minimumTerrainLevel": 4, |
| | | "minimumLevel": 4, |
| | | "proxy": "//server.mars3d.cn/proxy/", |
| | | "mapSplit": false |
| | | }, |
| | | { "id": 99, "name": "数据图层", "type": "group" }, |
| | |
| | | "style_selected":"pm25", |
| | | "styleoptions": ["pm25", "pm10", "no", "no2", "nox", "co"], |
| | | "regiontype":"00", |
| | | "minimumLevel":8, |
| | | "minimumLevel":11, |
| | | "maximumLevel":12, |
| | | "show":false, |
| | | "zIndex":6 |
| | | |
| | | }, |
| | | { |
| | | "id": 3003, |
| | |
| | | "style_selected":"pm25", |
| | | "styleoptions": ["pm25", "pm10", "no", "no2", "nox", "co"], |
| | | "regiontype":"00", |
| | | "minimumLevel":6, |
| | | "maximumLevel":7, |
| | | "minimumLevel":8, |
| | | "maximumLevel":10, |
| | | "show":false, |
| | | "zIndex":7 |
| | | |
| | |
| | | if (current_date.getSeconds() != last_time_second) { |
| | | console.log("current_data != ") |
| | | last_time_second = current_date.getSeconds(); |
| | | console.log(current_date,"current_data data") |
| | | changeTaxiLayerStyleAndAttr_Single(getFormattedDateTime(current_date)); |
| | | } |
| | | } else if (map.getLayerById(1004).options.show) { |
| | | console.log("current_data ==") |
| | | var current_date = new Date(Cesium.JulianDate.toDate(event._currentTime)); |
| | | if (current_date.getSeconds() != last_time_second) { |
| | | last_time_second = current_date.getSeconds(); |
| | |
| | | var taxi_qindex = map.getLayerById(1004).options.style_selected; |
| | | let single_taxi = taxi_layer.getGraphicById(mars3d.global_variables.singleTaxiReplayData[0]["code"]); |
| | | if (!single_taxi) { |
| | | console.log("进入第一个if") |
| | | var tmpPositionProperty = new Cesium.SampledPositionProperty(); |
| | | for (var i = 0, len = mars3d.global_variables.singleTaxiReplayData.length; i < len; i++) { |
| | | let item = mars3d.global_variables.singleTaxiReplayData[i]; |
| | | tmpPositionProperty.addSample(Cesium.JulianDate.fromDate(new Date(item["datatime"])), Cesium.Cartesian3.fromDegrees(item["lon"], item["lat"], 0.2)) |
| | | console.log(tmpPositionProperty,"汽车路线经纬度") |
| | | } |
| | | |
| | | single_taxi = new mars3d.graphic.ModelEntity({ |
| | |
| | | } |
| | | tmpattr = getTaxiAttrFromTimeListData(current_date, mars3d.global_variables.singleTaxiReplayData); |
| | | if (tmpattr && tmpattr != null) { |
| | | console.log("进入第二个if") |
| | | let tmpTaxiColor = getLayerPointColorByQindexandValue(1004, taxi_qindex, tmpattr[taxi_qindex]); |
| | | let tmpTaxigltfurl = "gltf/" + (tmpattr["code"]).substring(0, 2) + tmpTaxiColor.substring(1) + ".gltf"; |
| | | single_taxi.setOptions({ |
| | |
| | | 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; |
| | | if(!mars3d.global_variables.userid) { |
| | | mars3d.global_variables.userid = 2; |
| | | } |
| | | regionCode = mars3d.global_variables.regionCode |
| | | |
| | | var configfile = "config/config.json"; //默认地址 |
| | |
| | | |
| | | //开始查询轨迹 |
| | | $("#startQueryTaxiData").click(function () { |
| | | console.log(thisWidget,"thisWidget") |
| | | haoutil.loading.show(); |
| | | thisWidget.appDateHourStart = $("#appDateHourStart").val() |
| | | thisWidget.appDateHourEnd = $("#appDateHourEnd").val() |
| | |
| | | //每个窗口创建完成后调用 |
| | | winCreateOK(opt, result) { |
| | | this.viewWindow = result; |
| | | console.log(this,"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; |
| | |
| | | } |
| | | //打开激活 |
| | | activate() { |
| | | console.log(this,"this detail") |
| | | this.map.addLayer(this.groupLayer); |
| | | this.map.clock.shouldAnimate = false; |
| | | this.old_map_clock_startTime = this.map.clock.startTime; |