http://support.supermap.com.cn/product/search.aspx?querystr=%E6%B7%B9%E6%B2%A1%E5%88%86%E6%9E%90
切换到超图代码下载即可参考,把其中的contourMap.set_coverageArea替换为ContourMap.set_coverageRegion,参数传一个您绘制面即可。获取或设置绘制淹没分析的多边形区域。
您好,按照您的思路也是很好改的哦。
先看效果:
function initCallback() { sceneControl.get_scene().open("http://support.supermap.com.cn:8090/iserver/services/3D-sample/rest/realspace", "BeijingDem"); //slopMap = new SuperMap.Web.Realspace.SlopeMap(); //颜色表 colors = new Array(); colors[0] = new SuperMap.Web.Core.Color(0, 0, 100,255); colors[1] = new SuperMap.Web.Core.Color(0, 0, 170,255); colors[2] = new SuperMap.Web.Core.Color(0, 0, 255,255); colors[3] = new SuperMap.Web.Core.Color(89, 138, 255,255); colors[4] = new SuperMap.Web.Core.Color(168, 193, 255,255); } //控件初始化失败后的回调函数 function failedCallback() { alert("Realspace initialized failed!"); } function startContourAnalysis() { //开始分析 contourMap = new SuperMap.Web.Realspace.ContourMap(); contourMap.set_maxVisibleAltitude(Number(document.getElementById("min").value)); contourMap.set_displayStyle(SuperMap.Web.Realspace.ContourDisplayStyle.COLORS); contourMap.set_interval(100); dOpacity = Number(document.getElementById("contourOpacity").value); contourMap.set_opacity(100-dOpacity); //设置颜色字典 var keys = new Array(0,500,800,1200,1500); contourMap.setColorDictionary(keys,colors); // var drawBoxAction = new SuperMap.Web.UI.Action3Ds.MyAction(sceneControl,contourMap); // sceneControl.set_sceneAction(drawBoxAction); var measureAreaAction = new SuperMap.Web.UI.Action3Ds.MeasureArea(sceneControl); sceneControl.set_sceneAction(measureAreaAction); sceneControl.addEvent("measureAreaFinished", areaFinishedHandler); document.getElementById("contourAnalysis").disabled = "true"; document.getElementById("contourClear").disabled = 0; } function areaFinishedHandler (area, region3D) { contourMap.set_coverageRegion(region3D); contourMap.build(); timerID=setInterval("testvisible(contourMap)",100); }
为什么我的会报错啊?