一.Node相关
- 镜像:
registry = "https://registry.npmmirror.com"
二.Eslint格式检查
- 关闭语法格式检查
三.vue2框架相关
1.base_api
可以直接在data中指定
或者在vue.config.js中指定
2.打包报错 Thread Loader
在vue.config.js中加入:
3.el-upload组件的成功回调:
自定义上传成功的回调时,request.then()不能读取本组件的this:
var一个变量赋值this即可:
四.Cesium相关
1.entity的property属性:
必须用 Cesium.PropertyBag(),不能用原生的 new Object()
export function parseFieldInfo(data) {
var properties = new Cesium.PropertyBag();
const dataList = data.replace('[', ' ').replace(']', ' ').split(',');
for (let i = 0; i < dataList.length; i++) {
const typeName = dataList[i].split(':')[0].replace(' ', '');
const typeValue = dataList[i].split(':')[1];
properties.addProperty(typeName, typeValue)
}
return properties;
}
export function addPointToView(viewer, e, n, info, entityName) {
var point = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(e, n),
name: entityName,
point: {
color: Cesium.Color.FIREBRICK,
pixelSize: 6,
outlineColor: Cesium.Color.DARKSLATEGREY,
outlineWidth: 3,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
})
point.properties = parseFieldInfo(info);
return point.id;
}
viewer.screenSpaceEventHandler.setInputAction(click => {
let pickObj = viewer.scene.pick(click.position)
if (Cesium.defined(pickObj)) {
const pNames = pickObj.id.properties.propertyNames;
for (let i = 0; i < pNames.length; i++) {
console.log(pNames[i] + ":" + pickObj.id.properties[pNames[i]].getValue())
}
} else {
// console.log(click.position)
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
2.4490图源:
在provider中,添加变换属性:
tilingScheme: new Cesium.GeographicTilingScheme(),
否则会偏移-------------------------------------------------------------------------------------
未加参数:
添加参数后:
五.CASS内插等高线
先拟合继曲线,用样条拟合,再内插,滤波0.8,将内插的等高线关闭拟合,再重线转轻线