-1

hi this raju iam new to android. i created a small project in that project i displayed a image as map with custom view. I have latitude and longitude point then how to show geopoints on image by using my latitude and longitude points please anyone help me. if any one knows please provide some samples.

raju
  • 785
  • 3
  • 14
  • 28

2 Answers2

0

Hope this will help you GoogleMap in Android

Ponmalar
  • 6,871
  • 10
  • 50
  • 80
  • thanks for your reply.i want to display geopoints on my imagemap not in google map – raju May 23 '12 at 04:34
  • ya i verified that but i want a custom map which is our image is displayed as map – raju May 23 '12 at 04:37
  • you are expected like this ah? http://stackoverflow.com/questions/7062115/android-how-to-display-a-map-still-image-file-with-a-moving-current-location and http://stackoverflow.com/questions/7072400/android-how-to-mark-the-current-location-into-a-map-still-image-source-cod – Ponmalar May 23 '12 at 04:39
  • yes i want like that i displayed my image as map but i have to add markers on my image – raju May 23 '12 at 04:42
  • find Source code to mark location on Map http://www.androidcompetencycenter.com/2009/01/android-location-api/ – Ponmalar May 23 '12 at 04:47
  • hey in that source it is for googlemap api but i want our own image as map and showing geopoints on our imagemap – raju May 23 '12 at 04:52
  • From this source code you can learn how to mark points on image. before that you can learn how to locate the Geo points on image from the above links – Ponmalar May 23 '12 at 04:53
0

There you go.

String getMapURL = "http://maps.googleapis.com/maps/api/staticmap?zoom=18&size=560x240" +
    "&markers=size:mid|color:red|" 
    + yourLatitude
    + "," 
    + yourLongitude
    + "&sensor=false";

URL imgValue = new URL(getMapURL);
Bitmap userIcon = BitmapFactory.decodeStream(imgValue.openConnection().getInputStream());

ImageView imgMapInImage = (ImageView) findViewById(R.id.imgMapInImage);
imgMapInImage.setImageBitmap(userIcon);

Customize the rest of the parameters such as the width and height attributes in the getMapURL. My example uses the dimensions of 560*240. Use your dimensions. Also change the zoom, the pin size and colors to your liking.

Hope this helps.

EDIT: this example uses the Google Maps Static API. For more customization options, refer to this URL here: https://developers.google.com/maps/documentation/staticmaps/

Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
  • http://www.google.co.in/imgres?imgurl=http://mappery.com/maps/Sydney-Rail-and-Ferry-Map.gif&imgrefurl=http://mappery.com/map-of/Sydney-Rail-and-Ferry-Map&h=960&w=1280&sz=119&tbnid=lObPJkH9F6sMlM:&tbnh=90&tbnw=120&zoom=1&usg=__W8PL-LxGZlpwoSZKgkDO0oPC-yI=&docid=4b-_sR_pZVEltM&sa=X&ei=CnG8T8rMLIO3rAfIguGeDQ&ved=0CHAQ9QEwAg&dur=513 – raju May 23 '12 at 05:11
  • Then this specific requirement should have been a part of the question in the first place fella. I am sure, that my solution would work just fine for what is apparent from your OP. But not sure if it is capable of displaying something like your example. – Siddharth Lele May 23 '12 at 05:17