Created
May 3, 2012 14:46
-
-
Save scottyab/2586159 to your computer and use it in GitHub Desktop.
Quick and dirty util to convert a lat/long into a uri for google static maps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* simple util to build the static google map url for the lat/long | |
* @param latitude | |
* @param longitude | |
* @return static google map url | |
*/ | |
public static Uri buildStaticGoogleMapUrlForAddress(String latitude, String longitude){ | |
Builder builder = Uri.parse("http://maps.google.com/maps/api/staticmap").buildUpon(); | |
builder.appendQueryParameter("center", latitude+","+longitude); | |
builder.appendQueryParameter("zoom", "15"); | |
builder.appendQueryParameter("size", "50x50"); | |
builder.appendQueryParameter("sensor", "false"); | |
builder.appendQueryParameter("maptype", "roadmap"); | |
builder.appendQueryParameter("scale", "1"); | |
Uri uri = builder.build(); | |
return uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment