var plot = Cesium.Plotting; console.log(plot); plotting = plot.getInstance(serverUrl, scene); console.log(plotting);
在示例里面是没有问题的
我的代码plotting获取不到 plot.getInstance(serverUrl, scene);没反应
能帮我看一下 是怎么回事吗
//态势图上传下载 serverUrl = 'http://192.168.0.159:8090/iserver/services/plot-jingyong/rest/plot/'; plottingLayer = new Cesium.PlottingLayer(scene, "plottingLayer"); scene.plotLayers.add(plottingLayer); var plotIn = Cesium.Plotting; console.log(plotIn); plotting = plotIn.getInstance(serverUrl, scene); console.log(plotting); plotEditControl = new Cesium.PlotEditControl(scene, plottingLayer);//编辑控件 plotDrawControl = new Cesium.PlotDrawControl(scene, plottingLayer);//绘制控件 plotDrawControl.drawControlEndEvent.addEventListener(function () { plotEditControl.activate();//标绘结束,激活编辑控件 }); sitDataManager = plotting.getSitDataManager(); sitDataManager.getSmlInfosCompleted.addEventListener(function (result) { this.getSMLInfosSucess(result); }); sitDataManager.openSmlFileCompleted.addEventListener(function (result) { widgets.alert.clearAlert(); var layers = sitDataManager.getPlottingLayers(); if (0 !== layers.length) { var layer = layers[0]; plottingLayer = layer; plotEditControl.setPlottingLayer(layer); plotDrawControl.setPlottingLayer(layer); } plotEditControl.activate(); widgets.alert.showAlert("加载态势图成功"); }); sitDataManager.saveSmlFileCompleted.addEventListener(function () { widgets.alert.clearAlert(); getSmlInfos(); widgets.alert.showAlert("保存态势图成功!"); }); sitDataManager.saveSmlFileFailed.addEventListener(function () { widgets.alert.clearAlert(); widgets.alert.showAlert("保存态势图失败"); }); sitDataManager.deleteSmlFileCompleted.addEventListener(function () { document.getElementById("downloadUrl").value = null; document.getElementById("smlFileName").value = null; getSmlInfos(); }); this.getSmlInfos(); this.fileFilter();
代码只能走到我刚才说的问题那,后面代码不走