Projection | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Methods | Inherited Methods | [Expand All]
public final class

# Projection

extends Object

java.lang.Object
↳ | com.google.android.gms.maps.Projection

## Class Overview

A projection is used to translate between on screen location and geographic coordinates on the surface of the Earth (`LatLng`). Screen location is in screen pixels (not display pixels) with respect to the top left corner of the map (and not necessarily of the whole screen).

## Summary

Public Methods
LatLng | fromScreenLocation(Point point) Returns the geographic location that corresponds to a screen location.
VisibleRegion | getVisibleRegion() Gets a projection of the viewing frustum for converting between screen coordinates and geo-latitude/longitude coordinates.
Point | toScreenLocation(LatLng location) Returns a screen location that corresponds to a geographical coordinate (`LatLng`).

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Methods

#### public LatLng fromScreenLocation (Point point)

Returns the geographic location that corresponds to a screen location. The screen location is specified in screen pixels (not display pixels) relative to the top left of the map (not the top left of the whole screen).

##### Parameters

point | A `Point` on the screen in screen pixels.

##### Returns

- The `LatLng` corresponding to the `point` on the screen, or `null` if the ray through the given screen point does not intersect the ground plane (this might be the case if the map is heavily tilted).

#### public VisibleRegion getVisibleRegion ()

Gets a projection of the viewing frustum for converting between screen coordinates and geo-latitude/longitude coordinates.

##### Returns

- The projection of the viewing frustum in its current state.

#### public Point toScreenLocation (LatLng location)

Returns a screen location that corresponds to a geographical coordinate (`LatLng`). The screen location is in screen pixels (not display pixels) relative to the top left of the map (not of the whole screen).

##### Parameters

location | A `LatLng` on the map to convert to a screen location.

##### Returns

- A `Point` representing the screen location in screen pixels.