如何屏蔽在Skyline的TerraExplorer中加载Shape或者KML等数据时的缓冲提示信息

在使用TerraExplorer软件或者二次开发自定义打开FLY工程时,以及在已有的FLY工程中导入其他矢量数据,如SHP、WFS图层、KML图层时,总会看到类似下图的提示信息:

如何屏蔽在Skyline的TerraExplorer中加载Shape或者KML等数据时的缓冲提示信息

有些用户问,如何能屏蔽上述信息呢?

很简单,设置OnSGWorldMessage函数的返回值为True即可;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function Init() {
try {
var sg = CreateSGObj();
sg.AttachEvent("OnSGWorldMessage", OnSGWorldMessage);
}
catch (e) {
alert(e);
}
} function OnSGWorldMessage(MessageID, SourceObjectID) {
return true;
} //------------------------------------------------------------
// 创建sgworld对象 赵贺 2011.04.07.
//------------------------------------------------------------
function CreateSGObj() {
var obj = $("sgworld");
if (obj == null) {
obj = document.createElement('object');
document.body.appendChild(obj);
obj.name = "sgworld";
obj.id = "sgworld";
obj.classid = "clsid:3a4f9197-65a8-11d5-85c1-0001023952c1";
}
return obj;
}
function $(id) {
return window.document.getElementById(id);
}
</script>
</head>
<body onload = "Init()"> </body>
</html>

  

上一篇:react native 学习一(环境搭配和常见错误的解决)


下一篇:调用opencv打开不摄像头