首页 / 浏览问题 / 移动GIS / 问题详情
AS利用supermap插件导入三维模型场景,为什么虚拟机运行出来一片空白?
8EXP 2021年08月25日

虚拟机运行出来以后,只有项目名称和空白页面,其他什么都没有出来

代码如下:

private SceneControl m_sceneControl;
private Button m_btnOpen;
String url = "192.168.3.198:8090/iserver/services/3D-bridge-bridge-2/rest/realspace";
String sceneName = "bridge-bridge-2";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {
        requestPermissions() ;
        //String rootPath = android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
        Environment.setLicensePath("F:\\SuperMap\\license");
        Environment.initialization(this);
        setContentView(R.layout.activity_main);
        SceneControl m_sceneControl = (SceneControl) findViewById(R.id.SceneControl);
        Button m_btnOpen = (Button) findViewById(R.id.btn_open);
        m_btnOpen.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Scene scene = m_sceneControl.getScene();
                scene.open(url, sceneName);
                m_sceneControl.getScene().refresh();
            }
        });
    }catch (Exception e){
    }
}

1个回答

您好,不建议在虚拟机上运行三维程序,因为运行三维程序需要一定的设备性能要求。建议使用真机运行,先看下真机上是否有球面场景显示
9,127EXP 2021年08月25日
我这个是给你的示范代码,意思是这个路径手机里面的许可路径,不是随便一个路径就可以的。
可是这个许可路径不是许可文件存放的路径吗,我的许可文件存放的路径就是这个路径

我的意思是你需要通过上面给你的获取手机内存的代码来进行路径拼接:

String rootPath = android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
String rootPath = android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
Environment.setLicensePath(rootPath+"/storage/emulated/0/Download/QQMail/");

是这样吗?但是还是没有变化

你私信我电话联系方式吧,我电话联系您
...