zoukankan      html  css  js  c++  java
  • 在三维场景中加载shp(skyline)

    在场景中添加shp图层有两个方法:

    (1)直接调用Command命令,SGWorld.Command.Execute(1013,5);这样的话,和在场景中的工程树中右键添加特征图层的过程是一样的。有个问题时,当TE Pro是客户端版的话,会导致这个功能没法实现,许可权限不够。类似添加其他数据参考下面的命令:

    (2)通过CreateFeatureLayer()方法添加,代码如下:

    //加载shp文件
    function AddShp() {
        SGWorld = TE.ISGWorld61();
        groupItem = SGWorld.ProjectTree.FindItem(pconfig.GroupName);//创建父组,
        var conn="FileName="+shpFilePath+";TEPlugName=OGR;"  //创建连接字符串
        SGWorld.Creator.CreateFeatureLayer('NewShp', conn, groupItem);   //在父组下面加载shp
        //获取新加载的shp
        var itemID = SGWorld.ProjectTree.FindItem(pconfig.GroupName + "\NewShp"); 
        mlayer = SGWorld.ProjectTree.GetLayer(itemID);
    
        mlayer.Refresh();//得刷新下才会出现新加载的shp
        SGWorld.Navigate.FlyTo(itemID); //飞到新添加的shp,可查看是否加载了
    }
    

      

  • 相关阅读:
    c++错误崩溃3
    c++崩溃错误2
    c++多线程崩溃错误1
    MySQL UNSIGNED
    2PC和3PC
    proxy-target-class="false"与proxy-target-class="true"区别
    Spring MVC processing flow
    Spring中自动装配的模式
    Spring中BeanFactory和ApplicationContext的区别
    什么是Spring
  • 原文地址:https://www.cnblogs.com/pengjw/p/3483232.html
Copyright © 2011-2022 走看看