Friday, June 25, 2010

Re: [android-developers] Re: Mapping (x,y) to (latitude,longitude)

the pixel origin should be at the top left right?
How can I assume the screen size then?

if (0,0) is the center, screenWidth and screenHeight would be where?

I was assuming that:

mymap.getProjection().fromPixels(0, 0) would give me the top left

mymap.getProjection().fromPixels(screenwidth, screenheight) would give
me the bottom right

and from there I could take the latitude and longitude of each
corner.. is that possible?
For example:

GeoPoint X = mapView.getProjection.fromPixeis(0,0);
GeoPoint Y = mapView.getProjection.fromPixeis(screenWidth,screenHeight);
X.getLatitude(); Would give me the top latitude
Y.getLatitude(); Would give me the bottom latitude
X.getLongitude(); Would give me the left longitude
Y.getLongitude(); Would give me the right longitude

And with those values I have the area of the screen with the
boundaries latitude/longitude wise which is the values that I need to
perform my algorithm.

On Jun 25, 2010, at 7:23 PM, Frank Weiss wrote:

> I don't see a problem there, except that the pixel origin appears to
> be at the center of the map view!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

Pedro Teixeira

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment