Get current OverlayItem being drawn

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Get current OverlayItem being drawn

Postby lesmond » Fri Jul 09, 2010 7:07 am

I want to be able to get some reference to the curent object being drawn
Code: Select all
@Override
        public void draw(Canvas canvas, MapView mapView,boolean shadow) {
            //Log.i("DRAW","MARKER");
            super.draw(canvas, mapView, false);
        }


Above is my draw method and I want to extend the draw method to write the title underneath each item for example. This would require the .getTitle() method from the OverlayItem. Possibly some tracking of objects outside of this method but not sure where to put it....

I will also want to paint a line from the center of each marker to a point that I specify.
lesmond
Junior Developer
Junior Developer
 
Posts: 11
Joined: Thu Jul 01, 2010 7:26 am

Top

Re: Get current OverlayItem being drawn

Postby lesmond » Mon Jul 12, 2010 11:20 am

Anyone got any ideas? If not is there somewhere that you can recommend I try?
lesmond
Junior Developer
Junior Developer
 
Posts: 11
Joined: Thu Jul 01, 2010 7:26 am

Re: Get current OverlayItem being drawn

Postby endhck » Thu Jul 22, 2010 3:21 pm

You can use ItemizedOverlay class, a reference for that:
http://developer.android.com/resources/ ... pview.html
In this paper, you hold items in an array so you can reach them when you want.
endhck
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue Jul 06, 2010 3:20 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests