Yes, you're probably right, but how should I compute the midpoint? I tried by simply averaging the lat/long pairs of each cluster point but the on-screen midpoint and the on-map midpoints were the same one only when the point of the cluster were very near, and they diverge as soon as the cluster spreads. So I guess a simple linear average is not the right way to compute it.
Have you got any suggestion? -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: martedì 1 aprile 2008 17.22 To: Android Developers Subject: [android-developers] Re: Finding position of a screen point In that case, I think it's easier to calculate the midpoint using to lat/lng of every point so the result of the calculation will be a lat/ lng coordinate. On Apr 1, 4:41 pm, "Semeria Stefano" <[EMAIL PROTECTED]> wrote: > If I'm not wrong the PixelCalculator class provides functionality to compute > a screen coordinate > pair from a Point on the map (as a pair of longitude,latitude coords) by > getPointXY(Point point, int[] xyCoords). > What I need is exactly the opposite, I need to transform a pair of screen > coordinate into a > Lat/long pair on the map. > > Thanks for your help anyway. > > Regards, > > Stefano > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf > Of [EMAIL PROTECTED] > Sent: martedì 1 aprile 2008 16.24 > To: Android Developers > Subject: [android-developers] Re: Finding position of a screen point > > Use the PixelCalculator class > > On Apr 1, 2:28 pm, "Semeria Stefano" > <[EMAIL PROTECTED]> wrote: > > Hi all, > > > In my application I am showing a MapView with a cluster of moving > > points. I need to seldom center the map on the midpoint of the cluster. > > > I am able to compute the midpoint position in screen coordinates (by > > averaging the positions of all points of the cluster before drawing) but > > I need to find out the midpoint position on the map. > > > Have you got any suggestion? Another useful use case should be allowing > > the user to click on the map and retrieving the corresponding map > > position... How can I compute the position from the pixel coordinate in > > general? > > > Thanks for your help > > > Regards > > > Stefano --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

