This makes no sense.
The X Y on the screen depends on the scale, orientation, and
projection which a map view is using. If you have no map view,
or don't know ALL of that information from the map view you are
using, then you can look at this two ways:
(1) there's no way to know the X Y on the screen from the
latitude and longitude,
-or-
(2) you have infinite freedom to devise your own approach
to scale, orient and project latitude and longitude onto
the 2D screen space
On Jan 10, 1:40 pm, Machete <[email protected]> wrote:
> Hi guys, I need to convert the lat/long coord to pixel xy coord to
> show a dot on the top of some image, I know I can use the following
> code inside MapView to do that conversion:
>
> mapView.getProjection().toPixels(location.getPoint(), screenCoords);
> int x=screenCoords.x;
> int y=screenCoords.y;
>
> however, I don't want to show or use the MapView, I just want to
> extract the X and Y screen coord, because I have my own background, my
> app will use a simple ImageView to display that background and I want
> to draw a little dot on canvas, on the top of that background, that
> dot will only appear if that location respect some range.
>
> To better understand the question, imagine I have an aerial photo
> showing some building, I know the lat/long of that building, and I
> want to display a dot representing the building and a second dot if my
> actual position is near from that local.
>
> How I can get the XY pixel screen position of that location without
> showing the MapView?
--
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