79220659

Date: 2024-11-24 17:10:26
Score: 1
Natty:
Report link

As per documentation and examples, the new way is:

import mbxClient from '@mapbox/mapbox-sdk';
import mbxGeocoding from '@mapbox/mapbox-sdk/services/geocoding';

const mapboxClient = mbxClient({ accessToken: MAPBOX_API });
const geocodingClient = mbxGeocoding(mapboxClient);

geocodingClient.reverseGeocode({
  query: [-95.4431142, 33.6875431]
})
  .send()
  .then(response => {
    // GeoJSON document with geocoding matches
    const match = response.body;
  });
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: cellulosa