Issue
I have a Main Activity class which loads the current Location of the user. There is a another class which extends ItemizedOverlay. This class takes care of placing a pinpoint. I have one more class which fetches nearby ATM location.. So i use a for loop for placing pinpoints at all nearby atm location. I want my app to pop up when i tap on a particular pin. Showing vicinity of that place.
for(int i=0; i < placeName.length;i++){
nearbylatitude= (int) (lati[i]*1E6);
nearbylongitude=(int) (longi[i]*1E6);
Log.e("Location", nearbylatitude+"\t \t"+ nearbylongitude);
GeoPoint myLocation_nearby_place= new GeoPoint(nearbylatitude, nearbylongitude);
OverlayItem overlayPlaces=new OverlayItem(myLocation_nearby_place,placeName[i],vicinity[i]);
custom_Places=new CustomPinpoint(drawable_places, MainMapActivity.this);
custom_Places.addPinPoints(overlayPlaces);
overlayList.add(custom_Places);
}
This is the for loop which places pin point at nearby Location. I know that there is a Method onTap() with ItemizedOverlay... But i dnt know when to call that function and how to retreive which pin is tapped.
Need a urgent help..
Solution
Use the following:
public OverlayItem(GeoPoint point, java.lang.String title, java.lang.String snippet) Parameters: point - Position of the item. title - Title text. snippet - Snippet text.
OverlayItem currentOverlay = new OverlayItem(CurrLocGeoPoint(),"Text for bubble","");
Answered By - Amt87
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.