Hi Pedro,

There are several ways to do it, but you probably want to do it when you create the overlay. If you are not using the overlayItem tag for anything else, just set the tag to the Geopoint, and then you can access it by casting the tag to a Geopoint after you get the item in the code below. As I said, there are lots of other ways.. but that is normally my preferred way, because it keeps the information you want with the item.



On 08/07/2010 9:28 AM, Pedro Teixeira wrote:
Is there anyway to get the values that created this overlay and compare them with the values of GeoPoint geo ? My code is aproximmating values so I never get the numbers right... I don't know which values can I use from the onTap method to compare with the ones that created the overlay itself besides the latitude and longitude values...
protected boolean onTap(int i) {
OverlayItem item=getItem(i);
GeoPoint geo=item.getPoint();
Point pt=map.getProjection().toPixels(geo, null);
View view=panel.getView();
((TextView)view.findViewById(R.id.latitude))
.setText(String.valueOf(geo.getLatitudeE6()/1000000.0));
((TextView)view.findViewById(R.id.longitude))
.setText(String.valueOf(geo.getLongitudeE6()/1000000.0));
((TextView)view.findViewById(R.id.x))
.setText(String.valueOf(pt.x));
((TextView)view.findViewById(R.id.y))
.setText(String.valueOf(pt.y));
panel.show(pt.y*2>map.getHeight());
return(true);
}



On Jul 5, 2010, at 11:03 PM, Mark Murphy wrote:

On Mon, Jul 5, 2010 at 5:58 PM, Pedro Teixeira
<[email protected] <mailto:[email protected]>> wrote:
Any news on how to implement this ? Is overriding the class that
extends itemizedOverlay on the onTap method enough?
I need to show information when the user clicks a marker and cant seem
to find possibilities

Here are examples of how I've done it:

http://github.com/commonsguy/cw-android/tree/master/Maps/NooYawk/
http://github.com/commonsguy/cw-advandroid/tree/master/Maps/EvenNooerYawk/

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Consulting: http://commonsware.com/consulting

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Pedro Teixeira

www.pedroteixeira.org <http://www.pedroteixeira.org>

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Sincerely,

Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://www.bgies.com
http://www.bistroblurb.com
http://www.ihottonight.com
-----------------------------------------------------------------------

Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to