Android
com.google.android.maps
public interface

com.google.android.maps.Projection

com.google.android.maps.Projection

A Projection serves to translate between the coordinate system of x/y on-screen pixel coordinates and that of latitude/longitude points on the surface of the earth. You obtain a Projection from getProjection().

Summary

Public Methods

          GeoPoint  fromPixels(int x, int y)
Create a new GeoPoint from pixel coordinates relative to the top-left of the MapView that provided this PixelConverter.
          float  metersToEquatorPixels(float meters)
Converts a distance in meters (along the equator) to one in (horizontal) pixels at the current zoomlevel.
          Point  toPixels(GeoPoint in, Point out)
Converts the given GeoPoint to onscreen pixel coordinates, relative to the top-left of the MapView that provided this Projection.

Details

Public Methods

public GeoPoint fromPixels(int x, int y)

Create a new GeoPoint from pixel coordinates relative to the top-left of the MapView that provided this PixelConverter.

public float metersToEquatorPixels(float meters)

Converts a distance in meters (along the equator) to one in (horizontal) pixels at the current zoomlevel. In the default Mercator projection, the actual number of pixels for a given distance will get higher as you move away from the equator.

Parameters

meters the distance in meters

Returns

  • The number of pixels corresponding to the distance, if measured along the equator, at the current zoom level. The return value may only be approximate.

public Point toPixels(GeoPoint in, Point out)

Converts the given GeoPoint to onscreen pixel coordinates, relative to the top-left of the MapView that provided this Projection.

Parameters

in The latitude/longitude pair to convert.
out A pre-existing object to use for the output; if null, a new Point will be allocated and returned.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48