Skip to content

Commit 1d716ac

Browse files
authored
Revert "Ljy"
1 parent 58a8cfc commit 1d716ac

File tree

4 files changed

+15
-66
lines changed

4 files changed

+15
-66
lines changed

src/cesiumjs/layer/TilesLayer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export default class TilesLayer extends BaseLayer {
7171
* @param {Rectangle} [optionsParam.tileRange=Rectangle.fromDegrees(-180,-90,180,90)] 默认范围为全球范围
7272
* @param {Number} [optionsParam.colNum=2] 瓦片初始级的列数 默认为2
7373
* @param {Number} [optionsParam.rowNum=1] 瓦片初始级的列数 默认为1
74-
* @param {Number} [options.minimumLevel=0] 瓦片最小级别
75-
* @param {Number} [options.maximumLevel=19] 瓦片最大级别
74+
* @param {Number} [optionsParam.maxLevel=19] 瓦片最大显示级数 默认为19
7675
* @param {String} [optionsParam.proxy] 转发代理
7776
* @param {Array} [options.gdbps] gdbps地址数组
7877
* @param {String} [options.layers] layers参数,用于过滤图层

src/cesiumjs/manager/CommonDataManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default class CommonDataManager extends LayerManager {
111111
* @returns {Object} model 移除通过 removeModel()
112112
* @example
113113
* let modelUrl = '../../../../../../static/data/CesiumAir/Cesium_Air.gltf';
114-
cesiumFun.appendModel('1', modelUrl, 114, 28, 200, 100000, {
114+
cesiumFun.appendModels('1', modelUrl, 114, 28, 200, 100000, {
115115
color: Cesium.Color.RED,
116116
colorBlendMode: Cesium.ColorBlendMode.MIX,// MIX是混合 Cesium.ColorBlendMode.HIGHLIGHT, HIGHLIGHT是高亮
117117
colorBlendAmount: 0.4 //这个是程度
@@ -160,7 +160,7 @@ export default class CommonDataManager extends LayerManager {
160160

161161
/**
162162
* 通过文件批量添加模型
163-
* @function module:客户端公共方法.CommonDataManager.prototype.appendModelsByFile
163+
* @function module:客户端公共方法.CommonDataManager.prototype.appendModels
164164
* @param {String} filePath 模型组织文件
165165
* @param {Function} successCall 成功后的回调
166166
* @returns {Object} 模型层对象

src/cesiumjs/manager/CommonFuncManager.js

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,8 @@ export default class CommonFuncManager {
138138
* //res.toPng();
139139
*/
140140
outputImageObj() {
141-
let isAn = true;
142-
if (this.viewer.shouldAnimate === false) {
143-
this.viewer.shouldAnimate === true;
144-
isAn = false;
145-
}
146141
this.viewer.render();
147-
if (!isAn) {
148-
this.viewer.shouldAnimate === false;
149-
}
150-
return Cesium.ReImg.fromCanvas(this.viewer.canvas);
142+
return Cesium.reimg.fromCanvas(this.viewer.canvas);
151143
}
152144

153145
/**
@@ -161,7 +153,7 @@ export default class CommonFuncManager {
161153
*/
162154
outputImageFile(fileName) {
163155
this.viewer.render();
164-
Cesium.ReImg.fromCanvas(this.viewer.canvas).downloadPng(fileName);
156+
Cesium.reimg.fromCanvas(this.viewer.canvas).downloadPng(fileName);
165157
}
166158

167159
/**
@@ -203,13 +195,6 @@ export default class CommonFuncManager {
203195
* @function module:客户端公共方法.CommonFuncManager.prototype.getSceneRange
204196
* @param {String} 视图元素ID
205197
* @returns {Array[]} 场景范围(单位:经纬度)Array<[lon,lat]>
206-
* @example
207-
* var viewer = new Cesium.Viewer('GlobeView1', {
208-
* terrainExaggeration: 1,
209-
* requestRenderMode: true
210-
* });
211-
* let id = 'GlobeView1';
212-
* cfm.getSceneRange(id);
213198
*/
214199
getSceneRange(elementID) {
215200
const controlDiv = document.getElementById(elementID);
@@ -457,33 +442,15 @@ export default class CommonFuncManager {
457442
let carCenter = new Cesium.Cartographic();
458443
carCenter = Cesium.Cartographic.fromCartesian(center, this.ellipsoid, carCenter);
459444
carCenter.height = 0;
460-
const centerUse = Cesium.Cartesian3.fromRadians(
461-
carCenter.longitude,
462-
carCenter.latitude,
463-
carCenter.height,
464-
this.ellipsoid,
465-
new Cesium.Cartesian3()
466-
);
467-
const centerUseEx = Cesium.Cartesian3.fromRadians(
468-
carCenter.longitude,
469-
carCenter.latitude + 0.1,
470-
carCenter.height,
471-
this.ellipsoid,
472-
new Cesium.Cartesian3()
473-
);
445+
const centerUse = Cesium.Cartesian3.fromRadians(carCenter.longitude, carCenter.latitude, carCenter.height, this.ellipsoid, new Cesium.Cartesian3());
446+
const centerUseEx = Cesium.Cartesian3.fromRadians(carCenter.longitude, carCenter.latitude + 0.1, carCenter.height, this.ellipsoid, new Cesium.Cartesian3());
474447
let tempdir = Cesium.Cartesian3.subtract(centerUseEx, centerUse, new Cesium.Cartesian3());
475448
tempdir = Cesium.Cartesian3.normalize(tempdir, tempdir);
476449

477450
let carTarget = new Cesium.Cartographic();
478451
carTarget = Cesium.Cartographic.fromCartesian(target, this.ellipsoid, carTarget);
479452
carTarget.height = 0;
480-
const targetUse = Cesium.Cartesian3.fromRadians(
481-
carTarget.longitude,
482-
carTarget.latitude,
483-
carTarget.height,
484-
this.ellipsoid,
485-
new Cesium.Cartesian3()
486-
);
453+
const targetUse = Cesium.Cartesian3.fromRadians(carTarget.longitude, carTarget.latitude, carTarget.height, this.ellipsoid, new Cesium.Cartesian3());
487454

488455
let tarDir = Cesium.Cartesian3.subtract(targetUse, centerUse, new Cesium.Cartesian3());
489456
tarDir = Cesium.Cartesian3.normalize(tarDir, tarDir);
@@ -529,8 +496,8 @@ export default class CommonFuncManager {
529496
* let drawElement = new Cesium.DrawElement(viewer);
530497
* let commfun = new CommonFun({viewer:viewer});
531498
* drawElement.startDrawingPolyline({
532-
* callback: function(result){
533-
* let simplify = commfun.simplifyLine(result.positions);
499+
* callback: function(positions){
500+
* let simplify = commfun.simplifyLine(positions);
534501
* polyline = new Cesium.DrawElement.PolylinePrimitive({
535502
* positions: simplify,
536503
* width: 1,
@@ -553,11 +520,7 @@ export default class CommonFuncManager {
553520
}
554521
for (let i = 0; i <= posCopy.length - 3; i += 1) {
555522
const isVertice = !((posCopy[i].z - posCopy[i + 1].z) * (posCopy[i + 1].z - posCopy[i + 2].z) > 0);
556-
const angle = calAngleOf3Pnt(
557-
[posCopy[i].x, posCopy[i].y, posCopy[i].z],
558-
[posCopy[i + 1].x, posCopy[i + 1].y, posCopy[i + 1].z],
559-
[posCopy[i + 2].x, posCopy[i + 2].y, posCopy[i + 2].z]
560-
);
523+
const angle = calAngleOf3Pnt([posCopy[i].x, posCopy[i].y, posCopy[i].z], [posCopy[i + 1].x, posCopy[i + 1].y, posCopy[i + 1].z], [posCopy[i + 2].x, posCopy[i + 2].y, posCopy[i + 2].z]);
561524

562525
if (angle > 175 && !isVertice) {
563526
posCopy = posCopy.slice(0, i + 1).concat(posCopy.slice(i + 2));
@@ -592,10 +555,7 @@ export default class CommonFuncManager {
592555
static calcParabola(options) {
593556
// 方程 y=-(4h/L^2)*x^2+h h:顶点高度 L:横纵间距较大者
594557
const h = options.height && options.height > 5000 ? options.height : 5000;
595-
const L =
596-
Math.abs(options.position1.lon - options.position2.lon) > Math.abs(options.position1.lat - options.position2.lat)
597-
? Math.abs(options.position1.lon - options.position2.lon)
598-
: Math.abs(options.position1.lat - options.position2.lat);
558+
const L = Math.abs(options.position1.lon - options.position2.lon) > Math.abs(options.position1.lat - options.position2.lat) ? Math.abs(options.position1.lon - options.position2.lon) : Math.abs(options.position1.lat - options.position2.lat);
599559
const num = options.num && options.num > 50 ? options.num : 50;
600560
const result = [];
601561
let dlt = L / num;
@@ -753,7 +713,7 @@ export default class CommonFuncManager {
753713
});
754714
*/
755715
createNavigationTool(options) {
756-
this.viewer.extend(Cesium.NavigationTool, options);
716+
this.viewer.extend(Cesium.viewerCesiumNavigationMixin, options);
757717
return this.viewer.cesiumNavigation;
758718
}
759719
}

src/cesiumjs/manager/EntityController.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,22 +422,12 @@ export default class EntityController extends BaseLayer {
422422
positions: simplifyPnts,
423423
width: 1,
424424
geodesic: true,
425-
id: name,
426-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
425+
id: name
427426
};
428-
var color = Cesium.defaultValue(options.color,Cesium.Color.BLUE);
429427
if (Cesium.defined(options)) {
430428
Object.extend(para, options);
431429
}
432-
var polyline = new Cesium.Primitive({
433-
geometryInstances : new Cesium.GeometryInstance({
434-
geometry : new Cesium.PolylineGeometry(para),
435-
attributes: {
436-
color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
437-
}
438-
}),
439-
appearance: new Cesium.PolylineColorAppearance()
440-
})
430+
const polyline = new Cesium.PathTool.PolylinePrimitive(para);
441431
this.scene.primitives.add(polyline);
442432
if (typeof callback === 'function') {
443433
callback(polyline);

0 commit comments

Comments
 (0)