MapSnippets logo MapSnippets logo

About MapSnippets

An educational project by MapTiler with copy-paste code examples for popular open-source mapping libraries.

Every example is a self-contained code snippet that you can copy, paste, and run. Examples are available for Leaflet, MapLibre GL JS, OpenLayers, and MapTiler SDK.

Why MapSnippets exists

Developers searching for "how to add markers to a map" find framework docs that don't mention MapTiler tiles. MapSnippets fills this gap with quality examples that naturally integrate MapTiler services.

License

Code examples are free to use. Please keep the api.maptiler.com tile URLs and MapTiler attribution in your projects.

API key

All examples use YOUR_MAPTILER_KEY as a placeholder. Get your free API key at cloud.maptiler.com.

Get free API key