I'm looking for a way to use custom map tiles with the Google Map API V2 for Android.
I'm writing an application that will create it's own maps in real time with data that are comming from a robot.
The application need to show to the operator this map. The operator need to interact with this map, letting way points, etc.
I want to use the GoogleMap engine in order to do the same that this page :
http://cdn.mikecouturier.com/blog.mikecouturier.com/tilesgenerator/index.html
The problem is that he used the Javascript API when I want to use the Android API
Is there any way to use Custom tiles map on android with the Google Maps Engine?
I'm already looking at how to use ArcGIS but, i prefer using an API without paying for a license.
Best Answer
Yes, you can use custom tiles with Android Maps API v2 - you can see a fully working example in our OpenTripPlanner for Android app on Github. (You can also download the app directly from Google Play)
We support the following tile providers:
Our CustomUrlTileProvider class can be seen here on Github, and I've also pasted it below:
And here's the code that switches between map tile providers, based on user preference:
Here's a screenshot of the MapQuest OpenStreetMap tiles:
For more information on making your own tiles, see the Google documentation for TileOverlay as well as the OpenStreetMap wiki for "Creating your own tiles".
Specifically, the Google documentation says:
The formatted URLs that are used within OTP Android to reference each tile provider look like:
So, for the above providers the tile images are PNG files arranged in the directory structure indicated by the Google documentation. You would follow a similar format to create your own map tiles hosted on your own server. Note that these URLs/images must be publicly accessible to the mobile device (i.e., cannot be password protected).