Google Maps

Acuario

Active Member
Licensed User
Longtime User
Hi,

is there a way to use the Google Maps application programatically to display a map/location while offline?

All the samples etc. that I can find reference the WebView to open a browser and retrieve map data from the Google servers.

I found, in the Google API the Maps External Library that references an object called MapView; it sounds like this may be the answer but..
is there any way to use this in b4a?

I need to display a map to a user when they are out of coverage of both Wifi and cellular service but am struggling to find how to use the maps application + API to be able to do this. WebView just doesn't work in this situation.

Thanks,

Nigel
 

warwound

Expert
Licensed User
Longtime User
Hi.

There is currently no MapView is B4A.

Even if there was i think you'd still need a network connection to download map image tiles for the area that's to be displayed while offline.

I'd imagine that MapView works much the same as the official Google Maps for Android application.
I just disabled all data on my mobile and started the map app.
It displayed ok to start with as it had already (previously) cached the map tiles for my location.
I panned away to another area and of course no map tiles are cached, none can be downloaded so no map displays for that area.

A solution might be to look at using OpenStreetMap in a web page in a WebView.
I'm not 100% sure but seem to remember that OpenStreetMap could be used in an offline situation - but you'd still need to have pre-cached whatever map tiles you need for an area before the device goes offline.

Martin.
 
Upvote 0
Top