目录

public final class Projection

A final class that extends Object and converts between the screen coordinates and longitude/latitude coordinates.

Public Fields

None.

Constructor

None.

Public Method Summary

Return typeMethod name
LatLngfromScreenLocation(Point point)
VisibleRegiongetVisibleRegion()
PointtoScreenLocation(LatLng latLng)

Public Methods

Method
public LatLng fromScreenLocation(Point point)
Converts screen coordinates to longitude/latitude coordinates.
You can call this method to obtain the longitude and latitude corresponding to a location on the screen. The location on the screen is specified in screen pixels (instead of display pixels) relative to the top left corner of the map (instead of the top left corner of the screen).


Parameters:

Parameter nameParameter desc
pointCoordinates of a location on the screen, in pixels.


Return:

Return typeParameter desc
LatLngLatLng object, indicating the corresponding longitude and latitude.
Method
public VisibleRegion getVisibleRegion()
Obtains the visible region after conversion between the screen coordinates and longitude/latitude coordinates.


Parameters:
None.
Return:

Return typeParameter desc
VisibleRegionVisible region.
Method
public Point toScreenLocation(LatLng latLng)
Converts longitude/latitude coordinates to screen coordinates.
You can call this method to obtain a location on the screen corresponding to a longitude and latitude. The location on the screen is specified in screen pixels (instead of display pixels) relative to the top left corner of the map (instead of the top left corner of the screen).


Parameters:

Parameter nameParameter desc
latLngLongitude and latitude of a location on the map.


Return:

Return typeParameter desc
PointCoordinates of a location on the screen, in pixels.