I want to convert a few (X,Y) positions on the mapbox map to their lnglat positions.
I know project() converts from lnglat to X, Y. But, I can't find the reverse.
I want to convert a few (X,Y) positions on the mapbox map to their lnglat positions.
I know project() converts from lnglat to X, Y. But, I can't find the reverse.
map.unproject()
exists and does what you need: https://docs.mapbox.com/mapbox-gl-js/api/map/#map#unproject