使用产品:SuperMap iMobile 9D(2019) SP1 for Android,操作系统Win10 x64
数据为官方数据。
问题详细描述:
按照官方指导文档安装案例,不报bug但是闪退。日志不报错。下面是我在真机上的路径,以及部分代码
package com.supermap.supermapimobiledemo;
import android.view.Menu;
import android.view.MenuItem;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ZoomControls;
import com.supermap.data.Environment;
import com.supermap.data.Workspace;
import com.supermap.data.WorkspaceConnectionInfo;
import com.supermap.data.WorkspaceType;
import com.supermap.mapping.MapControl;
import com.supermap.mapping.MapView;
public class MainActivity extends Activity {
private MapControl m_mapcontrol = null;
private Workspace m_workspace;
private MapView m_mapView;
private ZoomControls m_zoom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Environment.setLicensePath( "sdcard/SuperMap/license/");
Environment.initialization(this);
setContentView(R.layout.activity_main);
//打开工作空间
m_workspace = new Workspace();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo();
info.setServer( "sdcard/SampleData/GeometryInfo/World.smwu");
info.setType(WorkspaceType.SMWU);
m_workspace.open(info);
//将地图显示控件和工作空间关联
m_mapView = (MapView)findViewById(R.id.Map_view);
m_mapcontrol = m_mapView.getMapControl();
m_mapcontrol.getMap().setWorkspace(m_workspace);
//打开工作空间中的第二幅地图
String mapName = m_workspace.getMaps().get(1);
m_mapcontrol.getMap().open(mapName);
m_zoom = (ZoomControls)findViewById(R.id.zoomControls1);
m_mapView = (MapView)findViewById(R.id.Map_view);
m_zoom.setIsZoomInEnabled(true);
m_zoom.setIsZoomOutEnabled(true);
//放大按钮
m_zoom.setOnZoomInClickListener(new OnClickListener() {
public void onClick(View v) {
m_mapcontrol.getMap().zoom(2);
m_mapcontrol.getMap().refresh();
}
});
//缩小按钮
m_zoom.setOnZoomOutClickListener(new OnClickListener(){
public void onClick(View v) {
m_mapcontrol.getMap().zoom(0.5);
m_mapcontrol.getMap().refresh();
}
});
m_mapcontrol.getMap().refresh();
}
}