{"action":"opened","issue":{"url":"https://api.github.com/repos/osmdroid/osmdroid/issues/240","labels_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/240/comments","events_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/240/events","html_url":"https://github.com/osmdroid/osmdroid/issues/240","id":125847023,"number":240,"title":"How to display several MapsForge .map files?","user":{"login":"2ndGAB","id":14370028,"avatar_url":"https://avatars.githubusercontent.com/u/14370028?v=3","gravatar_id":"","url":"https://api.github.com/users/2ndGAB","html_url":"https://github.com/2ndGAB","followers_url":"https://api.github.com/users/2ndGAB/followers","following_url":"https://api.github.com/users/2ndGAB/following{/other_user}","gists_url":"https://api.github.com/users/2ndGAB/gists{/gist_id}","starred_url":"https://api.github.com/users/2ndGAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2ndGAB/subscriptions","organizations_url":"https://api.github.com/users/2ndGAB/orgs","repos_url":"https://api.github.com/users/2ndGAB/repos","events_url":"https://api.github.com/users/2ndGAB/events{/privacy}","received_events_url":"https://api.github.com/users/2ndGAB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-10T21:26:10Z","updated_at":"2016-01-10T21:26:10Z","closed_at":null,"body":"Hello,\r\n\r\nI'd like to display several MapsForge .map files at the same time because France is cutted out in several regions.\r\nI tried the code below. I don't know if it's the good way to it anyway, I have a problem with it.\r\nWhen I zoom in and out, I briefly see all maps but I finally see only the last overlay because they are rendered with a with background instead of a transparent one.\r\nSo how to use several .map files?\r\n\r\nAnd I also see that rendering such offline map seems to be slower than rendering online default one. Strange, why?\r\n\r\nSo my code is:\r\n\r\n    boolean setMapsForgeTileProvider(){\r\n\r\n        String path = Environment.getExternalStorageDirectory().getPath()+\"/mapsforge/\";\r\n        File folder = new File(path);\r\n        File[] listOfFiles = folder.listFiles();\r\n\r\n        if (listOfFiles == null)\r\n            return false;\r\n\r\n        File mapFile = null;\r\n        for (File file:listOfFiles){\r\n            if (file.isFile() && file.getName().endsWith(\".map\")){\r\n                mapFile = file;\r\n                MapsForgeTileProvider mfProvider = new MapsForgeTileProvider(new SimpleRegisterReceiver(getActivity()), mapFile);\r\n                final TilesOverlay tilesOverlay = new TilesOverlay(mfProvider, getActivity());\r\n                tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);\r\n                mMapView.getOverlays().add(tilesOverlay);\r\n            }\r\n        }\r\n\r\n        if (mapFile == null)\r\n            return false;\r\n\r\n        mMapView.setUseDataConnection(false);\r\n        return true;\r\n    }\r\n\r\nBefore my application calls ``setMapsForgeTileProvider()``, it calls ``setStdTileProvider()`` below:\r\n\r\n    void setStdTileProvider(){\r\n        if ((mMapView == null) || !(mMapView.getTileProvider() instanceof MapTileProviderBasic)){\r\n            GenericMapView genericMap = (GenericMapView) rootView.findViewById(R.id.mapview);\r\n            MapTileProviderBasic bitmapProvider = new MapTileProviderBasic(getActivity().getApplicationContext());\r\n            genericMap.setTileProvider(bitmapProvider);\r\n            mMapView = genericMap.getMapView();\r\n            mMapView.setTileSource(TileSourceFactory.MAPQUESTOSM);\r\n        }\r\n    }\r\n\r\nRegards,\r\nAlain\r\n"}}