is there anyway to load PBF tiles in an mbtiles archive offline?
See original GitHub issueI tried to load Mbtiles file into mapview but failed, nothing is dipsplayed on the map.
mapView = (MapView) findViewById(map);
// offline usage
Timber.plant(new Timber.DebugTree());
File file = new File(Environment.getExternalStorageDirectory() + "/osmdroid/MbTilesBacNinh.mbtiles");
Timber.e("File exist? : " + file.exists());
SimpleRegisterReceiver simpleReceiver = new SimpleRegisterReceiver(this);
XYTileSource mbtilesRender = new XYTileSource(
"mbtiles",
0, 18, // zoom min/max <- should be taken from metadata if available
256, ".png", new String[]{});
IArchiveFile[] files = {MBTilesFileArchive.getDatabaseFileArchive(file)};
MapTileModuleProviderBase moduleProvider = new MapTileFileArchiveProvider(simpleReceiver, mbtilesRender, files);
MapTileProviderArray mProvider = new MapTileProviderArray(mbtilesRender, null,
new MapTileModuleProviderBase[]{moduleProvider}
);
mapView.setTileProvider(mProvider);
mapView.setUseDataConnection(false);
GeoPoint geoPoint = new GeoPoint(21.049034, 105.873479);
IMapController mapViewController = mapView.getController();
mapViewController.setZoom(15);
mapViewController.setCenter(geoPoint);
Is there any problem with my code? Can anyone please give me an update example which give me the example of the newest version of osmdroid library?
If I use private XYTileSource FourUMapsTileSource = new XYTileSource("4uMaps", 0, 18, 256, ".png", new String[]{});
, as below:
mapView.setTileSource(FourUMapsTileSource);
mapView.setUseDataConnection(false);
geoPoint.setCoords(21.049034, 105.873479);
IMapController mapViewController = mapView.getController();
mapViewController.setZoom(15);
mapViewController.setCenter(geoPoint);
everything will be ok. However, I want to load mbtile without knowing the map’s source. Is it possible?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14
Top Results From Across the Web
OSM offline tiles -- mbtiles in openlayers - GIS Stack Exchange
I used tiledownloader to download offline tiles. Now with the new policy acces of mapquest this would be difficult. ... How is it...
Read more >Leaflet display .mbTiles files in the map - Stack Overflow
I have downloaded UAE mbtiles from openmaptiles site. I need to show the map in offline for UAE. I'm using angular 4. I...
Read more >How do I create offline layers using MBTiles?
Uploading MBTiles Layers to Fulcrum · From the Fulcrum Layers page click the +New button. · Select MBTiles as the layer type. ·...
Read more >Using Geofabrik and HOT Export - LearnOSM
The Export Tool allows users to create MBTiles containing tiles from OSM, which can be used as sources of offline context within applications...
Read more >Fully offline webmap? : r/ArcGIS - Reddit
It delivers esri sceneserver URL from local SLPK and also serves LERC2 TILES from mbtiles, gpkg and zip archive and comes with ArcGIS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The default tile provider should just load them. I’ll take a look at it
On Jun 8, 2017 7:20 AM, “Grzegorz Orczykowski” notifications@github.com wrote:
going to close for now, . pbf support is not trivial.