Commit d1a66340 authored by 刘恽伟's avatar 刘恽伟

修改调整倾斜摄影数据为白模数据

parent 4778be38
Pipeline #11 canceled with stages
......@@ -27,6 +27,9 @@
"index": 0
},
"MainModelData": {
"model": {
"url": "http://172.16.10.132:3333/shaoguan/shaoguantestbaimo/tileset.json"
},
"vector": {
"url": "http://172.16.10.132:3333/shaoguan/shaoguanjianzhu/shaoguanjianzhu/tileset.json",
"matrix": [
......
This diff is collapsed.
let config = null, viewer = null, vector = null, piontCloud = null, east = null, west = null, model = null,
ESRIImg = null, TDTVec = null, points = [], polygon = null, polyline = null, handler = null;
let isAnalysisMeasure = false, isAnalysisRoam = false, isLinkageMap = false,isPopupAreaSign=false;
ESRIImg = null, TDTVec = null, points = [], polygon = null, polyline = null, handler = null, editorAxis = null;
let isAnalysisMeasure = false, isAnalysisRoam = false, isLinkageMap = false, isPopupAreaSign = false;
/**
* 读取配置文件
*/
......@@ -90,10 +90,19 @@ function initialize() {
requestWaterMask: false,
requestVertexNormals: false
});
east = add3Dtile(config.MainModelData.east.url, config.MainModelData.east.matrix);
west = add3Dtile(config.MainModelData.west.url, config.MainModelData.west.matrix);
// east = add3Dtile(config.MainModelData.east.url, config.MainModelData.east.matrix);
// west = add3Dtile(config.MainModelData.west.url, config.MainModelData.west.matrix);
vector = add3Dtile(config.MainModelData.vector.url, config.MainModelData.vector.matrix);
// piontCloud = add3Dtile(config.MainModelData.cloud.url, config.MainModelData.cloud.matrix);
model = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: config.MainModelData.model.url,
maximumMemoryUsage: 300,
}));
model.readyPromise.then(function () {
editorAxis = new EditorAxis(viewer.scene, {
model: model,
})
});
for (let i = 0; i < 15; i += 3) {
points.push(viewer.entities.add({
name: "点" + (i / 3 + 1),
......@@ -111,39 +120,40 @@ function initialize() {
//二维面
var entities;
let houseAreaSign = Cesium.GeoJsonDataSource.load('Build/Data/houseAreaSign.json',{clampToGround:true});
let houseAreaSign = Cesium.GeoJsonDataSource.load('Build/Data/houseAreaSign.json', {clampToGround: true});
houseAreaSign.then(function (dataSource) {
entities=dataSource.entities;
var areaEntitiesVals=entities.values;
for (let i = 0; i <areaEntitiesVals.length; i++) {
var entity=areaEntitiesVals[i];
if(Cesium.defined(entity.polygon)){
entity.GID=Number(i+1);//加标识
entities = dataSource.entities;
var areaEntitiesVals = entities.values;
for (let i = 0; i < areaEntitiesVals.length; i++) {
var entity = areaEntitiesVals[i];
if (Cesium.defined(entity.polygon)) {
entity.GID = Number(i + 1);//加标识
}
}
viewer.dataSources.add(dataSource);
polygon = entities;
});
polygon = new Cesium.GroundPrimitive({
geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
vertexFormat: Cesium.VertexFormat.POSITION_ONLY,
positions: Cesium.Cartesian3.fromDegreesArrayHeights(bbb),
width: 20
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW, 0.8))
}
}),
appearance: new Cesium.PerInstanceColorAppearance({
translucent: true,
closed: true,
aboveGround: true
}),
classificationType: Cesium.ClassificationType.BOTH,
show: false
});
// polygon = new Cesium.GroundPrimitive({
// geometryInstances: new Cesium.GeometryInstance({
// geometry: new Cesium.CorridorGeometry({
// vertexFormat: Cesium.VertexFormat.POSITION_ONLY,
// positions: Cesium.Cartesian3.fromDegreesArrayHeights(bbb),
// width: 20
// }),
// attributes: {
// color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW, 0.8))
// }
// }),
// appearance: new Cesium.PerInstanceColorAppearance({
// translucent: true,
// closed: true,
// aboveGround: true
// }),
// classificationType: Cesium.ClassificationType.BOTH,
// show: false
// });
polyline = new Cesium.GroundPrimitive({
geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
......@@ -164,7 +174,7 @@ function initialize() {
show: false
});
viewer.scene.moon.show = false;
viewer.scene.primitives.add(polygon);
// viewer.scene.primitives.add(polygon);
viewer.scene.primitives.add(polyline);
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.cesiumWidget.creditContainer.style.display = "none";
......@@ -188,18 +198,18 @@ function initialize() {
let pickedObject = viewer.scene.pick(movement.position);
if (Cesium.defined(pickedObject)) {
if (Cesium.defined(pickedObject["id"])) {
if(isPopupAreaSign){
var url="http://172.16.10.132:8012/geoserver/Map3D-V2.0/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Map3D-V2.0:house_query&maxFeatures=50&outputFormat=application%2Fjson&viewparams=a:"
$.ajax({
type:"GET",
url:url+pickedObject["id"].GID,
async:false,
success:function(data){
var properties=data.features[0].properties;
viewer.popup.show(cartesian,properties);
}
});
}
if (isPopupAreaSign) {
var url = "http://172.16.10.132:8012/geoserver/Map3D-V2.0/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Map3D-V2.0:house_query&maxFeatures=50&outputFormat=application%2Fjson&viewparams=a:"
$.ajax({
type: "GET",
url: url + pickedObject["id"].GID,
async: false,
success: function (data) {
var properties = data.features[0].properties;
viewer.popup.show(cartesian, properties);
}
});
}
}
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
......@@ -301,6 +311,17 @@ function endLinkageMap() {
}
function editorShow() {
editorAxis.show()
}
function editorClose() {
editorAxis.close()
}
function editorReset() {
editorAxis.reset()
}
function cartesian2LonLat(cartesian) {
let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
......
......@@ -23,8 +23,17 @@ $(document).ready(function () {
case"bar_popup":
stopRoams();
break;
case"bar_editorshow":
editorShow();
break;
case"bar_editorclose":
editorClose();
break;
case"bar_editorreset":
editorReset();
break;
}
if (id === "bar_layer"||id==="bar_popup") {
if (id === "bar_layer" || id === "bar_popup") {
if ($(this).hasClass('active')) {
$('.' + id).removeClass('show');
$(this).removeClass('active');
......@@ -35,16 +44,19 @@ $(document).ready(function () {
switch (id) {
case"bar_layer":
if ($(".show").attr("id") !== id) {$(".show").removeClass("show");}
if ($(".show").attr("id") !== id) {
$(".show").removeClass("show");
}
if ($('.active').attr("id") !== $(this).attr("id")) {
$(".active").removeClass("active");
};
}
;
break;
case"bar_popup":
if ($(this).hasClass('active')) {
isPopupAreaSign=true;
isPopupAreaSign = true;
} else {
isPopupAreaSign=false;
isPopupAreaSign = false;
}
break;
}
......@@ -157,13 +169,13 @@ $(document).ready(function () {
},
{
"id": 5,
"text": "矢量",
"text": "矢量",
"iconCls": "icon-file",
"children": [
{
"id": 51,
"text": "测试数据",
"checked": false
"checked": true
}
]
}, {
......
......@@ -19,17 +19,21 @@
<script src="Build/Static/js/main/Roam.js"></script>
<script src="Build/Static/js/main/Popup.js"></script>
<script src="Build/Static/js/main/Linkage.js"></script>
<script src="Build/Static/js/main/EditorAxis.js"></script>
<body>
<div id="mainScene" class="fullSize mainScene">
<div id="toolsbar" class="toolsbar">
<div class="tooldrop" id="tool_layer"><label>图层控制</label></div>
<div class="tooldrop" id="tool_popup"><label>气泡信息</label></div>
<div class="tooldrop" id="tool_start"><label>开始飞行</label></div>
<div class="tooldrop" id="tool_end"><label>停止飞行</label></div>
<div class="tooldrop" id="tool_polyline"><label>线测量</label></div>
<div class="tooldrop" id="tool_polygon"><label>面测量</label></div>
<div class="tooldrop" id="tool_clean"><label>清除</label></div>
<div class="tooldrop" id="tool_popup"><label>气泡信息</label></div>
<div class="tooldrop" id="tool_editorshow"><label>编辑</label></div>
<div class="tooldrop" id="tool_editorclose"><label>关闭</label></div>
<div class="tooldrop" id="tool_editorreset"><label>还原</label></div>
</div>
<div id="bar_layer" class="bar_layer">
<div id="tree" class="tree">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment