当我使用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);
}
});
}
}
有人可以帮助我吗?