当我使用Mapview加载地图时,可以显示地图,但是当操作地图时,它非常重要。使用SupportMapFragment
加载映射时非常平稳。这是我的代码:
private void initialize() {
setContentView(R.layout.activity_main);
boolean success = com.here.android.mpa.common.MapSettings.setIsolatedDiskCacheRootPath(
getApplicationContext().getExternalFilesDir(null) + File.separator + ".here-maps",
"com.here.android.tutorial.MapService");
if (!success) {
Toast.makeText(getApplicationContext(), "Unable to set isolated disk cache path.", Toast.LENGTH_LONG);
} else {
final MapView mapView = findViewById(R.id.mapview);
mapView.setVisibility(View.VISIBLE);
ApplicationContext context = new ApplicationContext(this);
MapEngine.getInstance().init(context, new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(Error error) {
Map map = new Map();
mapView.setMap(map);
}
});
}
}
有人可以帮助我吗?