gpt4 book ai didi

android - OSMDroid 加载图 block 非常慢

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:12:29 26 4
gpt4 key购买 nike

我使用的是 osmdroid 版本 5.6.5(最新版本), map (MAPNIK) 的图 block 加载速度非常慢。

这发生在我试用该应用程序的两台设备上,两台设备都具有高速互联网连接(蜂窝网络和 WIFI)。

这似乎是某个地方的问题,因为加载不可能那么慢

这是 Activity 中带有 map 的代码 fragment :

@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

appContext = getApplicationContext();

//important! set your user agent to prevent getting banned from the osm servers
Configuration.getInstance().load(appContext, PreferenceManager.getDefaultSharedPreferences(appContext));
setContentView(R.layout.navigation);

mMapView = (MapView) findViewById(map);
mMapView.setTileSource(TileSourceFactory.MAPNIK);
mMapView.setMultiTouchControls(true);
mMapView.setBuiltInZoomControls(true);

// add rotation gesture
mRotationGestureOverlay = new RotationGestureOverlay(this, mMapView);
mRotationGestureOverlay.setEnabled(true);
mMapView.setMultiTouchControls(true);
mMapView.getOverlays().add(this.mRotationGestureOverlay);



// Set to default location
IMapController mapController = mMapView.getController();
mapController.setZoom(15);
GeoPoint startPoint = new GeoPoint(48.8589654,2.2926013);
mapController.setCenter(startPoint);
}

我似乎找不到加载速度慢的原因。是否可以选择使用更简单的 map ?那会有帮助吗?还有其他解决方案吗,我做错了什么?

谢谢。

最佳答案

尝试在您的应用程序中设置 userAgentValue:

Configuration.getInstance().setUserAgentValue(BuildConfig.APPLICATION_ID);

关于android - OSMDroid 加载图 block 非常慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46104114/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com