English | Site Directory

Android - An Open Handset Alliance Project

com.google.android.maps
public static class

com.google.android.maps.Overlay.PixelCalculator

java.lang.Object
com.google.android.maps.Overlay.PixelCalculator

An object capable of converting latitude, longitude into an on-screen pixel coordinate. For performance reasons, the values are returned into a size-two array of ints which should be created and maintained by the caller. (For example, you may use the provided sXYCoords.)

Summary

Public Methods

        int  getMapHeight()
        int  getMapWidth()
        void  getPointXY(Point point, int[] xyCoords)
Converts a lat/lon pair to an x/y screen-pixel pair.
        int  getZoomLevel()
Methods inherited from class java.lang.Object

Details

Public Methods

public int getMapHeight()

public int getMapWidth()

public void getPointXY(Point point, int[] xyCoords)

Converts a lat/lon pair to an x/y screen-pixel pair.

Parameters

point The point containing the lat/lon to convert.
xyCoords a size-2 array of ints where the pixel x/y will be stored.

public int getZoomLevel()

Returns

  • the zoom level at which the map is currently being displayed. At zoomLevel 1, the equator of the earth is 256 pixels long. Each successive zoom level is magnified by a factor of 2.
Build m5-rc15i - 10 Jun 2008 13:54