[VTM] How to display local mvt files?

310 views
Skip to first unread message

Karsten T.

unread,
Aug 16, 2018, 10:16:07 AM8/16/18
to mapsforge-dev
Hello,

I want to develop an android-app that displays osm data as a basemap and a couple of layers with polylines and points on top of osm. The user should be able to get information for each feature in an upcoming version. Each feature-layer may contain up to 50k features. The original data is in a PostGIS-database and I converted it via GDAL 2.3 to z/x/y/ .pbf files. I copied the folder to my device but I don't know how to add it to the map. The "vtm-mvt" package contains a "MvtTileDecoder" class that seems to be crucial, but the other classes "MapzenMvtTileSource" etc. extend "UrlTileSource" which doesn't help in my case I guess. I tried to read the javadoc but it didn't help much. How can I display local mvt files? I'm already using the "MultiMapFileTileSource" so I guess I only need to add another source, which contains the local mvt files? Or should I create VectorTileLayer for each feature-layer? And how do I keep the attributes? Sorry for so many questions at once!

Emux

unread,
Aug 16, 2018, 10:37:47 AM8/16/18
to mapsfo...@googlegroups.com
- MVT vector tiles are more used via online tile providers and that what currently VTM supports via its tile sources.

Obviously someone can "implement" an offline solution, storing them in offline sqlite DBs - and provide a pull request!


- Or can use the existing solution with Mapsforge offline map files (MultiMapFileTileSource is for Mapsforge).
Just need to use the map-writer to create the map file from the data and then load it in VTM (like in the examples).

BTW can always add multiple layers (i.e. tile sources) on map, irrelevant of their source.

--
Emux
Reply all
Reply to author
Forward
0 new messages