Class Info |
|---|
public final class Projection Final class that extends Object. This class is used for conversion between screen coordinates and longitude and latitude. An instance of this type will be returned when the getProjection method in the HuaweiMap class is called. |
Qualifier and Type | Method Name and Description |
|---|---|
fromScreenLocation(Point point) Obtains the longitude and latitude of a location on the screen. | |
| Obtains the visible region after conversion between the screen coordinates and longitude/latitude coordinates. | |
Point | toScreenLocation(LatLng latLng) Obtains a location on the screen corresponding to the specified longitude/latitude coordinates. |
Method |
|---|
public LatLng fromScreenLocation(Point point) Obtains the longitude and latitude of 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
Name | Description |
|---|---|
point | Coordinate point on the screen, in pixels. The value ranges from INT_MIN to INT_MAX. NOTE: This parameter has a fixed value of (90, 0) if the line connecting the selected point (coordinate point on the screen) and camera is almost in parallel with the ground. |
Returns
Type | Description |
|---|---|
LatLng | LatLng object that contains the corresponding longitude and latitude. |
Method |
|---|
public VisibleRegion getVisibleRegion() Obtains the visible region after conversion between the screen coordinates and longitude/latitude coordinates. |
Returns
Type | Description |
|---|---|
Visible region. |
Method |
|---|
public Point toScreenLocation(LatLng latLng) Obtains a location on the screen corresponding to the specified longitude/latitude coordinates. 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
Name | Description |
|---|---|
latLng | LatLng object that contains the corresponding longitude and latitude. The value ranges from -180 to 180 for the longitude and from -85.05 to 85.05 for the latitude. NOTE: This parameter has a fixed value of (INT_MAX,INT_MAX) if the longitude and latitude are out of the view frustum of the map camera. |
Returns
Type | Description |
|---|---|
Point | Coordinate point on the screen, in pixels. |