添加黑地图,轨迹查询自动变成车号,车辆出上海边界不显示
| | |
| | | { "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": [ |
| | |
| | | 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"] + |
| | |
| | | color: "rgb(2,26,79)", |
| | | outline: true, |
| | | outlineColor: "#39E09B", |
| | | outlineWidth: 8, |
| | | outlineWidth: 3, |
| | | outlineOpacity: 0.8, |
| | | arcType: Cesium.ArcType.GEODESIC, |
| | | clampToGround: true, |
| | |
| | | if(regionCode == 0){ |
| | | $.getJSON("./data/shanghai.json", (result2) => { |
| | | polygon_Points = result2.features[0].geometry.coordinates[0][0] |
| | | console.log(polygon_Points,"上海边界") |
| | | 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)) |
| | | } |
| | | } |
| | |
| | | |
| | | //开始查询轨迹 |
| | | $("#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)} |
| | | if($("#taxisn").val() || $("#taxisn").val()=='') {$("#taxisn").val(thisWidget.taxi_sn)} |
| | | $.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, |
| | |
| | | } |
| | | |
| | | 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.taxi_sn = new_taxi_sn; |
| | | this.viewWindow.resetStartQueryTaxiDataText(this.taxi_sn); |
| | | |
| | | |
| | | if (this.startGraphic) { |
| | | this.startGraphic.remove(); |
| | |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | console.log(item,"路线item",item[this.qindex]) |
| | | // 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.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; |
| | |
| | | var road = new mars3d.graphic.CorridorPrimitive({ |
| | | positions: positions, |
| | | style: { |
| | | width: 80, |
| | | opacity: 0.75, |
| | | width: 150, |
| | | 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] : attr[qindex] || attr[qindex] == "/" ? 2000 : attr[qindex], //高度 |
| | | color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex] || "#C0C0C0"), |
| | | // material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | // //动画线材质 |
| | |
| | | var road = new mars3d.graphic.CorridorPrimitive({ |
| | | positions: positions, |
| | | style: { |
| | | width: 80, |
| | | opacity: 0.75, |
| | | width: 150, |
| | | 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] : attr[qindex] || attr[qindex] == "/" ? 2000 : attr[qindex],//高度 |
| | | color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]), |
| | | // material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | // //动画线材质 |