[VTM] Multiple map files

335 views
Skip to first unread message

Emux

unread,
Nov 2, 2016, 9:02:20 AM11/2/16
to mapsforge-dev
Another big feature - known in Mapsforge as MapDataStore Interface - is coming to VTM!


I added multiple maps support in VTM via the new 'MultiMapFileTileSource', which propagates its calls to each added 'MapFileTileSource' and is used with a single layer.
issue #208

To work properly I enabled tessellation also for Mapsforge sea polygons in render themes (e.g. for overlapping maps).

Additionally I enhanced the new API with min / max zoom levels per added 'MapFileTileSource', to turn them on/off easily.

You can check it in action at 'MapsforgeMultiTest' sample.

Note: we could use multiple maps already with different layers, but that's not an optimal solution. :)
Also I didn't follow Mapsforge implementation with data policy, but we could add it later as it's quite useful.

So we have now a very good infrastructure for further improvements.

Screenshot shows detailed ireland.map on top of low detailed world.map.

--
Emux
MultiMapFileTileSource.png

Kees van Reeuwijk

unread,
Nov 11, 2016, 2:40:38 PM11/11/16
to mapsforge-dev


On Wednesday, 2 November 2016 14:02:20 UTC+1, Emux wrote:
You can check it in action at 'MapsforgeMultiTest' sample.

The addition looks great, but it doesn't seem to be in the current SNAPSHOT, and I cannot find the MapsforgeMultiTest sample, and neither can Google. I'm sure I'm missing something. 

Emux

unread,
Nov 11, 2016, 2:45:57 PM11/11/16
to mapsfo...@googlegroups.com
Actually snapshot publish is done automatically with every successful commit, latest was yesterday.

Perhaps your IDE has not renew its snapshot artifacts?
Can you do a clean and re-build?

Or try the following to check for updates on every build:

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

--
Emux

Kees van Reeuwijk

unread,
Nov 11, 2016, 2:59:12 PM11/11/16
to mapsforge-dev
Yeah, was the puzzle: that commit should have had plenty of time to reach the snapshots. I already cleared the grade caches in ~/.gradle, but that did not help, and a clean build also did not help. However, a variation on your suggestion did help. In Android Studio I did 'File | Invalidate Caches / Restart...'. And that did work!

I'm still searching for the location of the sample, though.

Thanks for your help!

-- 
Kees

Emux

unread,
Nov 11, 2016, 3:02:35 PM11/11/16
to mapsfo...@googlegroups.com
Do you use the new Build Cache of Android Studio?
Last time it didn't worked properly with snapshot updates (was keeping the old in cache).


On 11/11/2016 09:59 μμ, Kees van Reeuwijk wrote:
I'm still searching for the location of the sample, though.

Kees van Reeuwijk

unread,
Nov 11, 2016, 3:24:24 PM11/11/16
to mapsforge-dev


On Friday, 11 November 2016 21:02:35 UTC+1, Emux wrote:
Do you use the new Build Cache of Android Studio?
Last time it didn't worked properly with snapshot updates (was keeping the old in cache).

No, I wasn't. In hindsight it was probably just the caching of the assistants or whatever they are called. I mean the hints that you get when you click a red or yellow lightbulb.

Anyway, I now have the code working, thanks again!

One final question: the obvious thing to do with a MultiMapFileTileSource is to fill it with all the .map files in a certain directory. Is it necessary to handle a low-resolution world.map separately, and add that first or last?

Emux

unread,
Nov 11, 2016, 3:35:25 PM11/11/16
to mapsfo...@googlegroups.com
On 11/11/2016 10:24 μμ, Kees van Reeuwijk wrote:
One final question: the obvious thing to do with a MultiMapFileTileSource is to fill it with all the .map files in a certain directory. Is it necessary to handle a low-resolution world.map separately, and add that first or last?

You can fill it in whatever order, the elements appear combined per tag from all maps: sea, land, roads, poi, etc.

An extra feature to check is MultiMapFileTileSource.add(mapFileTileSource, zoomMin, zoomMax) for map sources to show / hide at certain zooms.
e.g. show world.map at zooms <7 and countries maps at zooms >7

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