Leaflet.LanguageSelector

A simple and customizable language selector control for Leaflet maps. Supports both vertical and horizontal layouts, custom icons, and programmatic language switching with the setLanguage() API.

CC0-1.0 Licensed – View on GitHub or read the Leaflet documentation.

Leaflet.LanguageSelector demo screenshot showing multiple language selector variations
Example implementation

Interactive Demo

View Live Demo with 16 Examples →

References

🥗 VeggieKarte – Map of vegetarian and vegan locations →

Does your open-source project use this plugin? Let us know and we'll add it here!

Features

🌐 ES6 Modules

Pure ES6 module exports with named imports. No global namespace pollution. Works with modern bundlers and Import Maps for browser usage.

🎨 Customizable

CSS custom properties for theming, vertical/horizontal layouts, button or always-visible modes, and support for custom language icons.

⌨️ Accessible

Full keyboard navigation support with Enter/Space keys, ARIA attributes, and proper focus management for screen readers.

🔧 Programmatic API

Control language selection programmatically with setLanguage(langId) method. Perfect for URL parameters or external UI integration.

📦 Zero Dependencies

Single-file plugin with no build step required. Just import and use. Only peer dependency is Leaflet 1.9+ or 2.x.

📘 TypeScript Support

Includes TypeScript definitions for full type safety and IntelliSense support in modern editors.