Using gps on a static map in android?

I have a map view in my application, and I can show the current GPS location on this map quite easily. However, I want to be able to offer standalone capabilities, or at least limited connectivity.

I decided that the best way to do this is to use a google static map, but since I have to use webview to display this and it does not extend mapactivity, can I still get mylocation overlay to work with a static map? Or do I need to always have this connection for live maps?

+4
source share
1 answer

I think you could get your location at the time they last had the ability to connect, and pass the coordinates to a static map api to place a marker on the map image.

Then you can implement LocationChangedListener and OnLocationChanged (and if the connection) reload the static map with a new location marker.

Also you don't need to use Webview, I used static map images as a URL in AysncImageView (but you could just use a standard image and use something like AQuery to load Async)

+1
source

Source: https://habr.com/ru/post/1381309/


All Articles