这是点击加载场景后的图像,此时屏幕已经卡住。没有反应。。
使用产品:supermap-imobile-9.0.1-103-android-zip-chs 操作系统:小米5Splus android 7
另附上代码:
public class EarthActivity extends Activity {
private SceneControl m_sceneControl;
private Button opensceneBtn;
private Button openlayerBtn;
// 离线三维场景数据名称
String url = "http://192.168.235.118:8090/iserver/services/3D-CBD/rest/realspace";
// 三维场景名称
String sceneName = "CBD";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//myPermission();
requestAllPower();
//获取设备存储根目录
String rootPath = android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
//设置许可存放目录
Environment.setLicensePath(rootPath + "/SuperMap/license");
Environment.initialization(this);
setContentView(R.layout.activity_earth);
initView();
}
private void initView(){
m_sceneControl = (SceneControl)findViewById(R.id.SceneControl);
opensceneBtn = (Button)findViewById(R.id.btn_open1);
//openlayerBtn = (Button)findViewById(R.id.btn_open2);
opensceneBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
openScene();
}
});
// openlayerBtn.setOnClickListener(new View.OnClickListener() {
//
// @Override
// public void onClick(View v) {
// // TODO Auto-generated method stub
// openLayer();
// }
// });
}
public void requestAllPower() {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
} else {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.READ_PHONE_STATE}, 1);
}
}
}
public void openScene(){
if (m_sceneControl.getScene()!=null) {
m_sceneControl.getScene().close();
}
m_sceneControl.getScene().open(url,sceneName);
m_sceneControl.getScene();
// m_sceneControl.getScene().refresh();
// SceneServicesList sceneServiceList = new SceneServicesList();
// Boolean bLoad = sceneServiceList.load(url);
// // 通过已知的场景名称打开场景
// if(bLoad)
// {
// m_sceneControl.getScene().open(url,sceneName);
// }
}
}