views:

486

answers:

1

In my application I would like to mark different spots on a map. What I'm now wondering is if there's a way to use a simple 9-patch image and add the spot's name as text to it or would I need to draw everything myself (including the text) in the draw() method of ItemizedOverlay?

+1  A: 

As per this Q&A:

http://stackoverflow.com/questions/2127438/drawing-nine-patch-onto-canvas-android

you should be able to load the 9-patch using Resources.getDrawable, set the drawing bounds using Drawable.setBounds, and finally draw to the canvas provided in onDraw using Drawable.draw.

If you plan on reusing the drawable, you should keep an eye out for memory leaks, per this article.

Roman Nurik
Stefan-- did my response work out for you? If not, feel free to follow up.
Roman Nurik