plox
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

plox

Simple wrapper for Mapbox Places Search

Installation

Using npm npm i plox

Using yarn yarn add plox

Usage

In CommonJS env

const { Searcher } = require('plox');

const searcher = new Searcher(YOUR_MAPBOX_TOKEN);

const places = await searcher.searchAsList('gran vía', {
  country: 'es',
  limit: 10,
  // More options available
});

// places is an array of GeoJSON Features

Using imports

import { Searcher } from 'plox';

const searcher = new Searcher(YOUR_MAPBOX_TOKEN);

const places = await searcher.searchAsFeatureCollection('gran vía', {
  country: 'es',
  limit: 3,
  // More options available
});

// Places is a GeoJSON FeatureCollection

Documentation

See DOCS

Package Sidebar

Install

npm i plox

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

15.9 kB

Total Files

9

Last publish

Collaborators

  • alrico88