D
D
Dmtm2019-04-03 08:58:28
Android
Dmtm, 2019-04-03 08:58:28

Why doesn't mapsforge render tiles?

> the tiles themselves are rendered, a cache is created on the memory card, a gray layer is visible on the MapView itself on a white background and you can see > that this is a map, it is loaded in squares, but the tiles themselves are not shown, I also see the zoom and the ruler
looked at the tiles themselves - like files they are generated but not rendered, all the same size with a gray fill,
i.e. MapView all shows
the maps themselves correctly from here ftp-stud.hs-esslingen.de/pub/Mirrors/download.maps...
tried v3 and v5 (by the way - what's the difference?)

implementation 'org.mapsforge:mapsforge-core:0.11.0'
    implementation 'org.mapsforge:mapsforge-map:0.11.0'
    implementation 'org.mapsforge:mapsforge-map-reader:0.11.0'
    implementation 'org.mapsforge:mapsforge-themes:0.11.0'
    implementation 'net.sf.kxml:kxml2:2.3.0'
    implementation 'org.mapsforge:mapsforge-map-android:0.11.0'
    implementation 'com.caverock:androidsvg:1.3'

AndroidGraphicFactory.createInstance(this); //Appplication.onCreate

private fun createMapViews(root: View) {
        mapView = root.findViewById(R.id.mapView)
        mapView.model.init(preferencesFacade)
        mapView.isClickable = true
        mapView.mapScaleBar.isVisible = true
        mapView.setBuiltInZoomControls(true)
        mapView.mapZoomControls.isAutoHide = true
        mapView.mapZoomControls.zoomLevelMin = 0
        mapView.mapZoomControls.zoomLevelMax = 15
    }
...
  private fun createLayers() {
        val tileCache = AndroidUtil.createTileCache(
            activity, TILES_FOLDER,
            mapView.model.displayModel.tileSize,
            1.0f,
            1.5
        )
        mapView.layerManager.layers.add(
            AndroidUtil.createTileRendererLayer(
                tileCache,
                mapView.model.mapViewPosition,
                getMapFile(),
                getRenderTheme()
            )
        )
        //this.mapView.setCenter(this.dummyItem.location);
        this.mapView.setZoomLevel(16)
    }

   private fun getRenderTheme(): XmlRenderTheme {
        return InternalRenderTheme.OSMARENDER
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmtm, 2019-04-04
@Dmtm

everything works, gray tiles are just areas for which there is no data,
you just need to correctly position yourself in the center of the map and select the correct zoom
(manual scrolling and zoom did not help to see the map of the small island)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question