| New file |
| | |
| | | Merge branch 'master' of http://www.shsening.com:10000/r/template/shanghai |
| | | # 请输入一个提交信息以解释此合并的必要性,尤其是将一个更新后的上游分支 |
| | | # 合并到主题分支。 |
| | | # |
| | | # 以 '#' 开始的行将被忽略,而空的提交说明将终止提交。 |
| | |
| | | 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) { |
| | | console.log(this,event,"这是event") |
| | | let layerid = event.layer.options.id; |
| | | let item = event.graphic?.attr; |
| | | let qindex = event.layer.options.style_selected; |
| | |
| | | } else { |
| | | min = 45 |
| | | } |
| | | |
| | | return year + "-" + |
| | | ((month + 1) > 9 ? (month + 1) : "0" + (month + 1)) + "-" + |
| | | (day > 9 ? day : ("0" + day)) + " " + |
| | |
| | | function reLoadLayers() { |
| | | var layers = map.getLayers({ layers: true }); |
| | | layers.forEach((layer) => { |
| | | // console.log(layer.name + ":" + layer.type); |
| | | |
| | | if ([layer.type] == 'wms') { |
| | | layer.options.layers = "konglu_58:" + layer.options.geoname_prefix + mars3d.global_variables.queryDataType; |
| | | layer.options.parameters.viewparams = "userid:" + mars3d.global_variables.userid + ";regiontype:" + layer.options.regiontype + ";datetime:" + mars3d.global_variables.queryDataTStartGeo |
| | |
| | | function addGraphictoHighlightLayer() { |
| | | mars3d.global_variables.tmpHighlightGraphics.forEach((item) => { |
| | | mars3d.global_variables.tmpHighlightGraphicLayer.addGraphic(item); |
| | | console.log(item,"高亮") |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | function addWMSLayer(item) { |
| | | console.log(item,"查看griditem") |
| | | |
| | | var wmsLyer = new mars3d.layer.WmsLayer({ |
| | | id: item.id, |
| | | pid: item.pid, |
| | |
| | | wmsLyer.options.maximumLevel = item.maximumLevel; |
| | | wmsLyer.options.maximumTerrainLevel = item.maximumLevel; |
| | | } |
| | | |
| | | |
| | | wmsLyer.bindPopup(bindPopupFunction); |
| | | |
| | |
| | | var id = event.layer.options.id; |
| | | var qindex = event.layer.options.style_selected; |
| | | event.graphic.style.diffHeight = qindex == 'co' ? 10 * event.graphic.attr[qindex] : event.graphic.attr[qindex]; |
| | | //console.log(id, qindex, event.graphic.attr[qindex]); |
| | | //console.log(getLayerPointColorByQindexandValue(id, qindex, event.graphic.attr[qindex])); |
| | | //console.log(Cesium.Color.fromCssColorString(getLayerPointColorByQindexandValue(id, qindex, event.graphic.attr[qindex]))) |
| | | //event.graphic.style.material.uniforms.color = getLayerPointColorByQindexandValue(id, qindex, event.graphic.attr[qindex]); |
| | | //event.graphic.style.material.uniforms.color = getLayerPointColorByQindexandValue(id, qindex, event.graphic.attr[qindex]); |
| | | event.graphic.style.material = new mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | |
| | | taxi_layer.on(mars3d.EventType.click, function (event) { |
| | | console.log("监听layer,单击了矢量对象", event); |
| | | var item = event.graphic?.attr; |
| | | //console.log(item); |
| | | }); |
| | | taxi_layer.bindPopup(bindPopupFunction); |
| | | |
| | |
| | | } |
| | | |
| | | function setTaxiLayerMapClock() { |
| | | console.log(mars3d.global_variables.queryDataTStartTaxi,mars3d.global_variables.queryDataTEnd,"时间") |
| | | |
| | | map.clock.shouldAnimate = true; |
| | | map.clock.startTime = Cesium.JulianDate.fromDate(new Date(mars3d.global_variables.queryDataTStartTaxi)); |
| | | map.clock.currentTime = Cesium.JulianDate.fromDate(new Date(mars3d.global_variables.queryDataTStartTaxi)); |
| | | map.clock.stopTime = Cesium.JulianDate.fromDate(new Date(mars3d.global_variables.queryDataTEnd)); |
| | | map.clock.multiplier = 2.0; |
| | | map.clock.clockRange = Cesium.ClockRange.LOOP_STOP; |
| | | |
| | | var last_time_second = 0; |
| | | |
| | | |
| | |
| | | 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)) |
| | |
| | | var tmpDatetime = $('#appDateHour').val(); |
| | | tmpDatetime = tmpDatetime.replace(/\:/g,"").replace(/-/g,"").replace(/\s+/g,""); |
| | | mars3d.global_variables.queryDataTStart = $('#appDateHour').val(); |
| | | mars3d.global_variables.queryDataTEnd = $('#appDateHour').val().substring(0,14)+"15:00"; |
| | | mars3d.global_variables.queryDataTEnd = $('#appDateMin').val().substring(0,14) + (Number($('#appDateMin').val().substring(14,16)) + 14).toString() +":59"; |
| | | // mars3d.global_variables.queryDataTEnd = $('#appDateHour').val().substring(0,14)+"15:00"; |
| | | mars3d.global_variables.DefaultDateTimeStart = $('#appDateHour').val().substring(0,11)+"00:00:00"; |
| | | mars3d.global_variables.queryDataTStartGeo = tmpDatetime; |
| | | mars3d.global_variables.queryDataType = value; |
| | | mars3d.global_variables.timetype = "hour"; |
| | | console.log(mars3d.global_variables.queryDataTStart,"start",mars3d.global_variables.queryDataTEnd,"end",mars3d.global_variables.DefaultDateTimeStart,"一天的时间") |
| | | reLoadLayers(); |
| | | refreshWidgets(); |
| | | timetype_change1(); |
| | |
| | | |
| | | tmpDatetime = tmpDatetime.replace(/\:/g,"").replace(/-/g,"").replace(/\s+/g,""); |
| | | mars3d.global_variables.queryDataTStart = $('#appDate').val() + " 00:00:00"; |
| | | mars3d.global_variables.queryDataTEnd = $('#appDate').val()+ " 00:15:00"; |
| | | mars3d.global_variables.queryDataTEnd = $('#appDateMin').val().substring(0,14) + (Number($('#appDateMin').val().substring(14,16)) + 14).toString() +":59"; |
| | | // mars3d.global_variables.queryDataTEnd = $('#appDate').val()+ " 00:15:00"; |
| | | mars3d.global_variables.DefaultDateTimeStart = $('#appDate').val().substring(0,8)+"01 00:00:00"; |
| | | mars3d.global_variables.queryDataTStartGeo = tmpDatetime; |
| | | mars3d.global_variables.queryDataType = value; |
| | | mars3d.global_variables.timetype = "day"; |
| | | console.log(tmpDatetime,mars3d.global_variables.queryDataTStart,mars3d.global_variables.queryDataTEnd ,mars3d.global_variables.DefaultDateTimeStart,"一天的时间") |
| | | reLoadLayers(); |
| | | refreshWidgets(); |
| | | timetype_change1(); |
| | |
| | | $('#appDateHour').hide() |
| | | $('#appDateMin').show() |
| | | // mars3d.global_variables.queryDataTStart = $('#appDateMin').val(); |
| | | |
| | | mars3d.global_variables.queryDataTStartTaxi = $('#appDateMin').val(); |
| | | mars3d.global_variables.queryDataTEnd = $('#appDateMin').val().substring(0,14) + (Number($('#appDateMin').val().substring(14,16)) + 14).toString() +":59"; |
| | | mars3d.global_variables.DefaultDateTimeStart = $('#appDateMin').val().substring(0,11)+"00:00:00"; |
| | | mars3d.global_variables.timetype = "min"; |
| | | console.log($('#appDateMin').val(),mars3d.global_variables.queryDataTEnd,mars3d.global_variables.DefaultDateTimeStart) |
| | | taxi_reLoadLayers(); |
| | | timetype_change1(); |
| | | timetype_change2(); |
| | |
| | | }); |
| | | $("#appDate").datetimepicker("setDate", new Date(this.defaultDate)); |
| | | $("#appDate").datetimepicker("setEndDate", new Date(this.defaultDate)); |
| | | |
| | | $("#appDateHour").datetimepicker({ |
| | | bootcssVer: 3, //bootstrap-datetimepicker+bootstrap v3,但这个插件使用的时候,并没有和V3相匹配,仍然调用的是bootstrap V2的图标 把bootcssVer的值直接设为3,否则datetimepicker不会显示出上、下个月的箭头 |
| | | format: 'yyyy-mm-dd hh:00:00', |
| | |
| | | thisWidget = _thisWidget; |
| | | |
| | | DatePicker("#appDateHourStart", '#appDateHourEnd'); |
| | | console.log($("#appDateHourStart").val(),$('#appDateHourEnd').val(),"rywsjbh") |
| | | $("#appDateHourStart").datetimepicker("setDate", new Date(thisWidget.appDateHourStart)); |
| | | $('#appDateHourEnd').datetimepicker('setDate', new Date(thisWidget.appDateHourEnd)); |
| | | $("#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,"查询数据") |
| | | haoutil.loading.hide(); |
| | | thisWidget.clearReplayLayers(); |
| | | if (result.data.result.length > 0) { |
| | |
| | | } |
| | | |
| | | function resetStartQueryTaxiDataText(taxi) { |
| | | console.log(taxi,"taxi编号") |
| | | $("#taxisn").val(taxi) |
| | | // $("#startQueryTaxiDataText").text("轨迹查询(" + taxi + ")"); |
| | | |
| | |
| | | { |
| | | bootcssVer: 3, //bootstrap-datetimepicker+bootstrap v3,但这个插件使用的时候,并没有和V3相匹配,仍然调用的是bootstrap V2的图标 把bootcssVer的值直接设为3,否则datetimepicker不会显示出上、下个月的箭头 |
| | | format: 'yyyy-mm-dd hh:ii:00', |
| | | minView: 'day',//设置时间选择为年月日 去掉时分秒选择 |
| | | // minView: 'day',//设置时间选择为年月日 去掉时分秒选择 |
| | | todayBtn: true, //如果此值为true 或 "linked",则在日期时间选择器组件的底部显示一个 "Today" 按钮用以选择当前日期。如果是true的话,"Today" 按钮仅仅将视图转到当天的日期,如果是"linked",当天日期将会被选中。 |
| | | clearBtn: true, |
| | | language: 'zh-CN', |
| | |
| | | //==============开始导航=================== |
| | | startDH() { |
| | | //导航前释放之前的所有导航操作 |
| | | console.log(this.appDateHourEnd,this.appDateHourStart,this.appDateHourEnd,"开始回放") |
| | | this.map.clock.shouldAnimate = true; |
| | | this.map.clock.startTime = Cesium.JulianDate.fromDate(new Date(this.appDateHourStart)); |
| | | this.map.clock.currentTime = Cesium.JulianDate.fromDate(new Date(this.appDateHourStart)); |
| | |
| | | } |
| | | |
| | | reloadData(new_taxi_sn) { |
| | | console.log(new_taxi_sn,"reload") |
| | | |
| | | this.viewWindow.resetStartQueryTaxiDataText(new_taxi_sn); |
| | | this.taxi_sn = new_taxi_sn; |
| | |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | // console.log(item,"路线item",item[this.qindex]) |
| | | let graphic = new mars3d.graphic.PolylineEntity({ |
| | | positions: [position,position2], |
| | | style: { |
| | |
| | | //每个窗口创建完成后调用 |
| | | winCreateOK(opt, result) { |
| | | this.viewWindow = result; |
| | | console.log(this) |
| | | 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; |
| | |
| | | } |
| | | //打开激活 |
| | | activate() { |
| | | console.log(this,"this.map") |
| | | this.map.addLayer(this.groupLayer); |
| | | this.map.clock.shouldAnimate = false; |
| | | this.old_map_clock_startTime = this.map.clock.startTime; |
| | |
| | | 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; |
| | | console.log(this.map._layerCache["1004"].options.show,"taxi_layer.shouw") |
| | | |
| | | } |
| | | //============开始视角跟随============= |