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

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

parent 4778be38
Pipeline #11 canceled with stages
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
"index": 0 "index": 0
}, },
"MainModelData": { "MainModelData": {
"model": {
"url": "http://172.16.10.132:3333/shaoguan/shaoguantestbaimo/tileset.json"
},
"vector": { "vector": {
"url": "http://172.16.10.132:3333/shaoguan/shaoguanjianzhu/shaoguanjianzhu/tileset.json", "url": "http://172.16.10.132:3333/shaoguan/shaoguanjianzhu/shaoguanjianzhu/tileset.json",
"matrix": [ "matrix": [
......
This diff is collapsed.
let config = null, viewer = null, vector = null, piontCloud = null, east = null, west = null, model = null, 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; ESRIImg = null, TDTVec = null, points = [], polygon = null, polyline = null, handler = null, editorAxis = null;
let isAnalysisMeasure = false, isAnalysisRoam = false, isLinkageMap = false,isPopupAreaSign=false; let isAnalysisMeasure = false, isAnalysisRoam = false, isLinkageMap = false, isPopupAreaSign = false;
/** /**
* 读取配置文件 * 读取配置文件
*/ */
...@@ -90,10 +90,19 @@ function initialize() { ...@@ -90,10 +90,19 @@ function initialize() {
requestWaterMask: false, requestWaterMask: false,
requestVertexNormals: false requestVertexNormals: false
}); });
east = add3Dtile(config.MainModelData.east.url, config.MainModelData.east.matrix); // east = add3Dtile(config.MainModelData.east.url, config.MainModelData.east.matrix);
west = add3Dtile(config.MainModelData.west.url, config.MainModelData.west.matrix); // west = add3Dtile(config.MainModelData.west.url, config.MainModelData.west.matrix);
vector = add3Dtile(config.MainModelData.vector.url, config.MainModelData.vector.matrix); vector = add3Dtile(config.MainModelData.vector.url, config.MainModelData.vector.matrix);
// piontCloud = add3Dtile(config.MainModelData.cloud.url, config.MainModelData.cloud.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) { for (let i = 0; i < 15; i += 3) {
points.push(viewer.entities.add({ points.push(viewer.entities.add({
name: "点" + (i / 3 + 1), name: "点" + (i / 3 + 1),
...@@ -111,39 +120,40 @@ function initialize() { ...@@ -111,39 +120,40 @@ function initialize() {
//二维面 //二维面
var entities; 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) { houseAreaSign.then(function (dataSource) {
entities=dataSource.entities; entities = dataSource.entities;
var areaEntitiesVals=entities.values; var areaEntitiesVals = entities.values;
for (let i = 0; i <areaEntitiesVals.length; i++) { for (let i = 0; i < areaEntitiesVals.length; i++) {
var entity=areaEntitiesVals[i]; var entity = areaEntitiesVals[i];
if(Cesium.defined(entity.polygon)){ if (Cesium.defined(entity.polygon)) {
entity.GID=Number(i+1);//加标识 entity.GID = Number(i + 1);//加标识
} }
} }
viewer.dataSources.add(dataSource); viewer.dataSources.add(dataSource);
polygon = entities;
}); });
polygon = new Cesium.GroundPrimitive({ // polygon = new Cesium.GroundPrimitive({
geometryInstances: new Cesium.GeometryInstance({ // geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({ // geometry: new Cesium.CorridorGeometry({
vertexFormat: Cesium.VertexFormat.POSITION_ONLY, // vertexFormat: Cesium.VertexFormat.POSITION_ONLY,
positions: Cesium.Cartesian3.fromDegreesArrayHeights(bbb), // positions: Cesium.Cartesian3.fromDegreesArrayHeights(bbb),
width: 20 // width: 20
}), // }),
attributes: { // attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW, 0.8)) // color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW, 0.8))
} // }
}), // }),
appearance: new Cesium.PerInstanceColorAppearance({ // appearance: new Cesium.PerInstanceColorAppearance({
translucent: true, // translucent: true,
closed: true, // closed: true,
aboveGround: true // aboveGround: true
}), // }),
classificationType: Cesium.ClassificationType.BOTH, // classificationType: Cesium.ClassificationType.BOTH,
show: false // show: false
}); // });
polyline = new Cesium.GroundPrimitive({ polyline = new Cesium.GroundPrimitive({
geometryInstances: new Cesium.GeometryInstance({ geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({ geometry: new Cesium.CorridorGeometry({
...@@ -164,7 +174,7 @@ function initialize() { ...@@ -164,7 +174,7 @@ function initialize() {
show: false show: false
}); });
viewer.scene.moon.show = false; viewer.scene.moon.show = false;
viewer.scene.primitives.add(polygon); // viewer.scene.primitives.add(polygon);
viewer.scene.primitives.add(polyline); viewer.scene.primitives.add(polyline);
viewer.scene.globe.depthTestAgainstTerrain = true; viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.cesiumWidget.creditContainer.style.display = "none"; viewer.cesiumWidget.creditContainer.style.display = "none";
...@@ -188,18 +198,18 @@ function initialize() { ...@@ -188,18 +198,18 @@ function initialize() {
let pickedObject = viewer.scene.pick(movement.position); let pickedObject = viewer.scene.pick(movement.position);
if (Cesium.defined(pickedObject)) { if (Cesium.defined(pickedObject)) {
if (Cesium.defined(pickedObject["id"])) { if (Cesium.defined(pickedObject["id"])) {
if(isPopupAreaSign){ 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:" 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({ $.ajax({
type:"GET", type: "GET",
url:url+pickedObject["id"].GID, url: url + pickedObject["id"].GID,
async:false, async: false,
success:function(data){ success: function (data) {
var properties=data.features[0].properties; var properties = data.features[0].properties;
viewer.popup.show(cartesian,properties); viewer.popup.show(cartesian, properties);
} }
}); });
} }
} }
} }
}, Cesium.ScreenSpaceEventType.LEFT_DOWN); }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
...@@ -301,6 +311,17 @@ function endLinkageMap() { ...@@ -301,6 +311,17 @@ function endLinkageMap() {
} }
function editorShow() {
editorAxis.show()
}
function editorClose() {
editorAxis.close()
}
function editorReset() {
editorAxis.reset()
}
function cartesian2LonLat(cartesian) { function cartesian2LonLat(cartesian) {
let cartographic = Cesium.Cartographic.fromCartesian(cartesian); let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
......
...@@ -23,8 +23,17 @@ $(document).ready(function () { ...@@ -23,8 +23,17 @@ $(document).ready(function () {
case"bar_popup": case"bar_popup":
stopRoams(); stopRoams();
break; 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')) { if ($(this).hasClass('active')) {
$('.' + id).removeClass('show'); $('.' + id).removeClass('show');
$(this).removeClass('active'); $(this).removeClass('active');
...@@ -35,16 +44,19 @@ $(document).ready(function () { ...@@ -35,16 +44,19 @@ $(document).ready(function () {
switch (id) { switch (id) {
case"bar_layer": 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")) { if ($('.active').attr("id") !== $(this).attr("id")) {
$(".active").removeClass("active"); $(".active").removeClass("active");
}; }
;
break; break;
case"bar_popup": case"bar_popup":
if ($(this).hasClass('active')) { if ($(this).hasClass('active')) {
isPopupAreaSign=true; isPopupAreaSign = true;
} else { } else {
isPopupAreaSign=false; isPopupAreaSign = false;
} }
break; break;
} }
...@@ -157,13 +169,13 @@ $(document).ready(function () { ...@@ -157,13 +169,13 @@ $(document).ready(function () {
}, },
{ {
"id": 5, "id": 5,
"text": "矢量", "text": "矢量",
"iconCls": "icon-file", "iconCls": "icon-file",
"children": [ "children": [
{ {
"id": 51, "id": 51,
"text": "测试数据", "text": "测试数据",
"checked": false "checked": true
} }
] ]
}, { }, {
......
...@@ -19,17 +19,21 @@ ...@@ -19,17 +19,21 @@
<script src="Build/Static/js/main/Roam.js"></script> <script src="Build/Static/js/main/Roam.js"></script>
<script src="Build/Static/js/main/Popup.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/Linkage.js"></script>
<script src="Build/Static/js/main/EditorAxis.js"></script>
<body> <body>
<div id="mainScene" class="fullSize mainScene"> <div id="mainScene" class="fullSize mainScene">
<div id="toolsbar" class="toolsbar"> <div id="toolsbar" class="toolsbar">
<div class="tooldrop" id="tool_layer"><label>图层控制</label></div> <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_start"><label>开始飞行</label></div>
<div class="tooldrop" id="tool_end"><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_polyline"><label>线测量</label></div>
<div class="tooldrop" id="tool_polygon"><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_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>
<div id="bar_layer" class="bar_layer"> <div id="bar_layer" class="bar_layer">
<div id="tree" class="tree"> <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