project(
lnglat:LngLatLike):Point
Defined in: ui/map.ts:2092
Returns a Point representing pixel coordinates, relative to the map's container,
that correspond to the specified geographical location.
A location behind the camera has no corresponding pixel. For such a location the returned point is outside the viewport, on the side through which the location left the screen, one viewport width or height away from the edge.
Parameters
| Parameter | Type | Description |
|---|---|---|
lnglat |
LngLatLike |
The geographical location to project. |
Returns
Point
The Point corresponding to lnglat, relative to the map's container.
Example
let coordinate = [-122.420679, 37.772537];
let point = map.project(coordinate);