OSMDroid 加载图块的速度非常慢

Mic*_*key 5 android openstreetmap osmdroid

我使用的是 osmdroid 版本 5.6.5(最新版本),地图的图块(MAPNIK)加载非常缓慢。

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

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

这是活动中地图的代码片段:

@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);
}
Run Code Online (Sandbox Code Playgroud)

我似乎无法找到这种缓慢加载的原因。是否可以选择使用更简单的地图?那会有帮助吗?有没有其他解决方案,我做错了什么?

谢谢。

Але*_*ков 3

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

Configuration.getInstance().setUserAgentValue(BuildConfig.APPLICATION_ID);
Run Code Online (Sandbox Code Playgroud)