You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
8.9 KiB
220 lines
8.9 KiB
10 months ago
|
//var viewer = new Cesium.Viewer("webgis",{
|
||
|
// animation : false,//是否创建动画小器件,左下角仪表
|
||
|
// baseLayerPicker : false,//是否显示图层选择器
|
||
|
// fullscreenButton : false,//是否显示全屏按钮
|
||
|
// geocoder : false,//是否显示geocoder小器件,右上角查询按钮
|
||
|
// homeButton : false,//是否显示Home按钮
|
||
|
// infoBox : false,//是否显示信息框
|
||
|
// sceneModePicker : false,//是否显示3D/2D选择器
|
||
|
// selectionIndicator : false,//是否显示选取指示器组件
|
||
|
// timeline : false,//是否显示时间轴
|
||
|
// navigationHelpButton : false,//是否显示右上角的帮助按钮
|
||
|
// scene3DOnly : true,//如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源
|
||
|
// shouldAnimate : false,
|
||
|
// fullscreenElement : document.body,//全屏时渲染的HTML元素,
|
||
|
// targetFrameRate : undefined,//使用默认render loop时的帧率
|
||
|
// showRenderLoopErrors : true//如果设为true,将在一个HTML面板中显示错误信息
|
||
|
//});
|
||
|
//var scene = viewer.scene;
|
||
|
//
|
||
|
////天地图影像
|
||
|
//var _imgw = new Cesium.WebMapTileServiceImageryProvider({
|
||
|
// url: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=4a0d473df7beb04313eaa0ecbc37954f",
|
||
|
// layer: "img",
|
||
|
// style: "default",
|
||
|
// format: "tiles",
|
||
|
// tileMatrixSetID: "w",
|
||
|
// credit: new Cesium.Credit('天地图全球影像服务'),
|
||
|
// subdomains: ['t0', "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
|
||
|
// maximumLevel: 18,
|
||
|
// show: false
|
||
|
//});
|
||
|
//viewer.imageryLayers.addImageryProvider(_imgw);
|
||
|
//
|
||
|
////天地图中文标注
|
||
|
//var _ciaw = new Cesium.WebMapTileServiceImageryProvider({
|
||
|
// url: "http://t0.tianditu.com/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=4a0d473df7beb04313eaa0ecbc37954f",
|
||
|
// layer: "tdtAnnoLayer",
|
||
|
// style: "default",
|
||
|
// format: "image/jpeg",
|
||
|
// tileMatrixSetID: "GoogleMapsCompatible",
|
||
|
// show: false
|
||
|
//});
|
||
|
//
|
||
|
//viewer.imageryLayers.addImageryProvider(_ciaw);
|
||
|
////屏蔽Cesium的默认双击追踪选中entity行为
|
||
|
//viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
||
|
////设置为true的话 在地面以上就看不到地下的东西 设为false 就能看到
|
||
|
//scene.globe.depthTestAgainstTerrain = true;
|
||
|
|
||
|
|
||
|
if (typeof Cesium !== 'undefined') {
|
||
|
startup(Cesium);
|
||
|
} else if (typeof require === 'function') {
|
||
|
require(['Cesium'], startup);
|
||
|
}
|
||
|
|
||
|
var _Cesium=null;
|
||
|
var viewer=null;
|
||
|
function startup(Cesium) {
|
||
|
_Cesium = Cesium;
|
||
|
var timer = null;
|
||
|
//solve_KHR_technique_webgl(Cesium);
|
||
|
|
||
|
$(document).ready(function() {
|
||
|
initialGlobeView();
|
||
|
});
|
||
|
|
||
|
function initialGlobeView() {
|
||
|
|
||
|
image_googleSource = new Cesium.UrlTemplateImageryProvider({
|
||
|
url: 'http://mt1.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Galil',
|
||
|
credit: ''
|
||
|
});
|
||
|
|
||
|
viewer = new Cesium.Viewer('webgis', {
|
||
|
geocoder: false,
|
||
|
homeButton: true,
|
||
|
sceneModePicker: true,
|
||
|
fullscreenButton: false,
|
||
|
vrButton: false,
|
||
|
baseLayerPicker: false,
|
||
|
animation: false,
|
||
|
infoBox: false,
|
||
|
selectionIndicator: false,
|
||
|
timeline : true,//是否显示时间轴
|
||
|
//terrainShadows:Cesium.ShadowMode.ENABLED,
|
||
|
navigationHelpButton: false,
|
||
|
navigationInstructionsInitiallyVisible: false,
|
||
|
mapProjection: new Cesium.WebMercatorProjection(),
|
||
|
imageryProvider: image_googleSource
|
||
|
});
|
||
|
|
||
|
viewer.scene.globe.enableLighting = false; //太阳光
|
||
|
// viewer.shadows = true; //阴影
|
||
|
//viewer.scene.globe.depthTestAgainstTerrain=true;
|
||
|
var layers = viewer.scene.imageryLayers;
|
||
|
var label_googleSource = new Cesium.UrlTemplateImageryProvider({
|
||
|
url: 'http://mt0.google.cn/vt/imgtp=png32&lyrs=h@365000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galil',
|
||
|
credit: ''
|
||
|
});
|
||
|
layers.addImageryProvider(label_googleSource);
|
||
|
layers.get(0).saturation = '2.5';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
var DrawVideoPlace,roam_start,roam_stop,roam_position;
|
||
|
require(['THW_3D','Cesium'],function(THW_3D,Cesium) {
|
||
|
var VideoFusionID=0;
|
||
|
var SetVideoFusionList=new Array();
|
||
|
var SetVideoFusion=null;
|
||
|
|
||
|
DrawVideoPlace = function(longitude,latitude,height) {
|
||
|
//不让该对象再响应点击
|
||
|
if(SetVideoFusion!=null){
|
||
|
if(!SetVideoFusion._isFinish){
|
||
|
return;
|
||
|
// SetVideoFusion.ClearVideoImages();//为保存就清除
|
||
|
}
|
||
|
SetVideoFusion.finishSet();//设置完成
|
||
|
}
|
||
|
SetVideoFusion=new THW_3D.SetVideoFusion(viewer);
|
||
|
var firstPos = Cesium.Cartesian3.fromDegrees(longitude,latitude,height);
|
||
|
var VideoEle=document.getElementById('hysbVideo');
|
||
|
SetVideoFusion.VisiablePlace(firstPos,VideoEle,VideoFusionID++);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
roam_start = _Cesium.JulianDate.fromDate(new Date());
|
||
|
roam_stop = _Cesium.JulianDate.addSeconds(roam_start, 62, new _Cesium.JulianDate());
|
||
|
viewer.timeline.zoomTo(roam_start, roam_stop);
|
||
|
function computeCirclularFlight(roam_time,roam_point) {
|
||
|
var property = new _Cesium.SampledPositionProperty();
|
||
|
for (var i = 0; i < roam_point.length; i ++) {
|
||
|
var roam_point_s = roam_point[i].split(",");
|
||
|
var position = _Cesium.Cartesian3.fromDegrees(parseFloat(roam_point_s[0]),parseFloat(roam_point_s[1]),parseFloat(roam_point_s[2]));
|
||
|
property.addSample(roam_time[i], position);
|
||
|
}
|
||
|
return property;
|
||
|
}
|
||
|
// var roam_time = [
|
||
|
// _Cesium.JulianDate.addSeconds(roam_start, 0, new _Cesium.JulianDate()),
|
||
|
// _Cesium.JulianDate.addSeconds(roam_start, 8, new _Cesium.JulianDate())
|
||
|
// ];
|
||
|
// var roam_point = [
|
||
|
// "117.02355703445403,36.66241786018697,12.945933902062002",
|
||
|
// "117.02355286061494,36.67271965666354,12.139419563517029"
|
||
|
// ];
|
||
|
// roam_position = computeCirclularFlight(roam_time,roam_point);
|
||
|
|
||
|
var roam_time = [];
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 0, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 8, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 10, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 18, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 23, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 27, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 36, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 42, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 50, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 57, new _Cesium.JulianDate()));
|
||
|
roam_time.push(_Cesium.JulianDate.addSeconds(roam_start, 62, new _Cesium.JulianDate()));
|
||
|
var roam_point = [];
|
||
|
roam_point.push("117.02355703445403,36.66241786018697,12.945933902062002");
|
||
|
roam_point.push("117.02355286061494,36.66271965666354,12.139419563517029");
|
||
|
roam_point.push("117.02360877208541,36.66271775053476,12.141608588653584");
|
||
|
roam_point.push("117.02361790879714,36.662907317081334,12.209787386643738");
|
||
|
roam_point.push("117.02370480116268,36.66298795610414,12.238425602537518");
|
||
|
roam_point.push("117.0236868740019,36.66305175992221,12.260505182978243");
|
||
|
roam_point.push("117.02366761838232,36.663376608902574,12.374845339086681");
|
||
|
roam_point.push("117.02342216578694,36.66339750512556,12.3791659285796");
|
||
|
roam_point.push("117.02319870560946,36.66345933325589,12.201500382231579");
|
||
|
roam_point.push("117.02308046973832,36.66350120772178,12.22084940240939");
|
||
|
roam_point.push("117.0228493667972,36.663499747384144,12.216595777633367");
|
||
|
roam_position = computeCirclularFlight(roam_time,roam_point);
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 动态添加气泡窗口
|
||
|
*/
|
||
|
var bubbleDiv = '<div id="trackPopUp" style="display:none;">'+
|
||
|
'<div id="trackPopUpContent" class="leaflet-popup" style="top:25px;left:-235px;width:500px;height:400px">'+
|
||
|
'<a class="leaflet-popup-close-button" href="#" style="margin-right:105px">×</a>'+
|
||
|
'<div class="leaflet-popup-content-wrapper" style="float:left;width:400px;height:300px">'+
|
||
|
'<div id="trackPopUpLink" class="leaflet-popup-content"></div>'+
|
||
|
'</div>'+
|
||
|
'<div class="leaflet-popup-tip-container" style="float:left">'+
|
||
|
'<div class="leaflet-popup-tip1"></div>'+
|
||
|
'</div>'+
|
||
|
'<div class="leaflet-popup-tip-container" style="float:left">'+
|
||
|
'<div class="leaflet-popup-tip2"></div>'+
|
||
|
'</div>'+
|
||
|
'</div>'+
|
||
|
'</div>';
|
||
|
$("#webgis").append(bubbleDiv);
|
||
|
|
||
|
//动态添加波纹窗口
|
||
|
var waveDiv = '<div id="trackWavaUp" style="pointer-events: none;display:none;" class="wave ripple danger">'+
|
||
|
'<div class="circle"></div><div class="circle"></div><div class="circle"></div></div>';
|
||
|
$("#webgis").append(waveDiv);
|
||
|
|
||
|
|