Reputation: 2325
I'm using google map in my android application to show the current location of the user. I'm using "animateCamera" api to move the map when ever user location get changed.
Issue: When the user moves in a speed of more than 30km/hour or if the internet connection is poor, while moving the map new area is not getting loaded immediately, only grey tile is getting displayed.
Please help me to achieve any of the solution below.
How to load the nearby area of the map while displaying current location(Right now the map fragment gets loaded only to the display area of mobile).
(or)
Download the offline map for 1 km radius of current location.
Thanks in Advance.
Upvotes: 0
Views: 420
Reputation: 13343
You can use Tile Overlays with Url for tile http://mt1.google.com/vt/lyrs=[MAP_KIND]&x=[TILE_X]&y=[TILE_Y]&z=[ZOOM_LEVEL]
e.g.:
http://mt1.google.com/vt/lyrs=m&x=1465&y=949&z=11
for getting map tiles and create the cache. But read carefully p. 10.5.d (and others) of Google Maps APIs Terms of Service:
b) No caching or storage. You will not pre-fetch, cache, index, or store any Content to be used outside the Service, except that you may store limited amounts of Content solely for the purpose of improving the performance of your Maps API Implementation due to network latency (and not for the purpose of preventing Google from accurately tracking usage), and only if such storage:
i. is temporary (and in no event more than 30 calendar days);
ii. is secure;
iii. does not manipulate or aggregate any part of the Content or Service; and
iv. does not modify attribution in any way.
Upvotes: 2