finds.dev

stefanocudini/leaflet-search

Search stuff in a Leaflet map

View on GitHubHomepage ↗

★ 814JavaScriptMITupdated Jun 2024

// the take

A Leaflet control that adds a search box for finding markers or GeoJSON features by a property value, with autocomplete and optional ajax/jsonp lookups. It's for anyone building a Leaflet map who needs 'find this place on the map I already have' rather than full geocoding.

Works directly against an existing L.LayerGroup/GeoJSON layer instead of a separate search index, so results stay in sync with what's rendered. Three distinct data paths (layer, sourceData callback, ajax/jsonp url) plus formatData/filterData hooks mean you can wire it to basically any backend or data shape without forking the plugin. Reasonable UX knobs out of the box: debounced autocomplete, tooltip result limits, auto-zoom/pan to match, and a flash marker on the found location. Real adoption outside toy demos (ipyleaflet, folium, flask-admin all use it), so the API has been exercised by other maintainers.

README states it's only tested against Leaflet 0.7.x and 1.3.x; there's no mention of 1.9.x or the 2.x line, and the last push was mid-2024, so compatibility with current Leaflet is unverified. Matching is a plain in-memory filter over a cached record set (_recordsCache) - fine for hundreds of markers, but there's no indexing, so large datasets need you to build your own server-side search behind the ajax/jsonp option. No TypeScript definitions, which is friction given how many options and callbacks the API exposes. Single maintainer with a donation link in the README and no visible CI/test suite, so regressions depend entirely on manual review and issue reports.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
814
Forks
338
Language
JavaScript
License
MIT
Last commit
30 Jun 2024

// nearby

If leaflet-search isn't quite it.

All repos →