For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /upgrading/v4.md.

Upgrading from 3.x to 4.0

4.0 has one breaking change: the Algolia provider is removed, because Algolia shut down Algolia Places. Everything else works the same as in 3.11. If you go further to 5.x, read 4.x to 5.0 next.

Updating the package

package.json
{
  "dependencies": {
    "leaflet-geosearch": "^3.11.1"
    "leaflet-geosearch": "^4.0.0"
  }
}

The dependencies, the files in the package and the browser support are the same as in 3.11.

The Algolia provider is removed

AlgoliaProvider is no longer exported. Algolia Places stopped answering, so the provider couldn't find anything anyway. Pick another provider, for example OpenStreetMap, which needs no API key:

import { AlgoliaProvider } from 'leaflet-geosearch'; 
import { OpenStreetMapProvider } from 'leaflet-geosearch'; 

const provider = new AlgoliaProvider(); 
const provider = new OpenStreetMapProvider(); 

The providers section of the docs lists all of them, with their options and whether they need a key.

New in 4.0

  • the result types of the Esri provider are exported for TypeScript