ItemizedOverlay after error

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

ItemizedOverlay after error

Postby kid0432 » Sat Aug 28, 2010 5:27 pm

I'm very sorry, my poor english..and I'm inexperience for android

pardon me,please

the original program is


"public class GeoPointImageOverlay extends Overlay"


then I change to


"public class GeoPointImageOverlay extends
ItemizedOverlay<OverlayItem>"


this is an error in paragraph
"public GeoPointImageOverlay(GeoPoint gp, int i)"


I want to overlay the graphics change to item processing


but the middle do not know how to deal with


this is first code
http://paste.plurk.com/show/296366/


the second
http://paste.plurk.com/show/298851/


the original is draw in map,if I want change to ItemizedOverlay<OverlayItem>

then I how to change it ?? Can give me some advance,very thank you .
kid0432
Freshman
Freshman
 
Posts: 2
Joined: Sat Aug 28, 2010 5:13 pm

Top

Re: ItemizedOverlay after error

Postby jonbonazza » Sat Aug 28, 2010 11:15 pm

jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: ItemizedOverlay after error

Postby kid0432 » Mon Aug 30, 2010 8:12 am

I see ItemizedOverlay ,but I don't know how to use draw to achieve onTap not use ItemizedOverlay.
kid0432
Freshman
Freshman
 
Posts: 2
Joined: Sat Aug 28, 2010 5:13 pm

Re: ItemizedOverlay after error

Postby prongs_386 » Wed Sep 15, 2010 2:51 pm

Your ItemizedOverlay class should keep track of the overlays that you are displaying for instance in a variable mOverlays. Then you override onTap in this class and use the index parameter to get the Overlay out of the list mOverlays.

Code: Select all
@Override
public boolean onTap(int index) {
     int s = mOverlays.size();
     if (index >= 0 && index < mAssets.size()) {
         Overlay o = mOverlays.get(index);

         // Do something with your overlay that was tapped
    }

    return true;
}
prongs_386
Freshman
Freshman
 
Posts: 7
Joined: Mon Sep 13, 2010 3:27 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests