You are not logged in.

#1 2021-11-10 08:52:41

Tavernsenses
Member
Registered: 2010-04-24
Posts: 6

How to overlay an overlay map over a base map (android app)

So I'm trying to develop a tile-based navigation app in Android.

I've got my base map, which looks like this:

private MapView myBaseMap;
myBaseMap.setTileSource(TileSourceFactory.MAPNIK);

Now I want to overlay the base map with the bike map for the Netherlands. On in its own (no background map), that map looks like:

private MapView myOverlayMap;
myOverlayMap.setTileSource(TileSourceFactory.FIETS_OVERLAY_NL);

How can that be done?

I already tried:

myBaseMap.getOverlays().add(myOverlayMap);

but that is rejected because myOverlayMap is not of the reference type Overlay but MapView.

Your help will be much appreciated.

PS: on the side, using "PUBLIC_TRANSPORT" in stead of "MAPNIK" as the source variable for the base map gives an empty map screen. I understand that PUBLIC_TRANSPORT is a full map, not an overlay, so normally a map should show. Any idea why it doesn't?

Last edited by Tavernsenses (2021-11-10 09:01:11)

Offline

Board footer

Powered by FluxBB