unproject(
point:PointLike):LngLat
Defined in: ui/map.ts:2110
Returns a LngLat representing geographical coordinates that correspond to the specified pixel coordinates.
Parameters
| Parameter | Type | Description |
|---|---|---|
point |
PointLike |
The pixel coordinates to unproject. |
Returns
LngLat
The LngLat corresponding to point.
Example
map.on('click', (e) => {
// When the map is clicked, get the geographic coordinate.
let coordinate = map.unproject(e.point);
});