0

enter image description hereI am working on an application where i need to show images that comes from server url, as the annotation(marker) on google map something like profile pic of the user. How to use a layout or custom view as the marker?

Thanks RawCoder

rawcoder064
  • 1,374
  • 3
  • 11
  • 26

1 Answers1

1

You can use OverlayItem.setMarker().

overlayItem.setMarker(icon);

Where icon is the Drawable you retrieve from your URL.

EDIT in addition to your comment and your edited question:

I'd recommend you add the one image you posted in your question in the resources drowables and use it as a basis drawable. The retrieve the custom image from your URL and overlay it onto the existing one creating a new drawable image which you'll be able to use with setMarker().

The click will be caught by Overlay.onTap().

slybloty
  • 6,346
  • 6
  • 49
  • 70
  • Thanks for quick reply. But i need something more. I have edited my question and added an image.Like this image i need to use a layout where i can put the server image. And also want to add click listener on that layout. how can i convert layout to marker drawable. Can you post some code?? – rawcoder064 Aug 26 '12 at 08:14
  • Can you post some code of how can i get drawable from layout xml. And one more thing i need to plot lots of pin on map so i have to implement lazy loading of images otherwise it will take too much time to get the drawable from url and then plot on map. How can i do this lazy loading? – rawcoder064 Aug 28 '12 at 18:50
  • Do you have any idea how to implement this :http://stackoverflow.com/questions/10070347/android-how-to-to-set-imageview-as-a-marker-in-google-map-api-android – Jay Thakkar Sep 26 '12 at 04:47