Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@maplibre/maplibre-gl-geocoder

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maplibre/maplibre-gl-geocoder

A geocoder control for Maplibre GL JS

  • 1.7.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by36.49%
Maintainers
0
Weekly downloads
 
Created
Source

MapLibre GL Geocoder

A geocoder control for maplibre-gl-js.

Usage

A full working example can be found here, which uses Nominatim: https://maplibre.org/maplibre-gl-js/docs/examples/geocoder/

Usage with a module bundler

npm install --save @maplibre/maplibre-gl-geocoder
import MaplibreGeocoder from '@maplibre/maplibre-gl-geocoder';
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';
...
// Functions should return Carmen GeoJSON, see the relevant type in this project
// View config definitions in our [documentation](https://www.maplibre.org/maplibre-gl-geocoder/)
var Geo = {
  // required
  forwardGeocode: async (config) => { /* definition here */ },
  
  // optional
  reverseGeocode: async (config) => { /* definition here */ }, // reverse geocoding API
  getSuggestions: async (config) => { /* definition here */ }, // suggestion API
  searchByPlaceId: async (config) => { /* definition here */ } // search by Place ID API
};

// Pass in or define a geocoding API that matches the above
const geocoder = new MaplibreGeocoder(Geo, { maplibregl: maplibregl });
map.addControl(geocoder);

Using without a Map

It is possible to use the plugin without it being placed as a control on a maplibre-gl map.

Deeper dive

API Documentation

See here for complete reference.

Also check out the example in MapLibre docs: https://maplibre.org/maplibre-gl-js/docs/examples/geocoder/

Contributing

See CONTRIBUTING.md.

Licence

ISC © MapLibre © Mapbox

Keywords

FAQs

Package last updated on 10 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc