0

I have a custom View object (extends View) with own draw function. I use it in list of items in ListView with my custom adapter. I would like to use it on map also. How can I crate map marker from instance of my view object? I think it have to be simple, but I can't find right way myself, and deadline is hot.

Thank in advance. Rado.

Rado Dr.
  • 425
  • 1
  • 3
  • 10
  • Check this [earlier post](http://stackoverflow.com/questions/17391445/multiple-line-or-break-line-in-snippet-google-maps-apiv2/17393978#17393978) for a suitable method – tony m Jul 05 '13 at 14:24
  • @tony This is not what this question is about. – MaciejGórski Jul 05 '13 at 14:27

1 Answers1

0

To create Bitmap from View you need to measure, layout and draw it youself onto Canvas.

This code will help you get to the point: https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/ui/BubbleIconFactory.java#L60. Take a look at the makeIcon method there. "One code is more than 1000 comments."

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
  • Thank for your answer. But at that sample is process of making view from layout or from resource. I don't need that case. I already have a my own custom view with own onDraw function, where I use an canvas and draw functions. So I need only transform that view to bitmap. But your answer show me the right direction, where I have to find how to change view to bitmap. I find it for example here: http://code.neenbedankt.com/how-to-render-an-android-view-to-a-bitmap/ – Rado Dr. Jul 09 '13 at 07:52