1.cesium的一套加点、坐标转化方法:
startPosition = viewer.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid); //将方法放置于左键点击事件内,鼠标点击获取当前世界坐标
var cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(startPosition); //将世界坐标转换成弧度坐标
var lon = Cesium.Math.toDegrees(cartographic.longitude); //弧度转经纬度
var lat = Cesium.Math.toDegrees(cartographic.latitude); //弧度转经纬度
startPositionDegrees = [lon, lat];
2.实体的添加方法:
label = viewer.entities.add({
position: new Cesium.Cartesian3.fromDegrees(lon, lat, 15), //设置位置信息
label: { //数值标签属性
text: "移动绘制搜索区域,双击结束,右键点击取消",
font: '10pt monospace',
fillColor: Cesium.Color.CORNSILK,
backgroundColor: Cesium.Color.fromAlpha(Cesium.Color.BLACK, 0.5),
showBackground: true,
outlineColor: Cesium.Color.BLANK,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 2,
},
});
3.文件的上传
html页面:(以form表单的形式进行上传)
var formData = new FormData();
formData.append('file', $('#FirePlanfile')[0].files[0]);
formData.append('path', "Video");
$.ajax({
type: 'POST',
url: '/Manager/UploadFile',
data: formData,
contentType: false,
processData: false,
success: function (result) {
}
});